企業(yè)應(yīng)收款管理概述_第1頁
企業(yè)應(yīng)收款管理概述_第2頁
企業(yè)應(yīng)收款管理概述_第3頁
已閱讀5頁,還剩30頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

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

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

3、ABLES: fkrs, fpos, fmmp, lfa1, kna1 ,bsis,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-gsbe

4、r,vo_saknr LIKE fmmp-vo_saknr,lifnrLIKE fmmp-lifnr,kunnrLIKE fmmp-kunnr,fwaerLIKE fmmp-fwaer,fkbtrLIKE fmsu-btr001,zbelnrLIKE cooi-refbn,zbuzeiLIKE cooi-rfpos,vo_bukrs LIKE fmmp-vo_bukrs,vo_gjahr LIKE fmmp-vo_gjahr,fitxtLIKE fkrs-fitxt,fnameLIKE ffnd-fname,cnameLIKE fctr-cname,pnameLIKE fpos-pname,w

5、textLIKE fmmp-wtext,END OF g_t_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, pname LIKE fpos-pname,END OF g_t_fpos.DATA: BEGIN OF g_t_lfa1 OCCURS 200, lifnr LIKE lfa1-lifnr, sortl LIKE lf

6、a1-sortl,END OF g_t_lfa1.DATA: BEGIN OF g_t_kna1 OCCURS 200, kunnr LIKE kna1-kunnr, sortl LIKE kna1-sortl,END OF g_t_kna1.RANGES: r_kunnr FOR kna1-kunnr, r_lifnr FOR lfa1-lifnr, r_fipos FOR fmmp-fipos.DATA: BEGIN OF int_cashflow OCCURS 100, desc(66) TYPE c, r_fipos(66) TYPE c, com_fkbtr LIKE fmmp-fk

7、btr, fi_fkbtrLIKE fmmp-fkbtr,fi_fwaer LIKE fmmp-fwaer,END OF int_cashflow.DATA: BEGIN OF g_t_t001 OCCURS 300, bukrs LIKE t001-bukrs, butxt LIKE t001-butxt,END OF g_t_t001.DATA: pos TYPE i VALUE 0, num_of_bukrs TYPE i V ALUE 0.DATA cashflow_detail.DATA : min_budatLIKE fmmp-budat,max_budatLIKE fmmp-bu

8、dat,z_min_budatLIKE sy-datum,z_max_budatLIKE sy-datum,z_bukrsLIKE fmmp-bukrs,z_profitLIKE bseg-dmbtr,"凈利潤z_bad_debitLIKE bseg-dmbtr,"壞帳準(zhǔn)備及計提的資產(chǎn)減值準(zhǔn)z_asset_depLIKE bseg-dmbtr,"固定資產(chǎn)折舊z_intang_depLIKE bseg-dmbtr,"無形資產(chǎn)攤銷z_longpaid_dep LIKE bseg-dmbtr,"長期待攤費用攤銷z_paid_decLIKE bseg-

9、dmbtr,"待攤費用減少z_accrul_incLIKE bseg-dmbtr,"預(yù)提費用增加z_asset_proLIKE bseg-dmbtr,"固定資產(chǎn),長期資產(chǎn)處置損失z_asset_scrLIKE bseg-dmbtr,"固定資產(chǎn)報廢損失z_fi_expenLIKE bseg-dmbtr,"財務(wù)費用z_invest_lossLIKE bseg-dmbtr,"投資損失z_defer_taxLIKE bseg-dmbtr,"遞延稅款貸項z_stockLIKE bseg-dmbtr,"存貨減少z_arLIKE

10、 bseg-dmbtr," 經(jīng)營性應(yīng)收減少z_apLIKE bseg-dmbtr,"經(jīng)營性應(yīng)付增加z_otherLIKE bseg-dmbtr,"其他z_productionLIKE bseg-dmbtr,"經(jīng)營活動產(chǎn)生的現(xiàn)金凈額z_lossLIKE bseg-dmbtr,"總公司下?lián)軓浹a虧損z_asset_debitLIKE bseg-dmbtr,"以固定資產(chǎn)償還債務(wù)z_invest_debit LIKE bseg-dmbtr,"以投資償還債務(wù)z_asset_invest LIKE bseg-dmbtr,"以固定

