在SAP中用承諾項(xiàng)目出現(xiàn)金流量表_第1頁(yè)
在SAP中用承諾項(xiàng)目出現(xiàn)金流量表_第2頁(yè)
在SAP中用承諾項(xiàng)目出現(xiàn)金流量表_第3頁(yè)
已閱讀5頁(yè),還剩62頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、在SAP中用承諾項(xiàng)目出現(xiàn)金流量表(報(bào)表開(kāi)發(fā)源代碼)可能使用到的外部數(shù)據(jù) 或SAP數(shù)據(jù)表數(shù)據(jù)的格式、字段等f(wàn)krs財(cái)務(wù)管理范圍主記錄表fops承諾項(xiàng)目主記錄表fmmp現(xiàn)金預(yù)算管理行項(xiàng)目表lfa1供應(yīng)商主記錄表kna1客戶主記錄表bsis總帳未清項(xiàng)表t001公司代碼主記錄表usr21用戶主記錄表adrp用戶地址表bkpf財(cái)務(wù)憑證抬頭表bseg財(cái)務(wù)憑證行項(xiàng)目表glt0總帳科目期間余額表直接法通過(guò)分析憑證的承諾項(xiàng)目來(lái)取數(shù),SAP為該項(xiàng)功能定義了一個(gè)邏輯數(shù)據(jù)庫(kù)C1F.本程序開(kāi)始部分的邏輯數(shù)據(jù)庫(kù)取數(shù)部分是SAP的標(biāo)準(zhǔn)程序,其功能是將與現(xiàn)金流量相關(guān)的數(shù)據(jù)裝入內(nèi)部表G_T_FMMP這部分程序禁止修改。直接法:

2、1、裝入金流量表定義參數(shù)( FORM fill_item_direct )該子程序?qū)⒌默F(xiàn)金流量表項(xiàng)和其對(duì)應(yīng)的承諾項(xiàng)目裝入內(nèi)部表INT_CASHFLOW.2、裝入與現(xiàn)金流量相關(guān)的數(shù)據(jù)這部分是邏輯數(shù)據(jù)庫(kù)裝入,屬于SAP標(biāo)準(zhǔn)程序,數(shù)據(jù)關(guān)系比較復(fù)雜,建議不要做任何改動(dòng)。3、計(jì)算現(xiàn)金流量計(jì)算的基本思路是對(duì)表G_T_FMMP進(jìn)行循環(huán),查找其中每條記錄的承諾項(xiàng)目屬于INT_CASHFLO的表項(xiàng)后,把其金額累計(jì)到相應(yīng)表項(xiàng)。REPORT zcmrpOOl NO STANDARD PAGE HEADING LINE-SIZE 220.TABLES: fkrs, fpos, fmmp, Ifa1, kna1 ,bs

3、is,t001, usr21, adrp, bkpf, bseg, glt0.DATA: BEGIN OF g_t_fmmp OCCURS 300,fikrsLIKE fmmp-fikrs,bukrsLIKE fmmp-bukrs,fiposLIKE fmmp-fipos,wrttpLIKE fmmp-wrttp,gjahrLIKE fmmp-gjahr,perioLIKE fmmp-perio,zhldtLIKE fmmp-zhldt,budatLIKE fmmp-budat,gsberLIKE fmmp-gsber,vo_sak nr LIKE fmmp-vo_sak nr,lifnrLI

4、KE fmmp-lifnr,kunnrLIKE fmmp-k unnr,fwaerLIKE fmmp-fwaer,fkbtrLIKE fmsu-btr001,zbe InrLIKE cooi-refb n,zbuzeiLIKE cooi-rfpos,vo_bukrs LIKE fmmp-vo_bukrs,vo_gjahr LIKE fmmp-vo_gjahr.fitxtLIKE fkrs-fitxt,fnameLIKE ffnd-fname,cn ameLIKE fctr-c name,pn ameLIKE fpos-p name.wtextLIKE fmmp-wtext,END OF g_t

5、_fmmp.DATA: BEGIN OF g_t_fkrs OCCURS 20,fikrs LIKE fkrs-fikrs,fitxt LIKE fkrs-fitxt,END OF g_t_fkrs.DATA: BEGIN OF g_t_fpos OCCURS 200 fipos LIKE fpos-fipos, pn ame LIKE fpos-p name, END OF g_t_fpos.DATA: BEGIN OF g_t_lfa1 OCCURS 200,lifnr LIKE lfa1-lifnr, sortl LIKE lfa1-sortl,END OF g_t_lfa1.DATA:

