在SAP中用承諾項目策劃出現(xiàn)金流量表文件_第1頁
在SAP中用承諾項目策劃出現(xiàn)金流量表文件_第2頁
在SAP中用承諾項目策劃出現(xiàn)金流量表文件_第3頁
在SAP中用承諾項目策劃出現(xiàn)金流量表文件_第4頁
在SAP中用承諾項目策劃出現(xiàn)金流量表文件_第5頁
已閱讀5頁,還剩83頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

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

2、流量相關(guān)的數(shù)據(jù)裝入內(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標準程序,數(shù)據(jù)關(guān)系比較復雜,建議不要做任何改動。 3、計算現(xiàn)金流量 計算的差不多思路是對表G_T_FMMP進行循環(huán),查找其中每條記錄的承諾項目屬于INT_CASHFLOW的 表項后,把其金額累計到相應(yīng)表項。 REPORT zcmrp001 NO STANDARD PAGE HEADING LINE-SIZ

3、E 220. TABLES: fkrs, fpos, fmmp, lfa1, kna1 ,bsis, t001, usr21, adrp, bkpf, bseg, glt0. DATA: BEGIN OF g_t_fmmp OCCURS 300, fikrs LIKE fmmp-fikrs, bukrs LIKE fmmp-bukrs, fipos LIKE fmmp-fipos, wrttp LIKE fmmp-wrttp, gjahr LIKE fmmp-gjahr, perio LIKE fmmp-perio, zhldt LIKE fmmp-zhldt, budat LIKE fmmp

4、-budat, gsber LIKE fmmp-gsber, vo_saknr LIKE fmmp-vo_saknr, lifnr LIKE fmmp-lifnr, kunnr LIKE fmmp-kunnr, fwaer LIKE fmmp-fwaer, fkbtr LIKE fmsu-btr001, zbelnr LIKE cooi-refbn, zbuzei LIKE cooi-rfpos, vo_bukrs LIKE fmmp-vo_bukrs, vo_gjahr LIKE fmmp-vo_gjahr, fitxt LIKE fkrs-fitxt, fname LIKE ffnd-fn

5、ame, cname LIKE fctr-cname, pname LIKE fpos-pname, wtext LIKE 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

6、OF g_t_lfa1 OCCURS 200, lifnr LIKE lfa1-lifnr, sortl LIKE lfa1-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

7、 100, desc(66) TYPE c, r_fipos(66) TYPE c, com_fkbtr LIKE fmmp-fkbtr, fi_fkbtr LIKE 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 VALUE 0. DAT

8、A cashflow_detail. DATA : min_budat LIKE fmmp-budat, max_budat LIKE fmmp-budat, z_min_budat LIKE sy-datum, z_max_budat LIKE sy-datum, z_bukrs LIKE fmmp-bukrs, z_profit LIKE bseg-dmbtr, 凈利潤 z_bad_debit LIKE bseg-dmbtr, 壞帳預備及計提的資產(chǎn)減值預備 z_asset_dep LIKE bseg-dmbtr, 固定資產(chǎn)折舊 z_intang_dep LIKE bseg-dmbtr, 無

9、形資產(chǎn)攤銷 z_longpaid_dep LIKE bseg-dmbtr, 長期待攤費用攤銷 z_paid_dec LIKE bseg-dmbtr, 待攤費用減少 z_accrul_inc LIKE bseg-dmbtr, 預提費用增加 z_asset_pro LIKE bseg-dmbtr, 固定資產(chǎn),長期資產(chǎn)處置損失 z_asset_scr LIKE bseg-dmbtr, 固定資產(chǎn)報廢損失 z_fi_expen LIKE bseg-dmbtr, 財務(wù)費用 z_invest_loss LIKE bseg-dmbtr, 投資損失 z_defer_tax LIKE bseg-dmbtr, 遞延

10、稅款貸項 z_stock LIKE bseg-dmbtr, 存貨減少 z_ar LIKE bseg-dmbtr, 經(jīng)營性應(yīng)收減少 z_ap LIKE bseg-dmbtr, 經(jīng)營性應(yīng)付增加 z_other LIKE bseg-dmbtr, 其他 z_production LIKE bseg-dmbtr, 經(jīng)營活動產(chǎn)生的現(xiàn)金凈額 z_loss LIKE bseg-dmbtr, 總公司下?lián)軓浹a虧損 z_asset_debit LIKE bseg-dmbtr, 以固定資產(chǎn)償還債務(wù) z_invest_debit LIKE bseg-dmbtr, 以投資償還債務(wù) z_asset_invest LIKE