11、資產(chǎn)投資z_stock_debit LIKE bseg-dmbtr, z_asset_rented LIKE bseg-dmbtr, z_donation LIKE bseg-dmbtr, z_debit_short LIKE bseg-dmbtr, z_debit_equit LIKE bseg-dmbtr, z_bond_due LIKE bseg-dmbtr, z_money_init LIKE bseg-dmbtr, z_money_end LIKE bseg-dmbtr, z_cashs_init LIKE bseg-dmbtr, z_cashs_end LIKE bseg-dmbt

12、r, z_all_money LIKE bseg-dmbtr."以存貨償還債務(wù)"融資租賃固定資產(chǎn)"接受捐贈非現(xiàn)金資產(chǎn)"償還的經(jīng)營性債務(wù)"債務(wù)轉(zhuǎn)為資本 "一年內(nèi)到期的可轉(zhuǎn)換公司債券 "貨幣資金期初余額 "貨幣資金期末余額"現(xiàn)金等價物期初余額"現(xiàn)金等價物期末余額 "貨幣資金及現(xiàn)金等價物凈變動DATA: BEGIN OF itb0 OCCURS 0, txt(70) TYPE c,num LIKE bseg-dmbtr, END OF itb0, mtxt(70) TYPE c.*INITI

13、ALIZATION. PERFORM fill_item_direct. *START-OF-SELECTION.GET fkrs. g_t_fkrs-fikrs = fkrs-fikrs. g_t_fkrs-fitxt = fkrs-fitxt. APPEND g_t_fkrs.GET fpos. g_t_fpos-fipos = fpos-fipos. g_t_fpos-pname = fpos-pname.GET fmmp.MOVE-CORRESPONDING fmmp TO g_t_fmmp.CASE fmmp-wrttp.WHEN '50' OR '51

14、9;. " purchase order g_t_fmmp-zbelnr = fmmp-ebeln. g_t_fmmp-zbuzei = fmmp-ebelp.WHEN '64'. " payment transfer g_t_fmmp-zbelnr = fmmp-kblnr. g_t_fmmp-zbuzei = fmmp-kblpos.WHEN '65'." funds commitmentsg_t_fmmp-zbelnr = fmmp-kblnr. g_t_fmmp-zbuzei = fmmp-kblpos.WHEN OTHER

15、S." Fi documentsg_t_fmmp-zbelnr = fmmp-vo_belnr. g_t_fmmp-zbuzei = fmmp-vo_buzei. ENDCASE.APPEND g_t_fmmp.IF NOT fmmp-kunnr IS INITIAL. r_kunnr-sign = 'I'. r_kunnr-option = 'EQ'. r_kunnr-low = fmmp-kunnr. COLLECT r_kunnr.ENDIF.IF NOT fmmp-lifnr IS INITIAL. r_lifnr-sign = 'I&

16、#39;. r_lifnr-option = 'EQ'. r_lifnr-low = fmmp-lifnr. COLLECT r_lifnr.ENDIF.END-OF-SELECTION.SORT g_t_fmmp BY fikrs bukrs fipos wrttp gjahr perio zhldt zbelnr zbuzei bukrs vo_saknr.RANGES: lr_lifnr FOR lfa1-lifnr, lr_kunnr FOR kna1-kunnr.DATA: l_cnt_from LIKE sy-tabix VALUE 1, l_cnt_toLIKE

17、sy-tabix V ALUE 50,l_cnt_lines LIKE sy-tabix.* "/ Lesen Kreditoren-Texte aus Stammdaten-Tabelle IF NOT r_lifnr IS INITIAL.LOOP AT r_lifnr WHERE low = '*'.DELETE r_lifnr.ENDLOOP."<- insert"<- insert"<- insertDESCRIBE TABLE r_lifnr LINES l_cnt_lines.IF l_cnt_lines

18、<= 50.* "/ Lieferanten-Kurztexte auf einmal einlesen SELECT lifnr sortl FROM lfa1INTO CORRESPONDING FIELDS OF TABLE g_t_lfa1WHERE lifnr IN r_lifnr.ELSE."<- insertDO."<- insert"/ Bloecke zu je 50 Leferanten bilden"<- insertREFRESH lr_lifnr."<- insertLOOP A