6、 BEGIN OF g_t_k na1 OCCURS 200,kunnr LIKE kn a1-ku nnr,sortl LIKE kn a1-sortl.END OF g_t_k na1.RANGES: r_ku nnr FOR kn a1-ku nnr,r_lifnr FOR Ifa1-lifnr,r_fipos FOR fmmp-fipos.DATA: BEGIN OF incashflow OCCURS 100,desc(66)TYPE c,r_fipos(66)TYPE c,com_fkbtrLIKE fmmp-fkbtr,fi_fkbtrLIKE fmmp-fkbtr,fi_fwa

7、erLIKE fmmp-fwaer,END OF in t_cashflow.DATA: BEGIN OF g_t_t001 OCCURS 300,bukrs LIKE t001-bukrs,butxt LIKE t001-butxt,END OF g_t_t001.DATA:posTYPE i VALUE 0,num_of_bukrs TYPE i VALUE 0.DATA cashflow_detail.max budatLIKE fmmp-budat,z_min _budatLIKE sy-datum,z_max_budatLIKE sy-datum,z_bukrsLIKE fmmp-b

8、ukrs,z_profitLIKE bseg-dmbtr,z_bad_debitLIKE bseg-dmbtr,z_asset_depLIKE bseg-dmbtr,z_intan g_depLIKE bseg-dmbtr,z_lon gpaid_dep LIKE bseg-dmbtr.z_paid_decLIKE bseg-dmbtr,z_accrul_ incLIKE bseg-dmbtr,z_asset_proLIKE bseg-dmbtr,z_asset_scrLIKE bseg-dmbtr,z_fi_expe nLIKE bseg-dmbtr,z_in vest_lossLIKE b

9、seg-dmbtr,z_defer_taxLIKE bseg-dmbtr,z_stockLIKE bseg-dmbtr,z_arLIKE bseg-dmbtr,z_apLIKE bseg-dmbtr,z_otherLIKE bseg-dmbtr,z_product ionLIKE bseg-dmbtr,z_lossLIKE bseg-dmbtr,z_asset_debitLIKE bseg-dmbtr,z_in vest_debit LIKE bseg-dmbtr, z_asset_ in vest LIKE bseg-dmbtr, z_stock_debit LIKE bseg-dmbtr,

10、 z_asset_re nted LIKE bseg-dmbtr, z_don ati onLIKE bseg-dmbtr,"凈利潤(rùn)"壞帳準(zhǔn)備及計(jì)提的資產(chǎn)減值準(zhǔn)備"固定資產(chǎn)折舊"無(wú)形資產(chǎn)攤銷"長(zhǎng)期待攤費(fèi)用攤銷"待攤費(fèi)用減少"預(yù)提費(fèi)用增加"固定資產(chǎn),長(zhǎng)期資產(chǎn)處置損失"固定資產(chǎn)報(bào)廢損失"財(cái)務(wù)費(fèi)用"投資損失"遞延稅款貸項(xiàng)"存貨減少"經(jīng)營(yíng)性應(yīng)收減少"經(jīng)營(yíng)性應(yīng)付增加"其他"經(jīng)營(yíng)活動(dòng)產(chǎn)生的現(xiàn)金凈額"總公司下?lián)軓浹a(bǔ)虧損"

11、以固定資產(chǎn)償還債務(wù)"以投資償還債務(wù)"以固定資產(chǎn)投資"以存貨償還債務(wù)"融資租賃固定資產(chǎn)"接受捐贈(zèng)非現(xiàn)金資產(chǎn)z_debit_shortLIKE bseg-dmbtr,"償還的經(jīng)營(yíng)性債務(wù)z_debit_equitLIKE bseg-dmbtr,"債務(wù)轉(zhuǎn)為資本z_bond_dueLIKE bseg-dmbtr,"一年內(nèi)到期的可轉(zhuǎn)換公司債券z_money_in itLIKE bseg-dmbtr,"貨幣資金期初余額z_mon ey_e ndLIKE bseg-dmbtr,"貨幣資金期末余額z_cashs_

