版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、在SAP中用承诺项目出现金流量表(报表开发源代码)可能使用到的外部数据 或 SAP数据表数据的格式、字段等: fkrs 财务管理范围主记录表 fops 承诺项目主记录表 fmmp 现金预算管理行项目表 lfa1 供应商主记录表 kna1 客户主记录表 bsis 总帐未清项表 t001 公司代码主记录表 usr21 用户主记录表 adrp 用户地址表 bkpf &
2、#160;财务凭证抬头表 bseg 财务凭证行项目表 glt0 总帐科目期间余额表 直接法通过分析凭证的承诺项目来取数,SAP为该项功能定义了一个逻辑数据库C1F. 本程序 开始部分的逻辑数据库取数部分是SAP的标准程序,其功能是将与现金流量相关的数据装入内部表 G_T_FMMP, 这部分程序禁止修改。 直接法: 1、装入金流量表定义参数(FORM fill_item_direct) 该子程序将的现金流量表项和其对应的承诺项目装入内部表INT_CASHFLOW. 2、装入与现
3、金流量相关的数据 这部分是逻辑数据库装入,属于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,
4、 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-wr
5、ttp, gjahr LIKE fmmp-gjahr, perio LIKE fmmp-perio, zhldt LIKE fmmp-zhldt, budat LIKE fmmp-budat, gsber
6、; LIKE fmmp-gsber, vo_saknr LIKE fmmp-vo_saknr, lifnr LIKE fmmp-lifnr, kunnr LIKE fmmp-kunnr, fwaer LIKE fmmp-fwaer,
7、; fkbtr LIKE fmsu-btr001, zbelnr LIKE cooi-refbn, zbuzei LIKE cooi-rfpos, vo_bukrs LIKE fmmp-vo_bukrs, vo_gjahr LIKE fmmp-vo_gjahr, f
8、itxt LIKE fkrs-fitxt, fname LIKE ffnd-fname, cname LIKE fctr-cname, pname LIKE fpos-pname, wtext LIKE fmmp-wtext,
9、160; 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,
10、0; 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,
11、; 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,
12、 desc(66) TYPE c, r_fipos(66) TYPE c, com_fkbtr LIKE fmmp-fkbtr, fi_fkbtr LIKE fmmp-fkbtr, fi_fwaer
13、 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,
14、 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_ma
15、x_budat LIKE sy-datum, z_bukrs LIKE fmmp-bukrs, z_profit LIKE bseg-dmbtr, "净利润 z_bad_debit LIKE bseg-dmbtr, "坏帐准备及计提的资产减值准备 &
16、#160; z_asset_dep LIKE bseg-dmbtr, "固定资产折旧 z_intang_dep LIKE bseg-dmbtr, "无形资产摊销 z_longpaid_dep LIKE bseg-dmbtr, "长期待摊费用摊销 z_paid_dec
17、; LIKE bseg-dmbtr, "待摊费用减少 z_accrul_inc LIKE bseg-dmbtr, "预提费用增加 z_asset_pro LIKE bseg-dmbtr, "固定资产,长期资产处置损失 z_asset_scr LIKE bseg-dmbtr,
18、160; "固定资产报废损失 z_fi_expen LIKE bseg-dmbtr, "财务费用 z_invest_loss LIKE bseg-dmbtr, "投资损失 z_defer_tax LIKE bseg-dmbtr, "递延税款贷项
19、; z_stock LIKE bseg-dmbtr, "存货减少 z_ar LIKE bseg-dmbtr, "经营性应收减少 z_ap LIKE bseg-dmbtr, "经营性应付增加
20、160; z_other LIKE bseg-dmbtr, "其它 z_production LIKE bseg-dmbtr, "经营活动产生的现金净额 z_loss LIKE bseg-dmbtr, "总公司下拨弥补亏损
21、 z_asset_debit LIKE bseg-dmbtr, "以固定资产偿还债务 z_invest_debit LIKE bseg-dmbtr, "以投资偿还债务 z_asset_invest LIKE bseg-dmbtr, "以固定资产投资 z_stock_debit LIKE bseg-dmbtr,
22、; "以存货偿还债务 z_asset_rented LIKE bseg-dmbtr, "融资租赁固定资产 z_donation LIKE bseg-dmbtr, "接受捐赠非现金资产 z_debit_short LIKE bseg-dmbtr, "偿还的经营性债务 z
23、_debit_equit LIKE bseg-dmbtr, "债务转为资本 z_bond_due LIKE bseg-dmbtr, "一年内到期的可转换公司债券 z_money_init LIKE bseg-dmbtr, "货币资金期初余额 z_money_end LIKE bs
24、eg-dmbtr, "货币资金期末余额 z_cashs_init LIKE bseg-dmbtr, "现金等价物期初余额 z_cashs_end LIKE bseg-dmbtr, "现金等价物期末余额 z_all_money LIKE bseg-dmbtr. &qu
25、ot;货币资金及现金等价物净变动 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.
26、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
27、 '50' OR '51'. " purchase order g_t_fmmp-zbelnr = fmmp-ebeln. g_t_fmmp-zbuzei = fmmp-ebelp. WHEN '64'.
28、60; " payment transfer g_t_fmmp-zbelnr = fmmp-kblnr. g_t_fmmp-zbuzei = fmmp-kblpos. WHEN '65'. " funds commitments g_t_fmmp-z
29、belnr = 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. E
30、NDCASE. 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.
31、60;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
32、; 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,
33、0; 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
34、. ENDLOOP. DESCRIBE TABLE r_lifnr LINES l_cnt_lines. "<- insert IF l_cnt_lines <= 50.
35、60; "<- insert * "/ Lieferanten-Kurztexte auf einmal einlesen "<- insert SELECT lifnr sortl FROM lfa1 INTO CORRESPONDING FIELDS OF TABLE g_t_lfa1
36、160; WHERE lifnr IN r_lifnr. ELSE. "<- insert * "/ Lieferanten-Kurztext
37、e in Bloecken einlesen "<- insert DO. "<- insert *
38、; "/ Bloecke zu je 50 Leferanten bilden "<- insert REFRESH lr_lifnr. "<- insert
39、; LOOP AT r_lifnr FROM l_cnt_from TO l_cnt_to. "<- insert lr_lifnr = r_lifnr. "<- insert
40、60; APPEND lr_lifnr. "<- insert ENDLOOP. &
41、#160; "<- insert IF sy-subrc NE 0. "<- insert EXIT.
42、0; "<- insert ENDIF.
43、 "<- insert l_cnt_from = l_cnt_to + 1. "<- insert l_cnt_to = l_cnt_from + 50. &
44、#160; "<- insert * "/ Lieferanten-Kurztexte lesen "<- insert SELECT lifnr sortl FROM lfa1
45、60; "<- insert APPENDING CORRESPONDING FIELDS "<- insert OF TABLE g_t_lfa1
46、 "<- insert WHERE lifnr IN lr_lifnr. "<- insert ENDDO. &
47、#160; "<- insert ENDIF.
48、60; "<- 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_
49、cnt_lines. "<- insert IF l_cnt_lines <= 50. "<- insert * "/ Kunden-Kurztexte auf
50、einmal einlesen "<- insert SELECT kunnr sortl FROM kna1 INTO CORRESPONDING FIELDS OF TABLE g_t_kna1 WHERE kunnr IN r_kunnr.
51、60;ELSE. "<- insert * "/ Kunden-Kurztexte in Bloecken einlesen
52、 "<- insert DO. "<- insert * "/ Bloecke zu je 50 Kun
53、den bilden "<- insert REFRESH lr_kunnr. "<- insert LOOP AT r_k
54、unnr FROM l_cnt_from TO l_cnt_to. "<- insert lr_kunnr = r_kunnr. "<- insert APPEND lr_kunnr.
55、 "<- insert ENDLOOP.
56、"<- insert IF sy-subrc NE 0. "<- insert EXIT.
57、160; "<- insert ENDIF. "<- i
58、nsert l_cnt_from = l_cnt_to + 1. "<- insert l_cnt_to = l_cnt_from + 50. "
59、<- insert * "/ Kunden-Kurztexte lesen "<- insert SELECT kunnr sortl FROM kna1
60、; "<- insert APPENDING CORRESPONDING FIELDS "<- insert OF TABLE g_t_kna1
61、160; "<- insert WHERE kunnr IN lr_kunnr. "<- insert ENDDO.
62、60; "<- insert ENDIF.
63、;"<- 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,
64、 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_fm
65、mp-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
66、. CLEAR int_cashflow. ENDLOOP. ENDAT. AT NEW bukrs. PERFORM read_bukrs_text USING g_t_fmmp-bukrs CHANGING g_t_t001-b
67、utxt. l_sav_butxt = g_t_t001-butxt. LOOP AT int_cashflow. CLEAR int_cashflow-com_fkbtr. MODIFY TABLE int_cashflow. CLEAR int_cashflow. ENDLOOP. EN
68、DAT. 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.
69、 int_cashflow-fi_fkbtr = int_cashflow-fi_fkbtr + g_t_fmmp-fkbtr. int_cashflow-com_fkbtr = int_cashflow-com_f
70、kbtr + g_t_fmmp-fkbtr. ENDIF. ENDIF. IF r_fipos-option = 'BT'.
71、160; IF g_t_fmmp-fipos >= r_fipos-low AND g_t_fmmp-fipos <= r_fipos-high. int_cashflow-fi_fkbtr = int_cashflow-fi_fkbtr
72、60; + g_t_fmmp-fkbtr. int_cashflow-com_fkbtr = int_cashflow-com_fkbtr &
73、#160; + g_t_fmmp-fkbtr. ENDIF. ENDIF. ENDLOOP. MODIFY TABLE int_cashflow. CLEAR int_cashflow. CLEAR r_fipos. REF
74、RESH 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.
75、 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
76、 ). 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
77、) = max_budat(6). * WRITE: /104 min_budat(4), '年', min_budat+4(2), '月', * 202 '报表编号: 会商03表'. * ELSE. * WRITE: /097 '日期:', * 103 min_budat, 113 '-'
78、 , 115 max_budat, * 202 '报表编号: 会商03表'. * ENDIF. * WRITE: /012 '编制单位: ', l_sav_butxt, 100 max_budat(4), '年', max_budat+4(2), '月',
79、0; max_budat+6(2), '日', 212 '单位: 元'. WRITE: /011 sy-uline. WRITE : /011 sy-vline, 040 ' 项 目', 085 sy-vline, 087 '行次',
80、60; 093 sy-vline, 095 ' 金 额 ', 116 sy-vline, 148 '补充资料', 190 sy-vline, 192 '行次'
81、;, 198 sy-vline, ' 金 额', 220 sy-vline. WRITE: /011 sy-uline. * * AT LINE-SELECTION. CHECK l_sav_hide_row_type = 'EPOS'. CALL FUNCTION 'FM_DOCUMENT_DISPLAY'
82、 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
83、 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' EXP
84、ORTING i_report_name = 'RFFMIEP5' EXCEPTIONS OTHERS = 1. ENDCASE. *&- * *& Form
85、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. E
86、NDFORM. " READ_FIKRS_TEXT *&- * *& Form READ_FIPOS_TEXT *&- * FORM read_fipos_text USING u_fipos CHANGING c_pname. g_t_f
87、pos = 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
88、_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. ENDFO
89、RM. " READ_FIPOS_TEXT *&- * *& Form GET_KUNNR_LIFNR_TEXT *&- * FORM get_kunnr_lifnr_text USING value(u_kunnr) &
90、#160; value(u_lifnr) CHANGING c_text. CLEAR c_text. IF NOT u_kunnr IS INITIAL. IF u_kunnr = '*'. c_text = '*'. ELSE. *
91、60; "/ 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.
92、 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.
93、; 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.
94、0; " 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 r
95、fipos 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'
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 长安大学照明课程设计
- 通信达课程设计
- 集训画室创业课程设计
- 边坡治理课程设计
- 通信工程仿真课程设计
- 绘本课程设计大纲
- 锅炉点火plc课程设计
- 肝性脑病课程设计
- 陶瓷课程设计绪论
- 课程设计学习记录表
- 新能源行业市场分析报告
- 2025年高考历史复习之小题狂练300题(选择题):秦汉时期(20题)
- 钻机安全操作规程(3篇)
- 2025年产业园区运营与管理企业组织结构及部门职责
- 岩土工程勘察.课件
- 第五章 无土育苗技术
- 2022年7月2日江苏事业单位统考《综合知识和能力素质》(管理岗)
- 福建省福州三牧中学2024-2025学年七年级上学期期中生物试题(无答案)
- 2024统战工作总结
- 银行营业网点诈骗、冒领等突发事件应急预案
- 初一英语语法练习
评论
0/150
提交评论