11、bseg-dmbtr, 以固定資產(chǎn)投資 z_stock_debit LIKE bseg-dmbtr, 以存貨償還債務(wù) z_asset_rented LIKE bseg-dmbtr, 融資租賃固定資產(chǎn) z_donation LIKE bseg-dmbtr, 同意捐贈非現(xiàn)金資產(chǎn) z_debit_short LIKE bseg-dmbtr, 償還的經(jīng)營性債務(wù) z_debit_equit LIKE bseg-dmbtr, 債務(wù)轉(zhuǎn)為資本 z_bond_due LIKE bseg-dmbtr, 一年內(nèi)到期的可轉(zhuǎn)換公司債券 z_money_init LIKE bseg-dmbtr, 貨幣資金期初余額 z_m

12、oney_end LIKE bseg-dmbtr, 貨幣資金期末余額 z_cashs_init LIKE bseg-dmbtr, 現(xiàn)金等價物期初余額 z_cashs_end LIKE bseg-dmbtr, 現(xiàn)金等價物期末余額 z_all_money LIKE bseg-dmbtr. 貨幣資金及現(xiàn)金等價物凈變動 DATA: BEGIN OF itb0 OCCURS 0, txt(70) TYPE c, num LIKE bseg-dmbtr, END OF itb0, mtxt(70) TYPE c. *INITIALIZATION. PERFORM fill_item_direct. *ST

13、ART-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. COLLECT g_t_fpos. GET fmmp. MOVE-CORRESPONDING fmmp TO g_t_fmmp. CASE fmmp-wrttp. WHEN 50 OR 51. purchase order g_t_fmmp-zbelnr =

14、 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 commitments g_t_fmmp-zbelnr = fmmp-kblnr. g_t_fmmp-zbuzei = fmmp-kblpos. WHEN OTHERS. Fi documents g_t_fmmp-zbelnr = fmmp-vo_belnr. g_t_fmmp-zbuzei = fmmp-

15、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. r_lifnr-option = EQ. r_lifnr-low = fmmp-lifnr. COLLECT r_lifnr. ENDIF. END-OF-SELECTION. SORT g_t

16、_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_to LIKE sy-tabix VALUE 50, l_cnt_lines LIKE sy-tabix. * / Lesen Kreditoren-Texte aus Stammdaten-Tabelle IF NOT r_li

17、fnr IS INITIAL. LOOP AT r_lifnr WHERE low = *. DELETE r_lifnr. ENDLOOP. DESCRIBE TABLE r_lifnr LINES l_cnt_lines. - insert IF l_cnt_lines = 50. - insert * / Lieferanten-Kurztexte auf einmal einlesen - insert SELECT lifnr sortl FROM lfa1 INTO CORRESPONDING FIELDS OF TABLE g_t_lfa1 WHERE lifnr IN r_li

18、fnr. ELSE. - insert * / Lieferanten-Kurztexte in Bloecken einlesen - insert DO. - insert * / Bloecke zu je 50 Leferanten bilden - insert REFRESH lr_lifnr. - insert LOOP AT r_lifnr FROM l_cnt_from TO l_cnt_to. - insert lr_lifnr = r_lifnr. - insert APPEND lr_lifnr. - insert ENDLOOP. - insert IF sy-sub

19、rc NE 0. - insert EXIT. - insert ENDIF. - insert l_cnt_from = l_cnt_to + 1. - insert l_cnt_to = l_cnt_from + 50. - insert * / Lieferanten-Kurztexte lesen - insert SELECT lifnr sortl FROM lfa1 - insert APPENDING CORRESPONDING FIELDS - insert OF TABLE g_t_lfa1 - insert WHERE lifnr IN lr_lifnr. - inser

20、t ENDDO. - insert ENDIF. - insert ENDIF. * / Lesen Debitoren-Texte aus Stammdaten-Tabelle IF NOT r_kunnr IS INITIAL. LOOP AT r_kunnr WHERE low = *. DELETE r_kunnr. ENDLOOP. DESCRIBE TABLE r_kunnr LINES l_cnt_lines. - insert IF l_cnt_lines = 50. - insert * / Kunden-Kurztexte auf einmal einlesen - ins