12、 initLIKE bseg-dmbtr,"現(xiàn)金等價(jià)物期初余額z_cashs_e ndLIKE bseg-dmbtr,"現(xiàn)金等價(jià)物期末余額z_all_ moneyLIKE bseg-dmbtr."貨幣資金及現(xiàn)金等價(jià)物凈變動(dòng)DATA: BEGIN OF itb0 OCCURS 0,txt(70) TYPE c,numLIKE bseg-dmbtr,END OF itb0,mtxt(70) TYPE c.INITIALIZATION.PERFORM fill_item_direct.*START-OF-SELECTION.GET fkrs.g_t_fkrs-fikrs

13、 = fkrs-fikrs. g_t_fkrs-fitxt = fkrs-fitxt. APPEND g_t_fkrs.GET fpos.g_t_fpos-fipos = fpos-fipos.g_t_fpos-p name = fpos-p name.COLLECT g_t_fpos.GET fmmp.MOVE-CORRESPONDING fmmp TO g_t_fmmp.CASE fmmp-wrttp.WHEN '50' OR '51'.g_t_fmmp-zbe Inr = fmmp-ebe In. g_t_fmmp-zbuzei = fmmp-ebelp.

14、WHEN '64'.g_t_fmmp-zbe Inr = fmmp-kb Inr. g_t_fmmp-zbuzei = fmmp-kblpos.WHEN '65'."purchase order"payme nt tran sfer"funds commitme nts"Fi docume ntsg_t_fmmp-zbe Inr = fmmp-kb Inr. g_t_fmmp-zbuzei = fmmp-kblpos. WHEN OTHERS.g_t_fmmp-zbe Inr = fmmp-vo_bel nr.g_t_fm

15、mp-zbuzei = fmmp-vo_buzei.ENDCASE.APPEND g_t_fmmp.IF NOT fmmp-kunnr IS INITIAL.r_kunn r-sig n = 'I'.r_kunn r-opti on = 'EQ'.r_kunnr-low= fmmp-k unnr.COLLECT r_ku nnr.ENDIF.IF NOT fmmp-lifnr IS INITIAL. r_lifnr-sig n= T.r_lifnr-optio n = 'EQ'. r_lifnr-low = fmmp-lifnr. COLLECT

16、 r_lifnr.ENDIF.END-OF-SELECTION.SORT g_t_fmmp BY fikrsbukrsfiposwrttpgjahrperiozhldtzbel nrzbuzei bukrsvo_sak nr.RANGES: lr_lifnr FOR lfa1-lifnr,lr_ku nnr FOR kn a1-ku nnr.DATA: l_cnt_from LIKE sy-tabix VALUE 1,l_cnt_toLIKE sy-tabix VALUE 50,DESCRIBE TABLE r_lifnr LINES l_cnt_li nes.IFI_cn t_li nes&

17、quot;<-i nsert<=l_cn t_li nes LIKE sy-tabix."<-i nsert"/ Lieferanten-Kurztexte auf einmal einlesenSELECT lifnr sortl FROM lfa1INTO CORRESPONDING FIELDS OF TABLE g_t_lfa1WHERE lifnr IN r lifnr.ELSE."<-i nsert"<-i nsert"/ Liefera nten-Kurztexte in Bloecke n einl

18、 ese nDO."<-in sert"<-i nsert"/ Bloecke zu je 50 Lefera nten bilde nlrlifnr."<-i nsertREFRESH"<-i nsert"<-LOOP AT r lifnr FROM l ent from TO l cnt to.lr lifnr = r lifnr.in sertAPPEND lr lifnr."<-in sertENDLOOP."<-in sertIF sy-subre NE 0.&q

19、uot;<-in sertEXIT."<-in sertENDIF."<-i nsertl cnt from = l cnt to+ 1."<-l_cn t_to=l_c nt_from + 50."<-in sert*"/ Liefera nten-Kurztexte lese nin sertSELECT lifnr sortl FROM lfa1in sertAPPENDINGCORRESPONDINGELDSOF TABLEg_t_lfa1 in sertWHERE lifnr IN lr_lifnr.in

20、 sertENDDO."<-i nsertENDIF."<-i nsert"<-"<-"<-insert"<-"<-ENDIF.* "/ Lese n Debitore n-Texte aus Stammdate n-TabelleIF NOT r_ku nnr IS INITIAL.LOOP AT r_kunnr WHERE low = '*'.DELETE r_kunnr.ENDLOOP.DESCRIBE TABLE r_kunnr LINES l_cn

