存货账龄分析明细表Word.docx
《存货账龄分析明细表Word.docx》由会员分享,可在线阅读,更多相关《存货账龄分析明细表Word.docx(24页珍藏版)》请在冰豆网上搜索。
存货账龄分析明细表Word
******************************************************************
* PROGRAMSOURCEHEADER
******************************************************************
*ProgramName:
ZHTFI_R019
*Description:
存货账龄分析明细表
*Date/Author:
2012.06.27/许林锋
*TableUpdate:
*SpecialLogic:
*Include:
******************************************************************
* MODIFICATIONLOG
******************************************************************
*ChangeDate *Programer *Request *Desctiption
*-----------------------------------------------------------------
*2007.06.27 *许林锋 *DEVK900358 *NewProgram
*2007.06.28 *许林锋 *DEVK900358 *Change
*2007.06.29 *许林锋 *DEVK900358 *Change
*2007.07.02 *许林锋 *DEVK900358 *Change
*2007.07.03 *许林锋 *DEVK900358 *Change
*2007.07.04 *许林锋 *DEVK900358 *Change
*2007.07.05 *许林锋 *DEVK900358 *Change
*
******************************************************************
*-----------------------------------------------------------------
*ProgramName
*-----------------------------------------------------------------
report zhtfi_r019.
tables:
t001,t001w,t001l,mara,mbew.
*Data
*-----------------------------------------------------------------
*ALV
type-pools:
slis.
data:
i_fieldcat_alvtypeslis_t_fieldcat_alvwithheaderline,
i_layout typeslis_layout_alv, "alv的格式
w_fieldcat typeslis_fieldcat_alv, "alv列属性
w_repid likesy-repid. "当前程序
data:
d_postypeivalue0.
"ranges
ranges:
r_bwkeyfort001k-bwkey, "评估范围
r_bukrsfort001k-bukrs, "公司代码
r_werksfort001w-werks. "工厂
data:
beginofit_dataoccurs0,
bukrsliket001-bukrs, "公司
mjahrlikemkpf-mjahr, "年度
rpmax
(2)typec, "期间
matnrlikemseg-matnr, "物料
maktxlikemakt-maktx, "物料描述
mtartlikemara-mtart, "物料类型
matkllikemara-matkl, "物料组
werkslikemseg-werks, "工厂
lgortlikemseg-lgort, "库位
menge_elikemseg-menge, "期末数量
dmbtr_elikemseg-dmbtr, "期末金额
menge_1likemseg-menge, "1-3月数量
dmbtr_1likemseg-dmbtr, "1-3月金额
menge_2likemseg-menge, "4-6月数量
dmbtr_2likemseg-dmbtr, "4-6月金额
menge_3likemseg-menge, "7-9月数量
dmbtr_3likemseg-dmbtr, "7-9月金额
menge_4likemseg-menge, "10-12月数量
dmbtr_4likemseg-dmbtr, "10-12月金额
menge_5likemseg-menge, "1-2年数量
dmbtr_5likemseg-dmbtr, "1-2年金额
menge_6likemseg-menge, "2-3年数量
dmbtr_6likemseg-dmbtr, "2-3年金额
menge_7likemseg-menge, "3年以上数量
dmbtr_7likemseg-dmbtr, "3年以上金额
endofit_data.
data:
beginofit_werksoccurs0,
bwkeyliket001k-bwkey,"评估范围
bukrsliket001k-bukrs,"公司代码
werksliket001w-werks,"工厂
endofit_werks,
it_werks_bliketableofit_werkswithheaderline.
data:
beginofit_matnroccurs0,
matnrlikemara-matnr, "物料号码
mtartlikemara-mtart, "物料类型
matkllikemara-matkl, "物料组
maktxlikemakt-maktx, "物料描述
endofit_matnr.
data:
beginofit_msegoccurs0,
mblnrlikemkpf-mblnr, "物料凭证
mjahrlikemkpf-mjahr, "年度
budatlikemkpf-budat, "过账日期
zeilelikemseg-zeile, "项目
matnrlikemseg-matnr, "物料
werkslikemseg-werks, "工厂
lgortlikemseg-lgort, "库位
shkzglikemseg-shkzg, "借/贷
dmbtrlikemseg-dmbtr, "本位币金额
mengelikemseg-menge, "数量
endofit_mseg.
data:
beginofit_bsimoccurs0,
bukrslikebkpf-bukrs, "公司代码
belnrlikebkpf-belnr, "会计凭证
gjahrlikebkpf-gjahr, "会计年度
budatlikebkpf-budat, "过账日期
buzeilikebsim-buzei, "项目
matnrlikebsim-matnr, "物料
shkzglikebsim-shkzg, "借/贷
dmbtrlikebsim-dmbtr, "本位币金额
endofit_bsim.
data:
beginofit_lgortoccurs0,
bukrsliket001-bukrs, "公司
werkslikemseg-werks, "工厂
lgortlikemseg-lgort, "库位
endofit_lgort.
data:
beginofit_bukrsoccurs0,
bukrsliket001-bukrs, "公司代码
endofit_bukrs.
data:
beginofit_perproccurs0,
matnrlikemara-matnr, "物料
bukrsliket001-bukrs, "公司代码
perprlikemseg-dmbtr, "单价
endofit_perpr.
data:
p_budat_low_f likemkpf-budat,"查询期间的第一天
p_budat_high_flikemkpf-budat,"查询期间的最后一天
"各个期间的开始结束日
p_budat_low_1 likemkpf-budat,
p_budat_high_1likemkpf-budat,
p_budat_low_2 likemkpf-budat,
p_budat_high_2likemkpf-budat,
p_budat_low_3 likemkpf-budat,
p_budat_high_3likemkpf-budat,
p_budat_low_4 likemkpf-budat,
p_budat_high_4likemkpf-budat,
p_budat_low_5 likemkpf-budat,
p_budat_high_5likemkpf-budat,
p_budat_low_6 likemkpf-budat,
p_budat_high_6likemkpf-budat,
p_budat_low_7 likemkpf-budat,
p_budat_high_7likemkpf-budat,
p_budat_low likemkpf-budat,"期间的第一天
p_budat_highlikemkpf-budat."期间的最后一天
data:
d_menge_i_1likemseg-menge,"d_dmbtr_i_1likemseg-dmbtr,
d_menge_i_2likemseg-menge,"d_dmbtr_i_2likemseg-dmbtr,
d_menge_i_3likemseg-menge,"d_dmbtr_i_3likemseg-dmbtr,
d_menge_i_4likemseg-menge,"d_dmbtr_i_4likemseg-dmbtr,
d_menge_i_5likemseg-menge,"d_dmbtr_i_5likemseg-dmbtr,
d_menge_i_6likemseg-menge,"d_dmbtr_i_6likemseg-dmbtr,
d_menge_i_7likemseg-menge,"d_dmbtr_i_7likemseg-dmbtr,
d_menge_i_elikemseg-menge,d_dmbtr_i_elikemseg-dmbtr,
d_menge_i_e_sumlikemseg-menge,d_dmbtr_i_e_sumlikemseg-dmbtr,
* d_perprlikemseg-dmbtr. "单价
d_perprtypef.
data:
d_menge_ilikemseg-menge,d_dmbtr_ilikemseg-dmbtr,
d_menge_i_sublikemseg-menge,d_dmbtr_i_sublikemseg-dmbtr.
datad_strtypestring.
*SelectionScreen
*-----------------------------------------------------------------
selection-screenbeginofblockblk_1withframetitletext-blk.
select-options:
s_bukrsfort001-bukrsobligatory, "公司
s_werksfort001w-werks, "工厂
s_lgortfort001l-lgort. "库位
selection-screenskip.
select-options:
s_matnrformara-matnr, "物料
s_mtartformara-mtart, "物料类型
s_matklformara-matkl. "物料组
select-options:
s_bklasformbew-bklas. "估价类
selection-screenskip.
parameter:
p_mjahrlikemkpf-mjahrobligatory, "年度
p_rpmax
(2)typecobligatory. "期间
selection-screenendofblockblk_1.
*Define
*-----------------------------------------------------------------
definemove_sub.
d_menge_i=d_menge_i_sub.cleard_menge_i_sub.
* d_dmbtr_i=d_dmbtr_i_sub.cleard_dmbtr_i_sub.
end-of-definition.
definesub_m_d.
d_menge_i_sub=d_menge_i-&1.
* d_dmbtr_i_sub=d_dmbtr_i-&2.
end-of-definition.
definemove_m_d.
&1=d_menge_i.
* &2=d_dmbtr_i.
end-of-definition.
definewrite_screen.
callfunction'SAPGUI_PROGRESS_INDICATOR'
exporting
text=&1.
end-of-definition.
*Initialization
*-----------------------------------------------------------------
initialization.
performsub_initialization.
*AtSelectionScreen
*-----------------------------------------------------------------
atselection-screen.
performfunc_check_authority.
*Startofselection
*-----------------------------------------------------------------
start-of-selection.
performsub_get_data.
*EndSelection.
*-----------------------------------------------------------------
end-of-selection.
ifit_data[]isinitial.
"写屏幕
d_str=text-s04.
write_screend_str.
else.
"写屏幕
d_str=text-s03.
write_screend_str.
performsub_build_layout.
performsub_build_fields.
performsub_dis_data.
endif.
*&---------------------------------------------------------------------*
*& Form sub_get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
formsub_get_data.
*---取数
"写屏幕
d_str=text-s01.
write_screend_str.
"取当前期间的第一天和第二天
concatenatep_mjahrp_rpmax'01'intop_budat_low_f.
callfunction'RP_LAST_DAY_OF_MONTHS'
exporting
day_in =p_budat_low_f
importing
last_day_of_month=p_budat_high_f
exceptions
day_in_no_date =1
others =2.
"取得选择标准下的所有公司代码、评估范围、工厂
selecta~bwkeya~bukrsb~werks
intotableit_werks
fromt001kasa
joint001wasbona~bwkey=b~bwkey
wherea~bukrsins_bukrs
andb~werksins_werks
.
ifnotit_werks[]isinitial.
loopatit_werks.
clear:
r_bukrs,r_bwkey,r_werks,it_bukrs.
"所有公司代码
it_bukrs-bukrs=it_werks-bukrs.
collectit_bukrs.
r_bukrs-sign='I'.
r_bukrs-option='EQ'.
r_bukrs-low=it_werks-bukrs.
appendr_bukrs.
r_bwkey-sign='I'.
r_bw