21、ert SELECT kunnr sortl FROM kna1 INTO CORRESPONDING FIELDS OF TABLE g_t_kna1 WHERE kunnr IN r_kunnr. ELSE. - insert * / Kunden-Kurztexte in Bloecken einlesen - insert DO. - insert * / Bloecke zu je 50 Kunden bilden - insert REFRESH lr_kunnr. - insert LOOP AT r_kunnr FROM l_cnt_from TO l_cnt_to. - in

22、sert lr_kunnr = r_kunnr. - insert APPEND lr_kunnr. - insert ENDLOOP. - insert IF sy-subrc NE 0. - insert EXIT. - insert ENDIF. - insert l_cnt_from = l_cnt_to + 1. - insert l_cnt_to = l_cnt_from + 50. - insert * / Kunden-Kurztexte lesen - insert SELECT kunnr sortl FROM kna1 - insert APPENDING CORRESP

23、ONDING FIELDS - insert OF TABLE g_t_kna1 - insert WHERE kunnr IN lr_kunnr. - insert ENDDO. - insert ENDIF. g_t_fmmp-budat . min_budat = g_t_fmmp-budat . ENDIF. IF max_budat = r_fipos-low AND g_t_fmmp-fipos = r_fipos-high. int_cashflow-fi_fkbtr = int_cashflow-fi_fkbtr + g_t_fmmp-fkbtr. int_cashflow-c

24、om_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. PERFORM cal_indirect USING g_t_fmmp-bukrs. PERFORM output_info USING COM. num_of_bukrs = num_of_bukrs + 1. ENDAT. AT EN

25、D 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. 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) 金 流 量 表.

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

27、月, max_budat+6(2), 日, 212 單位: 元. WRITE: /011 sy-uline. WRITE : /011 sy-vline, 040 項 目, 085 sy-vline, 087 行次, 093 sy-vline, 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. CALL FUNC

28、TION FM_DOCUMENT_DISPLAY EXPORTING i_wrttp = g_t_fmmp-wrttp i_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_CRITERIA_PRINT EXPORTING i_report_nam

29、e = RFFMIEP5 EXCEPTIONS OTHERS = 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. READ_FIKRS_TEXT *& * *& Form READ_FIPOS_TEXT

30、 *& * 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 *& * FORM read_bukrs_text USING u_bukrs CHANGING c_butxt. g_t_t001 = spa

31、ce. 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) CHANGING c_text. CLEAR c_text. IF NOT u_kunnr IS INITIAL. IF u_kunnr = *.

32、 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. IF u_lifnr = *. c_text = *. ELSE. * / Lesen Kreditor-Text aus interner Tabelle g_t

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

34、HILE 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 = 0. ENDIF. SEARCH item FOR -. IF sy-subrc = 0. off = sy-fdpos. MOVE item(off) TO str. off = off + 1. r_fipos-sign

35、= 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_fipos-option = EQ. r_fipos-low = str. ENDIF. APPEND r_fipos. ENDWHILE. ENDFORM. * FORM output_info USING fi_value. DATA zcashflow LIKE fmmp-fkbtr.

36、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. 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-v

37、line, 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. IF 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.

38、ENDIF. WRITE: 116 sy-vline, 118(60) int_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 - 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,

39、 198 sy-vline. IF itb0-num 0. WRITE: 204 itb0-num CURRENCY g_t_fmmp-fwaer. ENDIF. ENDIF. WRITE: 220 sy-vline. WRITE: /011 sy-uline. IF j = 25. j = 0. PERFORM out_footer. NEW. ENDIF. ENDLOOP. PERFORM out_footer. ENDFORM. * * FORM out_footer * * * * * FORM out_footer. DATA: usrname(80) TYPE c. SELECT

40、SINGLE * FROM usr21 WHERE bname = sy-uname. SELECT SINGLE * FROM adrp WHERE persnumber = usr21-persnumber AND date_from = 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. *

41、 * 計算科目段在指定日期的起始余額 * * * * * 參數(shù):mdate1 開始日期(含此天) * * mdate2 結(jié)束日期(不含此天) * * 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. DAT

42、A: BEGIN OF itmp OCCURS 0, num LIKE bseg-dmbtr, END OF itmp. DATA: i LIKE sy-tabix. SELECT * FROM glt0 INTO TABLE iglt0 WHERE bukrs = z_bukrs AND ryear = mdate1(4) AND racct LIKE mstring. LOOP AT iglt0. REFRESH itmp. itmp-num = iglt0-hslvt. APPEND itmp. itmp-num = iglt0-hsl01. APPEND itmp. itmp-num

