您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 资本运营 > ABAP实现本地化的资产负债表和损益表
ABAP实现本地化的资产负债表和损益表1.设计思路:SAP没有提供标准的符合中国标准的资产负债表和损益表,需要我们在系统中自定义开发,我们在配置报表版本时都指定了一个项目的编号,一个版本下面都有期其统驭的科目范围,我们可以根据这个项目编号找到相应的科目范围,然后根据科目范围获取科目借贷汇总的值。SAP中资产负债表的配置图示:我们传统的资产负债表如下格式:我们可以在程序中用项目编号找到其下面的科目范围,然后取科目汇总值,因为资产负债表是固定的,所以我们要建立一个CBO表来存放各个具体的项目和在SAP中对应的项目编号。最后要强调的是在资产负债表中未分配利润的计算:未分配利润的期末余额=年初结转额(留存收益的上年余额)+今年截至到本月的盈利额(利润表中有体现)利润表的思路和资产负债表是一样的。具体的代码实现:*&———————————————————————**&CompanyCode:N207*&module:FI*&createby:rrzhang*&createdate:2011.12.28*&———————————————————————**&title:资产负债表,利润表*&Description:资产负债表,利润表报表呈现*&———————————————————————**&ChangeHistory*———————————————————————-**C.RNo|Date|Developer|Description*———————————————————————-**2012.01.11|ccyu*———————————————————————-*REPORTzfir00026.INCLUDEzfir00026_top.INCLUDEzfir00026_cls.INCLUDEzfir00026_f01.INCLUDEzfir00026_o01.INCLUDEzfir00026_i01.INCLUDEicon.INITIALIZATION.p_y=sy-datum+0(4).p_m=sy-datum+4(2).ATSELECTION-SCREENOUTPUT.PERFORMsetdisUSINGp_rpv.IFcISINITIAL.PERFORMsetlist.gv_name=‘爱思开实业(上海)商贸有限公司合并财务报表版本’.c=‘X’.gv_rp=‘资产负债表’.ELSE.PERFORMsetpcgUSINGp_rpv.CASEp_rpv.WHEN‘2070′.gv_name=‘爱思开实业(上海)商贸有限公司合并财务报表版本’.WHEN‘2071′.gv_name=‘爱思开实业(上海)商贸有限公总部财务报表版本’.WHEN‘2072′.gv_name=‘爱思开实业(上海)商贸有限公司直营店财务报表版本’.WHEN‘2073′.gv_name=”.ENDCASE.IFp_rp=‘BS’.gv_rp=‘资产负债表’.ELSE.gv_rp=‘利润表’.ENDIF.ENDIF.START-OF-SELECTION.PERFORMsynchrodata.PERFORMget_data1.*&———————————————————————**&IncludeZFIR00026_TOP*&———————————————————————**DatadefinitionTYPE-POOLSvrm.TABLES:faglflexa.“同步数据用的凭证抬头表DATA:BEGINOFgt_bkpfsynOCCURS0,gjahrLIKEbkpf-gjahr,bukrsLIKEbkpf-bukrs,belnrLIKEbkpf-belnr,ENDOFgt_bkpfsyn.DATAly(4)TYPEn.“同步数据用的凭证行项目表(bseg)DATA:BEGINOFgt_bsegsynOCCURS0,gjahrLIKEbseg-gjahr,bukrsLIKEbseg-bukrs,belnrLIKEbseg-belnr,prctrLIKEbseg-prctr,pprctLIKEbseg-pprct,buzeiLIKEbseg-buzei,ENDOFgt_bsegsyn.DATA:BEGINOFgt_fagasynOCCURS0.INCLUDESTRUCTUREfaglflexa.DATA:ENDOFgt_fagasyn.TYPES:ch(3)TYPEc,cf(4)TYPEc,cgcp(12)TYPEc,ok_codeLIKEsy-ucomm.DATA:c,d,gv_bsTYPEukurs_currVALUE1,”倍数gv_iden(2).“要显示的资产负债表DATA:BEGINOFgt_alv_bs0OCCURS0,lct1TYPEint1,item1TYPEzitem,yamt1TYPEhslvt12,ysamt1TYPEhslvt12,lct2TYPEint1,item2TYPEzitem,yamt2TYPEhslvt12,ysamt2TYPEhslvt12,waersLIKEt001-waers,ENDOFgt_alv_bs0.DATA:BEGINOFgt_bsOCCURS0,ukursTYPEukurs_curr,gdatuTYPEgdatu_inv,ENDOFgt_bs.DATA:gv_mf(5).”Themonthfield*Thereportversionaccountinformation.“要显示的利润表DATA:BEGINOFgt_alv_is0OCCURS0,lctTYPEint1,itemTYPEzitem,yamtLIKEfaglflext-hslvt,”本年累计数mamtLIKEfaglflext-hslvt,”本月累计数waersLIKEt001-waers,ENDOFgt_alv_is0.“下载数据的内表DATA:BEGINOFgt_alv_is01OCCURS0,lctTYPEint1,itemTYPEzitem,yamtLIKEfaglflext-hslvt,”本年累计数mamtLIKEfaglflext-hslvt,”本月累计数ENDOFgt_alv_is01.*利润表下钻数据内表*–2012.01.16CCYUSTARTDATA:BEGINOFgt_skatOCCURS0,saknrLIKEskat-saknr,txt50LIKEskat-txt50,ENDOFgt_skat.*–2012.01.16CCYUEND.DATA:BEGINOFgt_alv_is_dp1OCCURS0,racctLIKEfaglflexa-racct,*–2012.01.16CCYUSTARTtxt50LIKEskat-txt50,*–2012.01.16CCYUEND.hslLIKEfaglflexa-hsl,ENDOFgt_alv_is_dp1.*利润表下钻数据内表DATA:BEGINOFgt_alv_bs_dp1OCCURS0,racctLIKEfaglflexa-racct,*–2012.01.16CCYUSTARTtxt50LIKEskat-txt50,*–2012.01.16CCYUEND.hslLIKEfaglflexa-hsl,ENDOFgt_alv_bs_dp1.DATA:BEGINOFgt_alv_bs_dp2OCCURS0,racctLIKEfaglflexa-racct,*–2012.01.16CCYUSTARTtxt50LIKEskat-txt50,*–2012.01.16CCYUEND.hslLIKEfaglflexa-hsl,ENDOFgt_alv_bs_dp2.TYPES:BEGINOFgs_alv_bs_dp_obj,racctLIKEfaglflexa-racct,*–2012.01.16CCYUSTARTtxt50LIKEskat-txt50,*–2012.01.16CCYUEND.hslLIKEfaglflexa-hsl,ENDOFgs_alv_bs_dp_obj.DATA:gs_alv_bs_dp_obj1TYPEgs_alv_bs_dp_obj.TYPES:gt_alv_bs_dpTYPESTANDARDTABLEOFgs_alv_bs_dp_obj.*利润表下钻临时数据内表DATA:BEGINOFgt_alv_is_dp2OCCURS0,racctLIKEfaglflexa-racct,*–2012.01.16CCYUSTARTtxt50LIKEskat-txt50,*–2012.01.16CCYUEND.hslLIKEfaglflexa-hsl,ENDOFgt_alv_is_dp2.DATA:BEGINOFgt_fagl_011zcOCCURS0,versnLIKEfagl_011zc-versn,ergslLIKEfagl_011zc-ergsl,txt45LIKEfagl_011qt-txt45,vonktLIKEfagl_011zc-vonkt,bisktLIKEfagl_011zc-biskt,ENDOFgt_fagl_011zc.DATA:BEGINOFgt_fagl_011qtOCCURS0,ergslLIKEfagl_011qt-ergsl,txt45LIKEfagl_011qt-txt45,ENDOFgt_fagl_011qt.DATA:BEGINOFgt_mamt_isOCCURS0,amtLIKEfaglflext-hslvt,ENDOFgt_mamt_is.RANGESgr_actFORfaglflext-racct.DATA:BEGINOFgt_monvOCCURS0,month(2)TYPEn,valueLIKEfaglflext-hslvt,ENDOFgt_monv.DATA:BEGINOFgs_hsl,hsl01LIKEfaglflext-hslvt,hsl02LIKEfaglflext-hslvt,hsl03LIKEfaglflext-hslvt,hsl04LIKEfaglflext-hslvt,hsl05LIKEfaglflext-hslvt,hsl06LIKEfaglflext-hslvt,hsl07LIKEfaglflext-hslvt,hsl08LIKEfaglflext-hslvt,hsl09LIKEfaglflext-hslvt,hsl10LIKEfaglflext-hslvt,hsl11LIKEfaglflext-hslvt,hsl12LIKEfaglflext-hslvt,ENDOFgs_hsl.DATA:BEGINOFgs_hsl1,hsl01LIKEfaglflext-hslvt,hsl02LIKEfaglflext-hslvt,hsl03LIKEfaglflext-hslvt,hsl04LIKEfaglflext-hslvt,hsl05LIKEfaglflext-hslvt,hsl06LIKEfaglflext-hslvt,hsl07LIKEfaglflext-hslvt,hsl08LIKEfaglflext-hslvt,hsl09LIKEfaglflext-hslvt,hsl10LIKEfaglflext-hslvt,hsl11LIKEfaglflext-hslvt,hsl12LIKEfaglflext-hslvt,hslvtLIKEfaglflext-hslvt,ENDOFgs_hsl1.DATA:gs_alv_isTYPEREFTOcl_gui_alv_grid,”thealvobjectforisreportgs_alv_bsTYPEREFTOcl_gui_alv_grid,”thealvobjectforbsreportgs_alv_is_dp1TYPEREFTOcl_gui_alv_grid,”thealvobjectforbsreportgs_alv_bs_dp1TYPE
本文标题:ABAP实现本地化的资产负债表和损益表
链接地址:https://www.777doc.com/doc-1203112 .html