19、T r_lifnr FROM l_cnt_from TO l_cnt_to."<- insertlr_lifnr = r_lifnr. "<-insertAPPEND lr_lifnr."<- insertENDLOOP."<- insertIF sy-subrc NE 0."<- insertEXIT."<- insertENDIF."<- insertl_cnt_from = l_cnt_to + 1."<- insertl_cnt_to = l_cnt_from

20、 + 50."<- insert"/ Lieferanten-Kurztexte lesen"<- insertSELECT lifnr sortl FROM lfa1"<- insertAPPENDING CORRESPONDING FIELDS"<- insertOF TABLE g_t_lfa1"<- insertWHERE lifnr IN lr_lifnr."<- insertENDDO."<- insertENDIF."<- insert&quo

21、t;/ Lieferanten-Kurztexte in Bloecken einlesen"<- insertENDIF.* "/ Lesen Debitoren-Texte aus Stammdaten-Tabelle IF NOT r_kunnr IS INITIAL.LOOP AT r_kunnr WHERE low = '*'.DELETE r_kunnr.ENDLOOP."<- insert"<- insert"<- insertDESCRIBE TABLE r_kunnr LINES l_c

22、nt_lines.IF l_cnt_lines <= 50.*"/ Kunden-Kurztexte auf einmal einlesenSELECT kunnr sortl FROM kna1INTO CORRESPONDING FIELDS OF TABLE g_t_kna1WHERE kunnr IN r_kunnr.ELSE."<- insert"<- insert"/ Kunden-Kurztexte in Bloecken einlesenDO."<- insert"<- insert&qu

23、ot;<- insert"<- insert"/ Bloecke zu je 50 Kunden bilden REFRESH lr_kunnr.LOOP AT r_kunnr FROM l_cnt_from TO l_cnt_to."<- insert"<- insert"<- insert"<- insertlr_kunnr = r_kunnr.APPEND lr_kunnr.ENDLOOP.IF sy-subrc NE 0.EXIT."<- insertENDIF."

24、<- insertl_cnt_from = l_cnt_to + 1."<- insertl_cnt_to = l_cnt_from + 50."<- insert*"/ Kunden-Kurztexte lesen"<- insertSELECT kunnr sortl FROM kna1"<- insertAPPENDING CORRESPONDING FIELDS"<- insertOF TABLE g_t_kna1 WHERE kunnr IN lr_kunnr."<- in

25、sert"<- insertENDDO."<- insertENDIF.ENDIF."<- insertSELECT 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_row_type(4).num_of_bukrs = 0. max_budat = 0. min_budat

26、= '99991231' . 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.l_sav_fwaer = g_t_fmmp-fwaer.AT NEW fikrs.LOOP AT int_cashflow.CLEAR int_cashflow-fi_fkbtr.MODIFY TABLE int_cashflow.CLEAR

27、 int_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 int_cashflow.CLEAR int_cashflow-com_fkbtr.MODIFY TABLE int_cashflow.CLEAR int_cashflow.ENDLOOP.ENDAT.LOOP AT int_cashflow.PERFORM input_range USING int_

28、cashflow-r_fipos.LOOP AT r_fipos.IF r_fipos-option = 'EQ'.IF r_fipos-low = g_t_fmmp-fipos. int_cashflow-fi_fkbtr = int_cashflow-fi_fkbtr+ g_t_fmmp-fkbtr. int_cashflow-com_fkbtr = int_cashflow-com_fkbtr + g_t_fmmp-fkbtr. ENDIF.ENDIF.IF r_fipos-option = 'BT'.IF g_t_fmmp-fipos >= r_f

29、ipos-low AND g_t_fmmp-fipos <= r_fipos-high. int_cashflow-fi_fkbtr = int_cashflow-fi_fkbtr+ g_t_fmmp-fkbtr. int_cashflow-com_fkbtr = int_cashflow-com_fkbtr+ g_t_fmmp-fkbtr.ENDIF.ENDIF.ENDLOOP.MODIFY TABLE int_cashflow.CLEAR int_cashflow.CLEAR r_fipos.REFRESH r_fipos.ENDLOOP .AT END OF bukrs.PERFO