43、= iglt0-hsl02. APPEND itmp. itmp-num = iglt0-hsl03. APPEND itmp. itmp-num = iglt0-hsl04. APPEND itmp. itmp-num = iglt0-hsl05. APPEND itmp. itmp-num = iglt0-hsl06. APPEND itmp. itmp-num = iglt0-hsl07. APPEND itmp. itmp-num = iglt0-hsl08. APPEND itmp. itmp-num = iglt0-hsl09. APPEND itmp. itmp-num = ig

44、lt0-hsl10. APPEND itmp. itmp-num = iglt0-hsl11. APPEND itmp. LOOP AT itmp FROM 1 TO mdate1+4(2). znum = znum + itmp-num. ENDLOOP. ENDLOOP. SELECT * FROM bkpf WHERE bukrs = z_bukrs AND budat = mdate1 AND budat 0. 固定資產(chǎn)增加 if mllib-cnum 0. 融資租賃固定資產(chǎn) if masset-dnum 0. 固定資產(chǎn)減少 if mlib-dnum 0. 固定資產(chǎn)償還債務(wù)(經(jīng)營性)

45、if masset-cnum mlib-dnum. z_asset_debit = z_asset_debit + mlib-dnum. z_debit_short = z_debit_short + mlib-dnum. masset-cnum = masset-cnum - mlib-dnum. mlib-dnum = 0. else. z_asset_debit = z_asset_debit + masset-cnum. z_debit_short = z_debit_short + masset-cnum. mlib-dnum = mlib-dnum - masset-cnum. m

46、asset-cnum = 0. endif. endif. if mllib-dnum 0. 固定資產(chǎn)償還債務(wù)(長期) if masset-cnum mllib-dnum. z_asset_debit = z_asset_debit + mllib-dnum. masset-cnum = masset-cnum - mllib-dnum. mllib-dnum = 0. else. z_asset_debit = z_asset_debit + masset-cnum. mllib-dnum = mllib-dnum - masset-cnum. masset-cnum = 0. endif.

47、 endif. if minvest-dnum 0. 以固定資產(chǎn)投資 if masset-cnum minvest-dnum. z_asset_invest = z_asset_invest + minvest-dnum. masset-cnum = masset-cnum - minvest-dnum. minvest-dnum = 0. else. z_asset_invest = z_asset_invest + masset-cnum. minvest-dnum = minvest-dnum - masset-cnum. masset-cnum = 0. endif. endif. e

48、ndif. if minvest-dnum 0. 投資增加 if masset-cnum 0. 以固定資產(chǎn)投資 if masset-cnum minvest-dnum. z_asset_invest = z_asset_invest + minvest-dnum. masset-cnum = masset-cnum - minvest-dnum. minvest = 0. else. z_asset_invest = z_asset_invest + masset-cnum. minvest-dnum = minvest-dnum - masset-cnum. masset-cnum = 0.

49、 endif. endif. endif. if minvest-cnum 0. 投資減少 if mlib-dnum 0. 以投資償還債務(wù)(經(jīng)營性) if mlib-dnum minvest-cnum. z_invest_debit = z_invest_debit + minvest-cnum. z_debit_short = z_debit_short + minvest-cnum. mlib-dnum = mlib-dnum - minvest-cnum. minvest-cnum = 0. else. z_invest_debit = z_invest_debit + mlib-dnu

50、m. z_debit_short = z_debit_short + mlib-dnum. minvest-cnum = minvest-cnum - mlib-dnum. mlib-dnum = 0. endif. endif. if mllib-dnum 0. 以投資償還債務(wù)(長期) if mllib-dnum minvest-cnum. z_invest_debit = z_invest_debit + minvest-cnum. mllib-dnum = mllib-dnum - minvest-cnum. minvest-cnum = 0. else. z_invest_debit

51、= z_invest_debit + mllib-dnum. minvest-cnum = minvest-cnum - mllib-dnum. mllib-dnum = 0. endif. endif. endif. if mstock-cnum 0. 存貨減少 if mlib-dnum 0. 以存貨償還債務(wù)(經(jīng)營性) if mlib-dnum mstock-cnum. z_stock_debit = z_stock_debit + mstock-cnum. z_debit_short = z_debit_short + mstock-cnum. mlib-dnum = mlib-dnum

