在SAP中用承诺项目出现金流量表(报表开发源代码)
可能使用到的外部数据或 SAP数据表数据的格式、字段等:
fkrs 财务管理范围主记录表
fops 承诺项目主记录表
fmmp 现金预算管理行项目表
lfa1 供应商主记录表
kna1 客户主记录表
bsis 总帐未清项表
t001 公司代码主记录表
usr21 用户主记录表
adrp 用户地址表
bkpf 财务凭证抬头表
bseg 财务凭证行项目表
glt0 总帐科目期间余额表
直接法通过分析凭证的承诺项目来取数,SAP为该项功能定义了一个逻辑数据库C1F. 本程序
开始部分的逻辑数据库取数部分是SAP的标准程序,其功能是将与现金流量相关的数据装入内部表
G_T_FMMP, 这部分程序禁止修改。
直接法:
1、装入金流量表定义参数(FORM fill_item_direct)
该子程序将的现金流量表项和其对应的承诺项目装入内部表INT_CASHFLOW.
2、装入与现金流量相关的数据
这部分是逻辑数据库装入,属于SAP标准程序,数据关系比较复杂,建议不要做任何改动。
3、计算现金流量
计算的基本思路是对表G_T_FMMP进行循环,查找其中每条记录的承诺项目属于INT_CASHFLOW的
表项后,把其金额累计到相应表项。
REPORT zcmrp001 NO STANDARD PAGE HEADING LINE-SIZE 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-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-fname,
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 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 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.
DATA 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, "坏帐准备及计提的资产减值准备
z_asset_dep LIKE bseg-dmbtr, "固定资产折旧
z_intang_dep LIKE bseg-dmbtr, "无形资产摊销
z_longpaid_dep LIKE bseg-dmbtr, "长期待摊费用摊销
z_paid_dec LIKE bseg-dmbtr, "待摊费用减少
z_accrul_inc LIKE bseg-dmbtr, "预提费用增加
z_asset_pro LIKE bseg-dmbtr, "固定资产,长期资产处置损失
z_asset_scr LIKE bseg-dmbtr, "固定资产报废损失
z_fi_expen LIKE bseg-dmbtr, "财务费用
z_invest_loss LIKE bseg-dmbtr, "投资损失
z_defer_tax LIKE bseg-dmbtr, "递延税款贷项
z_stock LIKE bseg-dmbtr, "存货减少
z_ar LIKE bseg-dmbtr, "经营性应收减少
z_ap LIKE bseg-dmbtr, "经营性应付增加
z_other LIKE bseg-dmbtr, "其他
z_production LIKE bseg-dmbtr, "经营活动产生的现金净额
z_loss LIKE bseg-dmbtr, "总公司下拨弥补亏损
z_asset_debit LIKE bseg-dmbtr, "以固定资产偿还债务
z_invest_debit LIKE bseg-dmbtr, "以投资偿还债务
z_asset_invest LIKE bseg-dmbtr, "以固定资产投资
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-dmbtr, "现金等价物期末余额
z_all_money LIKE bseg-dmbtr. "货币资金及现金等价物净变动
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.
*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.
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 = 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-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_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_lifnr 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 OFTABLE g_t_lfa1
WHERE lifnr IN r_lifnr.
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-subrc 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 TABLEg_t_lfa1 "<-insert
WHERE lifnr IN lr_lifnr. "<-insert
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 "<- insert
SELECT kunnr sortl FROM kna1
INTO CORRESPONDING FIELDS OFTABLE 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. "<- insert
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 CORRESPONDING FIELDS "<- insert
OF TABLEg_t_kna1 "<- insert
WHERE kunnr IN lr_kunnr. "<-insert
ENDDO. "<- insert
ENDIF. "<- insert
ENDIF.
SELECT bukrs butxt FROM t001
INTO 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 = '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 int_cashflow.
ENDLOOP.
ENDAT.
AT NEW bukrs.
PERFORM read_bukrs_text USING g_t_fmmp-bukrs
CHANGING 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_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_fipos-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.
PERFORM 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_budat = s_budat-low.
ENDIF.
IF NOT ( s_budat-high IS INITIAL ).
max_budat = s_budat-high.
ENDIF.
SKIP 2.
WRITE: /100 '现 金 流 量 表'.
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 '-' , 115max_budat,
* 202 '报表编号: 会商03表'.
* ENDIF.
*
WRITE: /012 '编制单位: ', l_sav_butxt,
100 max_budat(4), '年', max_budat+4(2), '月',
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,
' 金 额', 220sy-vline.
WRITE: /011 sy-uline.
***********************************************************************
*
AT LINE-SELECTION.
CHECK l_sav_hide_row_type = 'EPOS'.
CALL FUNCTION '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_name ='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
*&---------------------------------------------------------------------
*
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 = 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)
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.
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: 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 = 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_fipos-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'.
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.
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.
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, 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-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_from <= sy-datum AND
date_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.
***********************************************************************
******************* 计算科目段在指定日期的起始余额 ********************
***********************************************************************
***** *****
***** 参数:mdate1 开始日期(含此天) *****
***** mdate2 结束日期(不含此天) *****
***** mstrin 科目编号的匹配模式字符串 *****
***** 结果:znum *****
***** 算法:某日余额 = 年初余额 + 一月余额 + ...+ *****
***** 上月余额 + 本月到mdate2余额 *****
***** *****
***********************************************************************
FORM cal_dates_amount USING mdate1 mdate2 mstring
CHANGINGznum.
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.
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 = 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 = iglt0-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 < 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.
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 type datatype. "权益数据
loop at tab2.
case tab2-hkont(4).
when '1501' or '1701'. "固定资产和无形资产
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'.
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'. "经营性负债
if tab2-shkzg = 'S'.
add tab2-dmbtr to mlib-dnum.
else.
add tab2-dmbtr to mlib-cnum.
endif.
when '2321'. "长期负债
if tab2-shkzg = 'S'.
add tab2-dmbtr to mllib-dnum.
else.
add tab2-dmbtr to mllib-cnum.
endif.
when '3105' or '3111'. "所有者权益
if tab2-shkzg = 'S'.
add tab2-dmbtr to mequit-dnum.
else.
add tab2-dmbtr to mequit-cnum.
endif.
endcase.
endloop.
if masset-dnum > 0. "固定资产增加
if mllib-cnum > 0. "融资租赁固定资产
if masset-dnum < mllib-cnum.
z_asset_rented = z_asset_rented + masset-dnum.
mllib-cnum = mllib-cnum - masset-dnum.
masset-dnum = 0.
else.
z_asset_rented = z_asset_rented + mllib-cnum.
masset-dnum = masset-dnum - mllib-cnum.
mllib-cnum = 0.
endif.
endif.
endif.
if masset-cnum > 0. "固定资产减少
if mlib-dnum > 0. "固定资产偿还债务(经营性)
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.
masset-cnum = 0.
endif.
endif.
if mllib-dnum > 0. "固定资产偿还债务(长期)
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.
endif.
if minvest-dnum > 0. "以固定资产投资
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.
endif.
if minvest-dnum > 0. "投资增加
if masset-cnum > 0. "以固定资产投资
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.
endif.
endif.
endif.
if minvest-cnum > 0. "投资减少
if mlib-dnum > 0. "以投资偿还债务(经营性)
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-dnum.
z_debit_short = z_debit_short +mlib-dnum.
minvest-cnum = minvest-cnum -mlib-dnum.
mlib-dnum = 0.
endif.
endif.
if mllib-dnum > 0. "以投资偿还债务(长期)
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 = 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. "以存货偿还债务(经营性)
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 -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. "以存货偿还债务(长期)
if mllib-dnum > mstock-cnum.
z_stock_debit = z_stock_debit + mstock-cnum.
mllib-dnum = 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 = 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_equit = 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 USING 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 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_budat = 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 = tab1-belnr.
tab2-gjahr = tab1-gjahr.
tab2-belnr = tab1-belnr.
APPEND tab2.
ENDSELECT.
ENDLOOP.
REFRESH tab1.
LOOP AT tab2. "挑出与补充资料相关的凭证号
IF tab2-hkont(4) = '1501' OR "固定资产原值科目
tab2-hkont(4) = '1701' OR "固定资产清理
tab2-hkont(4) = '1101' OR "短期投资
tab2-hkont(4) = '1401' OR "长期股权投资
tab2-hkont(4) = '1402' OR "长期债权投资
tab2-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 tab2-dmbtr TO z_profit.
ENDIF.
IF tab2-hkont = '5501037000'. "管理费用-坏帐损失
ADD tab2-dmbtr TO z_bad_debit.
ENDIF.
IF tab2-hkont = '1102000000' OR "短期投资减值准备
tab2-hkont = '1281000000' OR "存 货跌价准备
tab2-hkont = '1421000000' OR "长期投资减值准备
tab2-hkont = '1505000000' OR "固定资产减值准备
tab2-hkont = '1605000000' OR "在建工程减值准备
tab2-hkont = '1281000000'. "无形资产减值准备
z_bad_debit = z_bad_debit - tab2-dmbtr.
ENDIF.
IF tab2-hkont(7) = '5501020'. "固定资产折旧
ADD tab2-dmbtr TO z_asset_dep.
ENDIF.
IF tab2-hkont(7) = '5501043'. "无形资产摊销
ADD tab2-dmbtr TO z_intang_dep.
ENDIF.
IF tab2-hkont(4) = '1301'. "待摊费用
ADD tab2-dmbtr TO z_paid_dec.
ENDIF.
IF tab2-hkont(4) = '2191'. "预提费用
ADD tab2-dmbtr TO z_accrul_inc.
ENDIF.
IF tab2-hkont = '5301001000' OR "营业外收入-处置长期资产净收入
tab2-hkont = '5301002000' OR "营业外收入-固定资产盘盈
tab2-hkont = '5601001000' OR "营业外支出-处置长期资产净损失
tab2-hkont = '5601002000'. "营业外支出-固定资产盘亏
ADD tab2-dmbtr TO z_asset_pro.
ENDIF.
IF tab2-hkont(4) = '5503'. "财务费用
ADD tab2-dmbtr TO z_fi_expen.
ENDIF.
IF tab2-hkont(4) = '1221' OR "包装物
tab2-hkont(4) = '1231' OR "低值易耗品
tab2-hkont(4) = '1243'. "库存商品
ADD tab2-dmbtr TO z_stock.
ENDIF.
IF tab2-hkont(4) = '1111' OR "应收票据
tab2-hkont(4) = '1131' OR "应收帐款
tab2-hkont(4) = '1133' OR "其他应收帐款
tab2-hkont(4) = '1141'. "坏帐准备
ADD tab2-dmbtr TO z_ar.
ENDIF.
IF tab2-hkont(4) = '2111' OR "应付票据
tab2-hkont(4) = '2121' OR "应付帐款
tab2-hkont(4) = '2151' OR "应付工资
tab2-hkont(4) = '2153' OR "应付福利费
tab2-hkont(4) = '2171' OR "应交税金
tab2-hkont(4) = '2176' OR "其他应缴款
tab2-hkont(4) = '2181'. "其他应付款
ADD tab2-dmbtr TO z_ap.
ENDIF.
ENDLOOP.
SORT tab1 BY gjahr belnr.
DELETE ADJACENT DUPLICATES FROM tab1 COMPARING gjahr belnr.
LOOP AT tab2.
READ TABLE tab1 WITH KEY gjahr = tab2-gjahr
belnr = tab2-belnr BINARY SEARCH.
IF sy-subrc = 0.
tab3 = tab2. APPEND tab3.
ENDIF.
ENDLOOP.
REFRESH tab2.
SORT tab3 BY gjahr belnr.
LOOP AT tab3.
tab2 = tab3. APPEND tab2.
AT END OF belnr.
cal_data. "计算每张凭证中的补充资料
REFRESH tab2.
ENDAT.
ENDLOOP.
z_stock = z_stock + z_stock_debit.
z_ap = z_ap - z_debit_short.
LOOP AT int_cashflow.
IF int_cashflow-desc CP '*经营活动产生的现金流量净额*'.
z_other = z_profit - z_bad_debit -z_asset_dep - z_intang_dep
- z_longpaid_dep +z_paid_dec + z_accrul_inc
- z_asset_pro - z_asset_scr -z_fi_expen - z_invest_loss
+ z_defer_tax + z_stock + z_ar + z_ap.
z_production = int_cashflow-com_fkbtr.
z_other = int_cashflow-com_fkbtr + z_other.
EXIT.
ENDIF.
ENDLOOP.
z_profit = 0 - z_profit.
z_defer_tax = 0 - z_defer_tax.
z_stock = 0 - z_stock.
z_ar = 0 - z_ar.
z_ap = 0 - z_ap.
z_paid_dec = 0 - z_paid_dec.
z_accrul_inc = 0 - z_accrul_inc.
DATA: mdate1 LIKE sy-datum, mdate2 LIKE sy-datum.
mdate1 = z_min_budat. mdate1+6(2) = '01'.
PERFORM cal_dates_amount USING mdate1 "计算期初货币资金余额
z_min_budat
'100%'
CHANGING z_money_init.
mdate1 = z_max_budat. mdate1+6(2) = '01'.
mdate2 = z_max_budat + 1.
PERFORM cal_dates_amount USING mdate1 "计算期末货币资金余额
mdate2
'100%'
CHANGING z_money_end.
z_all_money = z_money_end - z_money_init +
z_cashs_end -z_cashs_init.
PERFORM fill_item.
ENDFORM.
*---------------------------------------------------------------------*
* FORM fill_item *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM fill_item.
REFRESH itb0.
mtxt = '补充资料 ' .
itb0-txt = mtxt. itb0-num = 0. APPEND itb0.
mtxt = '1、将净利润调节为经营活动的现金流量 ' .
itb0-txt = mtxt. itb0-num = 0. APPEND itb0.
mtxt = ' 净利润 ' .
itb0-txt = mtxt. itb0-num = z_profit. APPEND itb0.
mtxt = ' 加:计提的资产减值准备 ' .
itb0-txt = mtxt. itb0-num = z_bad_debit. APPEND itb0.
mtxt = ' 固定资产折旧 ' .
itb0-txt = mtxt. itb0-num = z_asset_dep. APPEND itb0.
mtxt = ' 无形资产摊销 ' .
itb0-txt = mtxt. itb0-num = z_intang_dep. APPEND itb0.
mtxt = ' 长期待摊费用摊销 ' .
itb0-txt = mtxt. itb0-num = z_longpaid_dep. APPEND itb0.
mtxt = ' 待摊费用的减少(减:增加) ' .
itb0-txt = mtxt. itb0-num = z_paid_dec. APPEND itb0.
mtxt = ' 预提费用的增加(减:减少) ' .
itb0-txt = mtxt. itb0-num = z_accrul_inc. APPEND itb0.
mtxt = ' 处置固定资产、无形资产和其它长期资产的损失(减:收益) ' .
itb0-txt = mtxt. itb0-num = z_asset_pro. APPEND itb0.
mtxt = ' 固定资产报废损失 ' .
itb0-txt = mtxt. itb0-num = z_asset_scr. APPEND itb0.
mtxt = ' 财务费用 ' .
itb0-txt = mtxt. itb0-num = z_fi_expen. APPEND itb0.
mtxt = ' 投资损失(减:收益) ' .
itb0-txt = mtxt. itb0-num = z_invest_loss. APPEND itb0.
mtxt = ' 递延税款贷项(减:借项) ' .
itb0-txt = mtxt. itb0-num = z_defer_tax. APPEND itb0.
mtxt = ' 存货的减少(减:增加) ' .
itb0-txt = mtxt. itb0-num = z_stock. APPENDitb0.
mtxt = ' 经营性应收项目的减少(减:增加) ' .
itb0-txt = mtxt. itb0-num = z_ar. APPEND itb0.
mtxt = ' 经营性应付项目的增加(减:减少) ' .
itb0-txt = mtxt. itb0-num = z_ap. APPEND itb0.
mtxt = ' 其它 ' .
itb0-txt = mtxt. itb0-num = z_other. APPENDitb0.
mtxt = ' 经营活动产生的现金流量净额 ' .
itb0-txt = mtxt. itb0-num = z_production. APPEND itb0.
mtxt = '2、不涉及现金收支的投资活动和筹资活动: ' .
itb0-txt = mtxt. itb0-num = 0. APPEND itb0.
* mtxt = ' 以固定资产偿还债务 '.
* itb0-txt = mtxt. itb0-num = z_asset_debit. APPEND itb0.
* mtxt = ' 以投资偿还债务 ' .
* itb0-txt = mtxt. itb0-num = z_invest_debit. APPEND itb0.
* mtxt = ' 以固定资产进行投资 '.
* itb0-txt = mtxt. itb0-num = z_asset_invest. APPEND itb0.
* mtxt = ' 以存货偿还债务 ' .
* itb0-txt = mtxt. itb0-num = z_stock_debit. APPEND itb0.
mtxt = ' 债务转为资本 ' .
itb0-txt = mtxt. itb0-num = z_debit_equit. APPEND itb0.
mtxt = ' 一年内到期的可转换公司债券 ' .
itb0-txt = mtxt. itb0-num = z_bond_due. APPEND itb0.
mtxt = ' 融资租赁固定资产 ' .
itb0-txt = mtxt. itb0-num = z_asset_rented. APPEND itb0.
mtxt = ' 其它 ' .
itb0-txt = mtxt. itb0-num = 0. APPEND itb0.
* mtxt = ' 接受捐赠的非现金资产 '.
* itb0-txt = mtxt. itb0-num = z_donation. APPENDitb0.
mtxt = '3、现金及现金等价物净增加情况: ' .
itb0-txt = mtxt. itb0-num = 0. APPEND itb0.
mtxt = ' 货币资金的期末余额 ' .
itb0-txt = mtxt. itb0-num = z_money_end. APPEND itb0.
mtxt = ' 减:货币资金的期初余额 '.
itb0-txt = mtxt. itb0-num = z_money_init. APPEND itb0.
mtxt = ' 现金等价物的期末余额 ' .
itb0-txt = mtxt. itb0-num = z_cashs_end. APPEND itb0.
mtxt = ' 减:现金等价物的期初余额 ' .
itb0-txt = mtxt. itb0-num = z_cashs_init. APPEND itb0.
mtxt = ' 现金及现金等价物的净增加额 ' .
itb0-txt = mtxt. itb0-num = z_all_money. APPEND itb0.
ENDFORM.
*---------------------------------------------------------------------*
* FORM fill_item_direct *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM fill_item_direct.
DATA: s1(66) TYPE c,
s2(66) TYPE c.
CLEAR: int_cashflow, s1, s2.
s1 = '一、经营活动产生的现金流量: '.
s2 = ' '.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 销售商品、提供劳务收到的现金 '.
s2 = 'A1000-A1999,A8000-A8299,A8900-A8910,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 收到的税费返还 '.
s2 = 'A3100,A3110,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 收到的其它与经营活动有关的现金 '.
s2 = 'A2000-A2999,A3500-A3910,A8300-A8410,A9999,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 现金流入小计 '.
s2 = 'A1000-A3910,A8000-A9999,C9000,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 购买商品、接受劳务支付的现金 '.
s2 = 'B1000-B2999,B8000-B8200,B8900-B8999,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 支付给职工以及为职工支付的现金 '.
s2 = 'B3100,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 支付的各项税费 '.
s2 = 'B3110,B3211,B3212,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 支付的其它与经营活动有关的现金 '.
s2 = 'B3000,B3300-B3910,B8300,B9999,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 现金流出小计 '.
s2 = 'B1000-B3910,B8000-B9999,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '经营活动产生的现金流量净额 '.
s2 = 'A1000-A3999,A8000-A9999,B1000-B3999,B8000-B9999,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '二、投资活动产生的现金流量: '.
s2 = ''.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 收回投资所收到的现金 '.
s2 = 'A4000,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 取得投资收益所收到的现金 '.
s2 = 'A4100,A4200,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 处置固定资产、无形资产和其他长期资产'.
s2 = '而收到的现金净额 '.
DATA: xtx(150) TYPE c.
CONCATENATE s1 s2 INTO xtx.
CONDENSE xtx NO-GAPS.
int_cashflow-desc = xtx.
CLEAR s2.
s2 = 'A4300,'.
int_cashflow-desc = xtx. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 收到的其它与投资活动有关的现金 '.
s2 = 'A4400,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 现金流入小计 '.
s2 = 'A4000-A4400'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 购建固定资产、无形资产和其他长期资产所支付的现金'.
s2 = 'B4000,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 投资支付的现金 '.
s2 = 'B4100,B4200,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 支付的其它与投资活动有关的现金 '.
s2 = 'B4300,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
s1 = ' 现金流出小计 '.
s2 = 'A4000-A4400,B4000-B4300,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '投资活动产生的现金流量净额 '.
s2 = 'A4000-A4400,B4000-B4300,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '三、筹资活动产生的现金流量: '.
s2 = ''.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 吸收投资所收到的现金 '.
s2 = 'A5000,A5100,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 借款所收到的现金 '.
s2 = 'A5200,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 收到的其它与筹资活动有关的现金 '.
s2 = 'A5300,A5500,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 现金流入小计 '.
s2 = 'A5000-A5300,A5500'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 偿还债务所支付的现金 '.
s2 = 'B5000,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 分配股利或利润所支付的现金 '.
s2 = 'B5200,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 支付的其它与筹资活动有关的现金 '.
s2 = 'B5100,B5400,B5500,B5600,B5800,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = ' 现金流出小计 '.
s2 = 'B5000-B5600,B5800,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '筹资活动产生的现金流量净额'.
s2 = 'A5000-A5300,A5500,B5000-B5600,B5800,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '四、汇率变化对现金的影响额 '.
s2 = 'A5400,B5700,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
CLEAR: int_cashflow, s1, s2.
s1 = '五、现金及现金等价物净增加额 '.
s2 = 'A0000-C9000,'.
int_cashflow-desc = s1. int_cashflow-r_fipos = s2.
APPEND int_cashflow.
ENDFORM.