现金流量表报表开发源代码.docx
- 文档编号:25870026
- 上传时间:2023-06-16
- 格式:DOCX
- 页数:37
- 大小:27.98KB
现金流量表报表开发源代码.docx
《现金流量表报表开发源代码.docx》由会员分享,可在线阅读,更多相关《现金流量表报表开发源代码.docx(37页珍藏版)》请在冰豆网上搜索。
现金流量表报表开发源代码
在SAP中用承诺工程出现金流量表〔报表开发源代码〕
可能使用到的外部数据或SAP数据表数据的格式、字段等:
fkrs 财务管理范围主记录表
fops 承诺工程主记录表
fmmp 现金预算管理行工程表
lfa1 供给商主记录表
kna1 客户主记录表
bsis 总帐未清项表
t001 公司代码主记录表
usr21 用户主记录表
adrp 用户地址表
bkpf 财务凭证抬头表
bseg 财务凭证行工程表
glt0 总帐科目期间余额表
直接法通过分析凭证的承诺工程来取数,SAP为该项功能定义了一个逻辑数据库C1F.本程序
开始局部的逻辑数据库取数局部是SAP的标准程序,其功能是将与现金流量相关的数据装入内部表
G_T_FMMP,这局部程序禁止修改。
直接法:
1、装入金流量表定义参数〔FORMfill_item_direct〕
该子程序将的现金流量表项和其对应的承诺工程装入内部表INT_CASHFLOW.
2、装入与现金流量相关的数据
这局部是逻辑数据库装入,属于SAP标准程序,数据关系比拟复杂,建议不要做任何改动。
3、计算现金流量
计算的根本思路是对表G_T_FMMP进行循环,查找其中每条记录的承诺工程属于INT_CASHFLOW的
表项后,把其金额累计到相应表项。
REPORTzcmrp001 NOSTANDARDPAGEHEADINGLINE-SIZE220.
TABLES:
fkrs,fpos,fmmp,lfa1,kna1,bsis,
t001,usr21,adrp,bkpf,bseg,glt0.
DATA:
BEGINOFg_t_fmmpOCCURS300,
fikrs LIKEfmmp-fikrs,
bukrs LIKEfmmp-bukrs,
fipos LIKEfmmp-fipos,
wrttp LIKEfmmp-wrttp,
gjahr LIKEfmmp-gjahr,
perio LIKEfmmp-perio,
zhldt LIKEfmmp-zhldt,
budat LIKEfmmp-budat,
gsber LIKEfmmp-gsber,
vo_saknrLIKEfmmp-vo_saknr,
lifnr LIKEfmmp-lifnr,
kunnr LIKEfmmp-kunnr,
fwaer LIKEfmmp-fwaer,
fkbtr LIKEfmsu-btr001,
zbelnr LIKEcooi-refbn,
zbuzei LIKEcooi-rfpos,
vo_bukrsLIKEfmmp-vo_bukrs,
vo_gjahrLIKEfmmp-vo_gjahr,
fitxt LIKEfkrs-fitxt,
fname LIKEffnd-fname,
cname LIKEfctr-cname,
pname LIKEfpos-pname,
wtext LIKEfmmp-wtext,
ENDOFg_t_fmmp.
DATA:
BEGINOFg_t_fkrsOCCURS20,
fikrsLIKEfkrs-fikrs,
fitxtLIKEfkrs-fitxt,
ENDOFg_t_fkrs.
DATA:
BEGINOFg_t_fposOCCURS200,
fiposLIKEfpos-fipos,
pnameLIKEfpos-pname,
ENDOFg_t_fpos.
DATA:
BEGINOFg_t_lfa1OCCURS200,
lifnrLIKElfa1-lifnr,
sortlLIKElfa1-sortl,
ENDOFg_t_lfa1.
DATA:
BEGINOFg_t_kna1OCCURS200,
kunnrLIKEkna1-kunnr,
sortlLIKEkna1-sortl,
ENDOFg_t_kna1.
RANGES:
r_kunnrFORkna1-kunnr,
r_lifnrFORlfa1-lifnr,
r_fiposFORfmmp-fipos.
DATA:
BEGINOFint_cashflowOCCURS100,
desc(66) TYPEc,
r_fipos(66) TYPEc,
com_fkbtr LIKEfmmp-fkbtr,
fi_fkbtr LIKEfmmp-fkbtr,
fi_fwaer LIKEfmmp-fwaer,
ENDOFint_cashflow.
DATA:
BEGINOFg_t_t001OCCURS300,
bukrsLIKEt001-bukrs,
butxtLIKEt001-butxt,
ENDOFg_t_t001.
DATA:
pos TYPEiVALUE0,
num_of_bukrsTYPEiVALUE0.
DATA cashflow_detail.
DATA:
min_budat LIKEfmmp-budat,
max_budat LIKEfmmp-budat,
z_min_budat LIKEsy-datum,
z_max_budat LIKEsy-datum,
z_bukrs LIKEfmmp-bukrs,
z_profit LIKEbseg-dmbtr, "净利润
z_bad_debit LIKEbseg-dmbtr, "坏帐准备及计提的资产减值准备
z_asset_dep LIKEbseg-dmbtr, "固定资产折旧
z_intang_dep LIKEbseg-dmbtr, "无形资产摊销
z_longpaid_depLIKEbseg-dmbtr, "长期待摊费用摊销
z_paid_dec LIKEbseg-dmbtr, "待摊费用减少
z_accrul_inc LIKEbseg-dmbtr, "预提费用增加
z_asset_pro LIKEbseg-dmbtr, "固定资产,长期资产处置损失
z_asset_scr LIKEbseg-dmbtr, "固定资产报废损失
z_fi_expen LIKEbseg-dmbtr, "财务费用
z_invest_loss LIKEbseg-dmbtr, "投资损失
z_defer_tax LIKEbseg-dmbtr, "递延税款贷项
z_stock LIKEbseg-dmbtr, "存货减少
z_ar LIKEbseg-dmbtr, "经营性应收减少
z_ap LIKEbseg-dmbtr, "经营性应付增加
z_other LIKEbseg-dmbtr, "其他
z_production LIKEbseg-dmbtr, "经营活动产生的现金净额
z_loss LIKEbseg-dmbtr, "总公司下拨弥补亏损
z_asset_debit LIKEbseg-dmbtr, "以固定资产归还债务
z_invest_debitLIKEbseg-dmbtr, "以投资归还债务
z_asset_investLIKEbseg-dmbtr, "以固定资产投资
z_stock_debit LIKEbseg-dmbtr, "以存货归还债务
z_asset_rentedLIKEbseg-dmbtr, "融资租赁固定资产
z_donation LIKEbseg-dmbtr, "接受捐赠非现金资产
z_debit_short LIKEbseg-dmbtr, "归还的经营性债务
z_debit_equit LIKEbseg-dmbtr, "债务转为资本
z_bond_due LIKEbseg-dmbtr, "一年内到期的可转换公司债券
z_money_init LIKEbseg-dmbtr, "货币资金期初余额
z_money_end LIKEbseg-dmbtr, "货币资金期末余额
z_cashs_init LIKEbseg-dmbtr, "现金等价物期初余额
z_cashs_end LIKEbseg-dmbtr, "现金等价物期末余额
z_all_money LIKEbseg-dmbtr. "货币资金及现金等价物净变动
DATA:
BEGINOFitb0OCCURS0,
txt(70)TYPEc,
num LIKEbseg-dmbtr,
ENDOFitb0,
mtxt(70)TYPEc.
**INITIALIZATION.
PERFORMfill_item_direct.
*START-OF-SELECTION.
GETfkrs.
g_t_fkrs-fikrs=fkrs-fikrs.
g_t_fkrs-fitxt=fkrs-fitxt.
APPENDg_t_fkrs.
GETfpos.
g_t_fpos-fipos=fpos-fipos.
g_t_fpos-pname=fpos-pname.
COLLECTg_t_fpos.
GETfmmp.
MOVE-CORRESPONDINGfmmpTOg_t_fmmp.
CASEfmmp-wrttp.
WHEN'50'OR'51'. "purchaseorder
g_t_fmmp-zbelnr=fmmp-ebeln.
g_t_fmmp-zbuzei=fmmp-ebelp.
WHEN'64'. "paymenttransfer
g_t_fmmp-zbelnr=fmmp-kblnr.
g_t_fmmp-zbuzei=fmmp-kblpos.
WHEN'65'. "fundscommitments
g_t_fmmp-zbelnr=fmmp-kblnr.
g_t_fmmp-zbuzei=fmmp-kblpos.
WHENOTHERS. "Fidocuments
g_t_fmmp-zbelnr=fmmp-vo_belnr.
g_t_fmmp-zbuzei=fmmp-vo_buzei.
ENDCASE.
APPENDg_t_fmmp.
IFNOTfmmp-kunnrISINITIAL.
r_kunnr-sign ='I'.
r_kunnr-option='EQ'.
r_kunnr-low =fmmp-kunnr.
COLLECTr_kunnr.
ENDIF.
IFNOTfmmp-lifnrISINITIAL.
r_lifnr-sign ='I'.
r_lifnr-option='EQ'.
r_lifnr-low=fmmp-lifnr.
COLLECTr_lifnr.
ENDIF.
END-OF-SELECTION.
SORTg_t_fmmpBYfikrs bukrs fipos wrttp gjahr
perio zhldt zbelnr
zbuzeibukrs vo_saknr.
RANGES:
lr_lifnrFORlfa1-lifnr,
lr_kunnrFORkna1-kunnr.
DATA:
l_cnt_from LIKEsy-tabixVALUE1,
l_cnt_to LIKEsy-tabixVALUE50,
l_cnt_linesLIKEsy-tabix.
*"/LesenKreditoren-TexteausStammdaten-Tabelle
IFNOTr_lifnrISINITIAL.
LOOPATr_lifnrWHERElow='*'.
DELETEr_lifnr.
ENDLOOP.
DESCRIBETABLEr_lifnrLINESl_cnt_lines. "<-insert
IFl_cnt_lines<=50. "<-insert
* "/Lieferanten-Kurztexteaufeinmaleinlesen "<-insert
SELECTlifnrsortlFROMlfa1
INTOCORRESPONDINGFIELDSOFTABLEg_t_lfa1
WHERElifnrINr_lifnr.
ELSE. "<-insert
* "/Lieferanten-KurztexteinBloeckeneinlesen "<-insert
DO. "<-insert
* "/Bloeckezuje50Leferantenbilden "<-insert
REFRESHlr_lifnr. "<-insert
LOOPATr_lifnrFROMl_cnt_fromTOl_cnt_to. "<-insert
lr_lifnr=r_lifnr. "<-insert
APPENDlr_lifnr. "<-insert
ENDLOOP. "<-insert
IFsy-subrcNE0. "<-insert
EXIT. "<-insert
ENDIF. "<-insert
l_cnt_from=l_cnt_to +1. "<-insert
l_cnt_to =l_cnt_from+50. "<-insert
* "/Lieferanten-Kurztextelesen "<-insert
SELECTlifnrsortlFROMlfa1 "<-insert
APPENDINGCORRESPONDINGFIELDS "<-insert
OFTABLEg_t_lfa1 "<-insert
WHERElifnrINlr_lifnr. "<-insert
ENDDO. "<-insert
ENDIF. "<-insert
ENDIF.
*"/LesenDebitoren-TexteausStammdaten-Tabelle
IFNOTr_kunnrISINITIAL.
LOOPATr_kunnrWHERElow='*'.
DELETEr_kunnr.
ENDLOOP.
DESCRIBETABLEr_kunnrLINESl_cnt_lines. "<-insert
IFl_cnt_lines<=50. "<-insert
* "/Kunden-Kurztexteaufeinmaleinlesen "<-insert
SELECTkunnrsortlFROMkna1
INTOCORRESPONDINGFIELDSOFTABLEg_t_kna1
WHEREkunnrINr_kunnr.
ELSE. "<-insert
* "/Kunden-KurztexteinBloeckeneinlesen "<-insert
DO. "<-insert
* "/Bloeckezuje50Kundenbilden "<-insert
REFRESHlr_kunnr. "<-insert
LOOPATr_kunnrFROMl_cnt_fromTOl_cnt_to. "<-insert
lr_kunnr=r_kunnr. "<-insert
APPENDlr_kunnr. "<-insert
ENDLOOP. "<-insert
IFsy-subrcNE0. "<-insert
EXIT. "<-insert
ENDIF. "<-insert
l_cnt_from=l_cnt_to +1. "<-insert
l_cnt_to =l_cnt_from+50. "<-insert
* "/Kunden-Kurztextelesen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 现金流 量表 报表 开发 源代码
![提示](https://static.bdocx.com/images/bang_tan.gif)