52、- mstock-cnum. mstock-cnum = 0. else. z_stock_debit = z_stock_debit + mlib-dnum. z_debit_short = z_debit_short + mlib-dnum. mstock-cnum = mstock-cnum - mlib-dnum. mlib-dnum = 0. endif. endif. if mllib-dnum 0. 以存貨償還債務(wù)(長期) if mllib-dnum mstock-cnum. z_stock_debit = z_stock_debit + mstock-cnum. mllib-d

53、num = mllib-dnum - mstock-cnum. mstock-cnum = 0. else. z_stock_debit = z_stock_debit + mllib-dnum. mstock-cnum = mstock-cnum - mllib-dnum. mllib-dnum = 0. endif. endif. endif. if mequit-cnum 0. 資本增加 if mlib-dnum 0. if mlib-dnum mequit-cnum. z_debit_equit = z_debit_equit + mequit-cnum. z_debit_short

54、= z_debit_short + mequit-cnum. mlib-dnum = mlib-dnum - mequit-cnum. mequit-cnum = 0. else. z_debit_equit = z_debit_equit + mlib-dnum. z_debit_short = z_debit_short + mlib-dnum. mequit-cnum = mequit-cnum - mlib-dnum. mlib-dnum = 0. endif. endif. if mllib-dnum 0. if mllib-dnum mequit-cnum. z_debit_equ

55、it = z_debit_equit + mequit-cnum. mllib-dnum = mllib-dnum - mequit-cnum. mequit-cnum = 0. else. z_debit_equit = z_debit_equit + mllib-dnum. mequit-cnum = mequit-cnum - mllib-dnum. mlib-dnum = 0. endif. endif. endif. END-OF-DEFINITION.* * FORM cal_indirect * * * * * * - pbukrs * * FORM cal_indirect U

56、SING pbukrs LIKE fmmp-bukrs. DATA: BEGIN OF tab1 OCCURS 0, gjahr LIKE bkpf-gjahr, belnr LIKE bkpf-belnr, END OF tab1, BEGIN OF tab2 OCCURS 0, gjahr LIKE bseg-gjahr, belnr LIKE bseg-belnr, hkont LIKE bseg-hkont, shkzg LIKE bseg-shkzg, dmbtr LIKE bseg-dmbtr, END OF tab2, BEGIN OF tab3 OCCURS 0, gjahr

57、LIKE bseg-gjahr, belnr LIKE bseg-belnr, hkont LIKE bseg-hkont, shkzg LIKE bseg-shkzg, dmbtr LIKE bseg-dmbtr, END OF tab3. IF NOT ( s_budat-low IS INITIAL ). z_min_budat = s_budat-low. ELSE. z_min_budat = min_budat. ENDIF. IF NOT ( s_budat-high IS INITIAL ). z_max_budat = s_budat-high. ELSE. z_max_bu

58、dat = max_budat. ENDIF. z_bukrs = pbukrs. SELECT gjahr belnr FROM bkpf INTO CORRESPONDING FIELDS OF TABLE tab1 WHERE bukrs = z_bukrs AND budat = z_min_budat AND budat = z_max_budat. LOOP AT tab1. SELECT hkont shkzg dmbtr FROM bseg INTO CORRESPONDING FIELDS OF tab2 WHERE gjahr = tab1-gjahr AND belnr

59、= tab1-belnr. tab2-gjahr = tab1-gjahr. tab2-belnr = tab1-belnr. APPEND tab2. ENDSELECT. ENDLOOP. REFRESH tab1. LOOP AT tab2. 挑出與補充資料相關(guān)的憑證號 IF tab2-hkont(4) = 1501 OR 固定資產(chǎn)原值科目 tab2-hkont(4) = 1701 OR 固定資產(chǎn)清理 tab2-hkont(4) = 1101 OR 短期投資 tab2-hkont(4) = 1401 OR 長期股權(quán)投資 tab2-hkont(4) = 1402 OR 長期債權(quán)投資 tab

60、2-hkont(4) = 1221 OR 包裝物 tab2-hkont(4) = 1231 OR 低值易耗品 tab2-hkont(4) = 1243 OR 庫存商品 tab2-hkont(4) = 3105 OR 上級撥入 tab2-hkont(4) = 3111. 資本公積 tab1-gjahr = tab2-gjahr. tab1-belnr = tab2-belnr. APPEND tab1. ENDIF. * IF tab2-shkzg = H. tab2-dmbtr = 0 - tab2-dmbtr. ENDIF. IF tab2-hkont(1) = 5. 凈利潤 ADD tab

溫馨提示

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

評論

0/150

提交評論