21、t_li nes."<- i nsertIFl_cn t_li nes<=50."<- i nsert* "/ Kunden-Kurztexte auf ein mal einl ese n"<-in sertSELECT kunnr sortl FROM knalINTO CORRESPONDING FIELDS OF TABLE g_t_k na1WHERE kunnr IN r_ku nnr.ELSE."<-i nsert"/ Kunden-Kurztexte in Bloecke n einl e

22、se n DO."<-i nsert"/ Bloecke zu je 50 Kunden bildenlr_kunnr."<- insertLOOP AT r_ku nnr FROM l_cnt_from TO l_cn t_to."<lr_k unnr = r_kunnr.in sertAPPEND lr_kunnr.in sertENDLOOP."<-i nsertIF sy-subrc NE 0.in sertEXIT."<-i nsertENDIF."<-i nsertl_cnt_

23、from = l_cn t_to+ 1."<-i nsert"<-insertREFRESH-in sert"<-"<-"<-"<-"<-l_c nt_to= l_c nt_from + 50.in sert*"/ Kunden-Kurztexte lese nin sertSELECT kunnr sortl FROM knal in sertAPPENDINGCORRESPONDINGELDSOF TABLEg_t_k na1 in sertWHERE kunnr IN

24、 lr_kunnr.in sertENDDO."<-i nsertENDIF."<-i nsert"<-"<-"<-insert"<-"<-ENDIF.SELECT bukrs butxt FROM t001INTO CORRESPONDING FIELDS OF TABLE g_t_t001.DATA: l_sav_wrttp_text(30), l_sav_fwaer LIKE fmmp-fwaer, l_sav_butxt LIKE t001-butxt, l_sav_hide

25、_row_type(4).num of bukrs = 0.max_budat = 0.min _budat =''.LOOP AT g_t_fmmp.IF min _budat > g_t_fmmp-budat .min _budat = g_t_fmmp-budat .ENDIF.IF max_budat < g_t_fmmp-budat .max_budat = g_t_fmmp-budat .ENDIF.I_sav_fwaer = g_t_fmmp-fwaer.AT NEW fikrs.LOOP AT i nt_cashflow.CLEAR in t_cas

26、hflow-fi_fkbtr.MODIFY TABLE in t_cashflow.CLEAR in t_cashflow.ENDLOOP.ENDAT.AT NEW bukrs.PERFORM read_bukrs_text USING g_t_fmmp-bukrsCHANGING g_t_t001-butxt.l sav butxt = g t t001-butxt.LOOP AT i nt_cashflow.CLEAR in t_cashflow-com_fkbtr.MODIFY TABLE in t_cashflow.CLEAR in t_cashflow.ENDLOOP.ENDAT.L

27、OOP AT in t_cashflow.PERFORM in put_ra nge USING in t_cashflow-r_fipos.LOOP AT r_fipos.IF r_fipos-opti on = 'EQ'.IF r_fipos-low = g_t_fmmp-fipos.in t_cashflow-fi_fkbtr=in t_cashflow-fi_fkbtr+ g_t_fmmp-fkbtr.in t_cashflow-com_fkbtr =in t_cashflow-com_fkbtr+ g_t_fmmp-fkbtr.ENDIF.ENDIF.IF r_fip

28、os-optio n = 'BT'.IF g_t_fmmp-fipos >= r_fipos-low ANDg_t_fmmp-fipos <= r_fipos-high.in t_cashflow-fi_fkbtr=in t_cashflow-fi_fkbtr+ g_t_fmmp-fkbtr.in t_cashflow-com_fkbtr =in t_cashflow-com_fkbtr+ g_t_fmmp-fkbtr.ENDIF.ENDIF.ENDLOOP.MODIFY TABLE in t_cashflow.CLEAR in t_cashflow.CLEAR r

29、_fipos.REFRESH r_fipos.ENDLOOP.AT END OF bukrs.PERFORM cal_i ndirect USING g_t_fmmp-bukrs.PERFORM output_i nfo USING 'COM'.nu m_of_bukrs = nu m_of_bukrs + 1.ENDAT.AT END OF fikrs.IF num_of_bukrs NE 1.CLEAR l_sav_butxt.PERFORM output_i nfo USING 'FI'.ENDIF.WRITE : / text-103.ENDAT.END