30、RM cal_indirect USING g_t_fmmp-bukrs.PERFORM output_info USING 'COM'. num_of_bukrs = num_of_bukrs + 1.ENDAT.AT END OF fikrs.IF num_of_bukrs NE 1.CLEAR l_sav_butxt.PERFORM output_info USING 'FI'.ENDIF.WRITE : / text-103.ENDAT.ENDLOOP.TOP-OF-PAGE.IF NOT ( s_budat-low IS INITIAL ). min_

31、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 ' 會年企 03 表 '.* IF min_budat(6) = max_budat(6).* WRITE: /104 min_budat(4), ' 年', min_budat+4(2), ' 月',*202 '報表編號 : 會商 0

32、3 表 '.* ELSE.* WRITE: /097 ' 日期 :',* 103 min_budat, 113 '-' , 115 max_budat,*202 '報表編號 : 會商 03 表 '.* ENDIF.*WRITE: /012 ' 編制單位 : ', l_sav_butxt,100 max_budat(4), ' 年', max_budat+4(2), ' 月 ', max_budat+6(2), ' 日 ',212 ' 單位 : 元 '.WRIT

33、E: /011 sy-uline.目',093 sy-vline,WRITE : /011 sy-vline,040 ' 項085 sy-vline,087 '行次 ',095 ' 金 額 ',116 sy-vline,148 '補充資料190 sy-vline,192 '行次 ',198 sy-vline,' 金 額', 220 sy-vline.WRITE: /011 sy-uline.*AT LINE-SELECTION.CHECK l_sav_hide_row_type = 'EPOS

34、9;.CALL FUNCTION 'FM_DOCUMENT_DISPLAY'EXPORTINGi_wrttp = g_t_fmmp-wrttpi_belnr = g_t_fmmp-zbelnr 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_SELECTION_C

35、RITERIA_PRINT' EXPORTINGi_report_name = 'RFFMIEP5'EXCEPTIONSOTHERS = 1.ENDCASE.*&*& Form READ_FIKRS_TEXT*&FORM read_fikrs_text USING u_fikrs CHANGING 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.ENDFORM

36、." READ_FIKRS_TEXT*& *& Form READ_FIPOS_TEXT*&FORM read_fipos_text USING u_fipos CHANGING c_pname. g_t_fpos = space. g_t_fpos-fipos = u_fipos.READ TABLE g_t_fpos.IF sy-subrc = 0. c_pname = g_t_fpos-pname.ENDIF.ENDFORM." READ_FIPOS_TEXT*& *& Form READ_BUKRS_TEXT*&*FO

37、RM read_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_kunnr_lifnr_text USING value(u_kunnr) value(u_lifnr)

38、CHANGING c_text.CLEAR c_text.IF NOT u_kunnr IS INITIAL.IF u_kunnr = '*'.c_text = '*'ELSE."/ Lesen Debitor-Text aus interner Tabelle g_t_kna1 = space. g_t_kna1-kunnr = u_kunnr. READ TABLE g_t_kna1.IF sy-subrc = 0.c_text = g_t_kna1-sortl.ENDIF.ENDIF.ENDIF.IF NOT u_lifnr IS INITIAL

39、.IF u_lifnr = '*'.c_text = '*'.ELSE."/ Lesen Kreditor-Text aus interner Tabelle g_t_lfa1 = space. g_t_lfa1-lifnr = u_lifnr. READ TABLE g_t_lfa1.IF sy-subrc = 0.c_text = g_t_lfa1-sortl.ENDIF.ENDIF.ENDIF.ENDFORM." GET_KUNNR_LIFNR_TEXT*FORM input_range USING value(rfipos).DATA

40、: off TYPE i, offset TYPE i, doing TYPE i. DATA: item(20), str(10).off = 0. offset = 0. doing = 1.WHILE doing <> 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. doing =

41、0.ENDIF.SEARCH item FOR '-'.IF sy-subrc = 0.off = sy-fdpos.MOVE item(off) TO str. off = off + 1. r_fipos-sign = 'I'. r_fipos-option = 'BT'. r_fipos-low = str.SHIFT item BY off PLACES.MOVE item TO str. r_fipos-high = str.ELSE.MOVE item TO str. r_fipos-sign = 'I'. r_fip

42、os-option = 'EQ'. r_fipos-low = str.ENDIF.APPEND r_fipos.ENDWHILE.ENDFORM.*FORM output_info 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 int_cashflow FROM 1 TO 32. IF fi_value = 'COM

43、9;.zcashflow = int_cashflow-com_fkbtr. ELSEIF fi_value = 'FI'.zcashflow = int_cashflow-fi_fkbtr.ENDIF.i = i + 1. j = j + 1. k = k + 1.WRITE : /011 sy-vline, 014 int_cashflow-desc,085 sy-vline, 088(2) i,093 sy-vline.IF zcashflow <> 0.WRITE: 099 zcashflow CURRENCY g_t_fmmp-fwaer. ENDIF.I

44、F i < 3.l = i + 32.READ TABLE int_cashflow INDEX l.IF fi_value = 'COM'.zcashflow = int_cashflow-com_fkbtr.ELSEIF fi_value = 'FI'.zcashflow = int_cashflow-fi_fkbtr.ENDIF.WRITE: 116 sy-vline, 118(60) int_cashflow-desc,190 sy-vline, 193(2) k, 198 sy-vline.IF zcashflow <> 0.WRIT

45、E: 204 zcashflow CURRENCY g_t_fmmp-fwaer.ENDIF.ELSE.l = i - 2.READ TABLE itb0 INDEX l.IF sy-subrc <> 0. CLEAR itb0. ENDIF.WRITE: 116 sy-vline, 118(60) itb0-txt,190 sy-vline, 193(2) k, 198 sy-vline.IF itb0-num <> 0.WRITE: 204 itb0-num CURRENCY g_t_fmmp-fwaer.ENDIF.ENDIF.WRITE: 220 sy-vlin

46、e.WRITE: /011 sy-uline.IF j >= 25. j = 0.PERFORM out_footer.NEW-PAGE.ENDIF.ENDLOOP.PERFORM out_footer.ENDFORM.* * FORM out_footer * * *FORM out_footer.DATA: usrname(80) TYPE c.SELECT SINGLE * FROM usr21 WHERE bname = sy-uname.SELECT SINGLE * FROM adrp WHERE persnumber = usr21-persnumber AND date_

47、from <= sy-datumANDdate_to >= sy-datum.CONCATENATE adrp-name_last adrp-name_first INTO usrname.CONDENSE usrname NO-GAPS.WRITE: /012 ' 制表人員 :', (12) usrname,110 '打印日期 :', sy-datum,202 ' 打印時間 :', sy-uzeit.ENDFORM.*計算科目段在指定日期的起始余額* 參數(shù): mdate1 開始日期 ( 含此天 )*mdate2 結(jié)束日期 ( 不含此

48、天 )*mstrin 科目編號的匹配模式字符串* 結(jié)果: znum* 算法:某日余額 = 年初余額 一月余額 *上月余額 本月到 mdate2 余額*FORM cal_dates_amount USING mdate1 mdate2 mstring CHANGING znum.DATA: BEGIN OF iglt0 OCCURS 0.INCLUDE STRUCTURE glt0.DATA: END OF iglt0.DATA: BEGIN OF itmp OCCURS 0, num LIKE bseg-dmbtr,END OF itmp.DATA: i LIKE sy-tabix.SELEC

49、T * FROM glt0 INTO TABLE iglt0 WHERE bukrs = z_bukrsANDryear = mdate1(4) AND racct LIKE mstring.LOOP AT iglt0.REFRESH itmp.APPEND itmp.itmp-num =iglt0-hslvt.itmp-num =iglt0-hsl01.APPEND itmpitmp-num =iglt0-hsl02.APPEND itmpitmp-num =iglt0-hsl03.APPEND itmpitmp-num =iglt0-hsl04.APPEND itmpitmp-num =i