30、LOOP.TOP-OF-PAGE.IF NOT ( s_budat-low IS INITIAL ).min _budat = s_budat-low.ENDIF.IF NOT ( s_budat-high IS INITIAL ).max_budat = s_budat-high.ENDIF.SKIP 2.WRITE: /100 ' 現(xiàn) 金 流 量 表'.WRITE: /.WRITE: /210 ' 會(huì)年企 03 表'.IF min_budat(6) = max_budat(6).* WRITE: /104 min_budat(4),' 年',

31、min_budat+4(2),' 月',* 202 '報(bào)表編號(hào):會(huì)商03表'.* ELSE.* WRITE: /097 '日期:',* 103 min_budat, 113 '-' , 115 max_budat,* 202 '報(bào)表編號(hào):會(huì)商03表'.* ENDIF.WRITE: /012 ' 編制單位:,l_sav_butxt,月',100 max_budat(4),' 年',max_budat+4(2),max_budat+6(2),' 日',212 '單

32、位:元'.WRITE:/011 sy-uli ne.WRITE : /011 sy-vli ne,040 '項(xiàng)目'085 sy-vli ne,087 '行次',095 '金額 ',116 sy-vli ne,148 '補(bǔ)充資料093 sy-vli ne,198 sy-vli ne,190 sy-vline,192 '行次','金 額:220 sy-vline.WRITE: /011 sy-uli ne.*AT LINE-SELECTION.CHECK l_sav_hide_row_type = 'E

33、POS'.CALL FUNCTION 'FM_DOCUMENT_DISPLAY'EXPORTINGi_wrttp = g_t_fmmp-wrttp i_belnr = g_t_fmmp-zbe Inr i_blpos = g_t_fmmp-zbuzei i_bukrs = g_t_fmmp-vo_bukrs i_gjahr = g_t_fmmp-vo_gjahr.*AT USER-COMMAND.CASE sy-ucomm.WHEN 'SELE'.SET PF-STATUS 'SELE'.CALL FUNCTION 'FM_SEL

34、ECTION_CRITERIA_PRINT'EXPORTINGi_report_ name = 'RFFMIEP5'EXCEPTIONSOTHERS=1.ENDCASE.*&*&Form READ_FIKRS_TEXT*&FORM read_fikrs_text USING u_fikrsCHANGING c_fitxt.g_t_fkrs = space.g_t_fkrs-fikrs = u_fikrs.READ TABLE g_t_fkrs.IF sy-subrc = 0.c_fitxt = g_t_fkrs-fitxt.ENDIF.ENDFO

35、RM." READ_FIKRS_TEXT*&*&Form READ_FIPOS_TEXT*&*FORM read_fipos_text USING u_fiposCHANGING c_p name.g_t_fpos = space.g_t_fpos-fipos = u_fipos.READ TABLE g_t_fpos.IF sy-subrc = 0.c_pn ame = g_t_fpos-p name.ENDIF.ENDFORM."READ_FIPOS_TEXT*&*&Form READ_BUKRS_TEXT*&FORM r

36、ead_bukrs_text USING u_bukrsCHANGING c_butxt.g_t_t001 = space.g_t_t001-bukrs = u_bukrs.READ TABLE g_t_t001.IF sy-subrc = 0.c_butxt = g_t_t001-butxt.ENDIF.ENDFORM."READ_FIPOS_TEXT*&*&Form GET_KUNNR_LIFNR_TEXT*&FORM get_k unn r_lifnr_text USING value(u_ku nnr) value(u_lifnr)CHANGING c

37、_text.CLEAR c_text.IF NOT u_ku nnr IS INITIAL.IF u_ku nnr = '*'.c_text = '*'.ELSE.* "/ Lese n Debitor-Text aus interner Tabelleg_t_k na1 = space.g_t_k na1-k unnr = u_kunnr.READ TABLE g_t_kn a1.IF sy-subrc = 0.c_text = g_t_k na1-sortl.ENDIF.ENDIF.ENDIF.IF NOT u_lifnr IS INITIAL.I

38、F u_l ifnr = '*'.c_text = '*'.ELSE.* "/ Lese n Kreditor-Text aus interner Tabelleg_t_lfa1 = space.g_t_lfa1-lifnr = uifnr.READ TABLE g_t_lfa1.IF sy-subrc = 0.c_text = g_t_lfa1-sortl.ENDIF.ENDIF.ENDIF.ENDFORM." GET_KUNNR_LIFNR_TEXT*FORM in put_ra nge USING value(rfipos).DATA:

39、 off TYPE i, offset TYPE i, doing TYPE i.DATA: item(20), str(10).off = 0. offset = 0.doing = 1.WHILE doi ng <> 0.SHIFT rfipos BY offset PLACES.SEARCH rfipos FOR ','.IF sy-subrc = 0.offset = sy-fdpos.MOVE rfipos(offset) TO item.offset = offset + 1.ELSE.MOVE rfipos TO item.ENDIF.SEARCH i

40、tem FOR '-'.IF sy-subrc = 0.off = sy-fdpos.MOVE item(off) TO str.off = off + 1.r_fipos-sig nr_fipos-opti on = 'BT'.r_fipos-low= str.SHIFT item BY off PLACES.MOVE item TO str.str.r_fipos-highELSE.MOVE item TO str.r_fipos-sig n= T.r_fipos-opti on = 'EQ'.r_fipos-low= str.ENDIF.A

41、PPEND r_fipos.ENDWHILE.ENDFORM.FORM outputnfo USING fi_value. DATA zcashflow LIKE fmmp-fkbtr. DATA: i LIKE sy-tabix,j LIKE sy-tabix, k LIKE sy-tabix, l LIKE sy-tabix.i = 0. j = 0. k = 32.LOOP AT i nt_cashflow FROM 1 TO 32.IF fi_value = 'COM'.zcashflow = in t_cashflow-com_fkbtr.ELSEIF fi_valu

42、e = 'FI'.zcashflow = in t_cashflow-fi_fkbtr.ENDIF.i = i + 1.j = j + 1. k = k + 1.WRITE : /011 sy-vli ne, 014 in t_cashflow-desc,085 sy-vli ne, 088(2) i,093 sy-vli ne.IF zcashflow <> 0.WRITE: 099 zcashflow CURRENCY g_t_fmmp-fwaerENDIF.IF i < 3.READ TABLE int cashflow INDEX l.IF fi_va

43、lue = 'COM'.zcashflow = in t_cashflow-com_fkbtr.ELSEIF fi_value = 'FI'.zcashflow = in t_cashflow-fi_fkbtr.ENDIF.WRITE: 116 sy-vli ne, 118(60) in t_cashflow-desc,190 sy-vline, 193(2) k, 198 sy-vline.IF zcashflow <> 0.WRITE: 204 zcashflow CURRENCY g_t_fmmp-fwaer.ENDIF.ELSE.l = i

44、- 2.READ TABLE itb0 INDEX l.IF sy-subrc <> 0. CLEAR itb0. ENDIF.WRITE: 116 sy-vli ne, 118(60) itb0-txt,190 sy-vli ne, 193(2) k, 198 sy-vli ne.IF itb0-num <> 0.WRITE: 204 itb0-num CURRENCY g_t_fmmp-fwaer.ENDIF.ENDIF.WRITE: 220 sy-vli ne.IF j >= 25.j = 0.PERFORM out_footer.NEW-PAGE.ENDI

45、F.ENDLOOP.PERFORM out_footer.ENDFORM.* *FORMout_footer* *FORM out_footer.DATA: usrname(80) TYPE c.SELECT SINGLE * FROM usr21 WHERE bn ame = sy-un ame.<=SELECT SINGLE * FROM adrpWHERE pers number = usr21-pers number ANDdateANDsy-datumdate_to>=sy-datum.CONCATENATE adrp-name_last adrp-name_first

46、INTO usrname.CONDENSE usrname NO-GAPS.WRITE: /012 ' 制表人員:',(12) usrname,110 '打印日期:',sy-datum,202 '打印時(shí)間:',sy-uzeit. ENDFORM.*計(jì)算科目段在指定日期的起始余額*參數(shù)mdate1開(kāi)始日期(含此天)*mdate2結(jié) 束日期(不含此天)*mstri n科目編號(hào)的匹配模式字符串*結(jié)果:znum*算法:某日余額=年初余額+ 一月余額+-+*上月余額+本月至 U mdate2余*CHANGING znum.DATA: BEGIN OF ig