50、glt0-hsl05.APPEND itmpitmp-num =iglt0-hsl06.APPEND itmpitmp-num =iglt0-hsl07.APPEND itmpitmp-num =iglt0-hsl08.APPEND itmpitmp-num =iglt0-hsl09.APPEND itmpitmp-num =iglt0-hsl10.APPEND itmpitmp-num =iglt0-hsl11.APPEND itmpLOOP AT itmp FROM 1 TO mdate1+4(2). znum = znum + itmp-num.ENDLOOP.ENDLOOP.SELEC

51、T * FROM bkpf WHERE bukrsbudat >= mdate1= z_bukrs ANDANDbudat < mdate2.SELECT * FROM bsis WHERE gjahr = bkpf-gjahr AND belnr = bkpf-belnr AND hkont LIKE mstring.IF bsis-shkzg = 'S'.znum = znum + bsis-dmbtr.ELSE.znum = znum - bsis-dmbtr.ENDIF.ENDSELECT.ENDSELECT.ENDFORM.DEFINE cal_data.

52、"借方金額"貸方金額" 固定資產(chǎn)數(shù)據(jù) " 投資數(shù)據(jù) "短期負(fù)債數(shù)據(jù) " 庫存數(shù)據(jù)" 長期負(fù)債數(shù)據(jù) " 權(quán)益數(shù)據(jù)types: begin of datatype,dnum like bseg-dmbtr, cnum like bseg-dmbtr, end of datatype.data: masset type datatype, minvest type datatype, mlib type datatype, mstock type datatype, mllib type datatype, mequit

53、 type datatype.loop at tab2.case tab2-hkont(4).when '1501' or '1701'. " 固定資產(chǎn)和無形資產(chǎn) if tab2-shkzg = 'S'.add tab2-dmbtr to masset-dnum.else.add tab2-dmbtr to masset-cnum.endif.when '1101' or '1401' or '1402'." 短期投資與長期投資if tab2-shkzg = 'S'

54、;.add tab2-dmbtr to minvest-dnum.else.add tab2-dmbtr to minvest-cnum.endif.when '1221' or '1231' or '1243'." 庫存科目if tab2-shkzg = 'S'.add tab2-dmbtr to mstock-dnum.else.add tab2-dmbtr to mstock-cnum.endif.when '2111' or '2121' or '2181'. &q

55、uot; 經(jīng)營性負(fù)債 if tab2-shkzg = 'S'.add tab2-dmbtr to mlib-dnum.else.add tab2-dmbtr to mlib-cnum.endif.when '2321'." 長期負(fù)債if tab2-shkzg = 'S'.add tab2-dmbtr to mllib-dnum.else.add tab2-dmbtr to mllib-cnum.endif.when '3105' or '3111'." 所有者權(quán)益if tab2-shkzg =

56、'S'.add tab2-dmbtr to mequit-dnum.else.add tab2-dmbtr to mequit-cnum.endif.endcase.endloop.if masset-dnum > 0."固定資產(chǎn)增加if mllib-cnum > 0." 融資租賃固定資產(chǎn)if masset-dnum < mllib-cnum.z_asset_rented = z_asset_rented + masset-dnum.mllib-cnum= mllib-cnum - masset-dnum.masset-dnum= 0.el

57、se.z_asset_rented = z_asset_rented + mllib-cnum.masset-dnum= masset-dnum - mllib-cnum.mllib-cnum endif.= 0.endif. endif.if masset-cnum > 0."固定資產(chǎn)減少if mlib-dnum > 0."固定資產(chǎn)償還債務(wù) (經(jīng)營性 )if masset-cnum > mlib-dnum.z_asset_debitz_asset_debit + mlib-dnum.z_debit_short =z_debit_short + mlib-dnum.masset-cnum= masset-cnum - mlib-dnum.mlib-dnum else.= 0.z_asset_debitz_asset_debit + masset-cnum.z_debit_short =z_debit_short + masset-cnum.mlib-dnum= mlib-dnum- masset-cnum.masset-cnum= 0.endif. endif.if mllib-dnum > 0."固定資產(chǎn)償還債務(wù) (長期 )if masset-cnum > mllib-dnum.z_asset_debi

溫馨提示

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

評論

0/150

提交評論