47、ltO OCCURS 0.INCLUDE STRUCTURE glt0.DATA: END OF iglt0.DATA: BEGIN OF itmp OCCURS 0,num LIKE bseg-dmbtr,END OF itmp.DATA: iLIKE sy-tabix.SELECT * FROM glt0 INTO TABLE iglt0WHERE bukrs = z_bukrsANDryear = mdate1(4) ANDracct LIKE mstri ng.LOOP AT iglt0.REFRESH itmp.itmp-num =iglt0-hslvt.APPEND itmpitm

48、p-num =iglt0-hsl01.APPEND itmpitmp-num =iglt0-hsl02.APPEND itmpitmp-num =iglt0-hsl03.APPEND itmpitmp-num =iglt0-hsl04.APPEND itmpitmp-num =iglt0-hsl05.APPEND itmpitmp-num =iglt0-hsl06.APPEND itmpitmp-num =iglt0-hsl07.APPEND itmpitmp-num =iglt0-hsl08.APPEND itmpitmp-num =iglt0-hsl09.APPEND itmpitmp-n

49、um = igltO-hsllO.APPEND itmp.itmp-num = iglt0-hsl11.APPEND itmp.LOOP AT itmp FROM 1 TO mdate1+ 4(2). znum = znum + itmp-num.ENDLOOP.ENDLOOP.ANDSELECT * FROM bkpf WHERE bukrs = z_bukrs ANDbudat >= mdatelbudat < mdate2.SELECT * FROM bsis WHERE gjahr = bkpf-gjahr ANDbel nr = bkpf-bel nr AND hko n

50、t LIKE mstri ng.IF bsis-shkzg = 'S'.znum = znum + bsis-dmbtr.ELSE.znum = znum - bsis-dmbtr.ENDIF.ENDSELECT.ENDSELECT.ENDFORM.DEFINE cal_data.types: begi n of datatype,dnumlike bseg-dmbtr," 借方金額cnumlike bseg-dmbtr,"貸方金額end of datatype.data: masset type datatype,min vest type datatyp

51、e, mlibtype datatype,mstock type datatype, mllib type datatype, mequit type datatype."固定資產(chǎn)數(shù)據(jù)"投資數(shù)據(jù)"短期負(fù)債數(shù)據(jù)"庫(kù)存數(shù)據(jù)"長(zhǎng)期負(fù)債數(shù)據(jù)"權(quán)益數(shù)據(jù)loop at tab2.case tab2-hkon t.when '1501' or '1701'.if tab2-shkzg = 'S'.add tab2-dmbtr to masset-d num. else.add tab2-dmbtr t

52、o masset-c num. en dif.when '1101' or '1401' or '1402'.if tab2-shkzg = 'S'.add tab2-dmbtr to min vest-d num. else.add tab2-dmbtr to mi nvest-c num. en dif.when '1221' or '1231' or '1243'.if tab2-shkzg = 'S'.add tab2-dmbtr to mstock-d nu

53、m. else."固定資產(chǎn)和無(wú)形資產(chǎn)"短期投資與長(zhǎng)期投資"庫(kù)存科目add tab2-dmbtr to mstock-c num.en dif.when '2111' or '2121' or '2181'."經(jīng)營(yíng)性負(fù)債if tab2-shkzg = 'S'.add tab2-dmbtr to mlib-d num.else.add tab2-dmbtr to mlib-c num.en dif.when '2321'.if tab2-shkzg = 'S'.a

54、dd tab2-dmbtr to mllib-d num. else.add tab2-dmbtr to mllib-c num. en dif.when '3105' or '3111'.if tab2-shkzg = 'S'.add tab2-dmbtr to mequit-d num. else.add tab2-dmbtr to mequit-c num. en dif.endcase.en dloop."長(zhǎng)期負(fù)債"所有者權(quán)益if masset-d num > 0.if mllib-cnum > 0.&qu

55、ot;固定資產(chǎn)增加"融資租賃固定資產(chǎn)z_asset_re nted = z_asset_re nted + masset-d num.mllib-c num= mllib-c num- masset-d num.masset-d num= 0.else.z_asset_re nted = z_asset_re nted + mllib-c num.masset-d num= masset-d num- mllib-c num.mllib-c num= 0.en dif.en dif.en dif.if masset-cnum > 0."固定資產(chǎn)減少if mlib-dnum > 0."固定資產(chǎn)償還債務(wù)(經(jīng)營(yíng)性)if masset-c num > mlib-d num.z_asset_debit = z_asset_debit + mlib-d num.z_debit_short

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論