利润表
*********************************************************************
* PROGRAM NAME : 利润表 or 损益表(新会计制度) *
* APPLICATION NAME : FI *
* SUBSYSTEM : GL *
* AUTHOR : ZHJ *
* TRANSACTION : ZFIR004N *
* Program type : Report & Layout *
* SAP RELEASE : 4.7 *
* PROGRAM DESCRIPTION : 损益表(新会计制度) *
*********************************************************************
* REVISION LOG *
* LOG# DATE AUTHOR DESCRIPTION *
* ---- ------- -------- ----------- *
* 0000 01/11/2007 ZHJ 利润表 or 损益表 *
*********************************************************************
REPORT ZFIR004 NO STANDARD PAGE HEADING MESSAGE-ID 00
LINE-COUNT 90 LINE-SIZE 120.
TABLES : T001,
T001W,
GLFUNCT,
GLT0.
* data declaration
*****myjtab: 上 年 数**itabs:本 年 数****jtab:本月数***********
DATA: BEGIN OF ITABS OCCURS 10.
DATA: YYSR LIKE GLT0-HSLVT, "营业收入
YYCB LIKE GLT0-HSLVT, "营业成本
YYSJ LIKE GLT0-HSLVT, "营业税金及附加
XSFY LIKE GLT0-HSLVT, "销售费用
GLFY LIKE GLT0-HSLVT, "管理费用
* 20181029 insert amber s
YFFY LIKE GLT0-HSLVT, "研发费用
LXFY LIKE GLT0-HSLVT, "利息费用
LXSR LIKE GLT0-HSLVT, "利息收入
* 20181029 insert amber e
CWFY LIKE GLT0-HSLVT, "财务费用
ZCJZSS LIKE GLT0-HSLVT, "资产减值损失
GYJZBD LIKE GLT0-HSLVT, "公允价值变动收益
TZSY LIKE GLT0-HSLVT, "投资收益
QTSY LIKE GLT0-HSLVT, "其他收益 wjb
ZCCZSY LIKE GLT0-HSLVT, "资产处置收益 wjb
LYTZSY LIKE GLT0-HSLVT, "对联营企业和合营企业的投资收益
YYLR LIKE GLT0-HSLVT, "营业利润
YYWSR LIKE GLT0-HSLVT, "营业外收入
YYWZC LIKE GLT0-HSLVT, "营业外支出
FLDCZ LIKE GLT0-HSLVT, "非流动资产处置损失
LRZE LIKE GLT0-HSLVT, "利润总额
SDSFY LIKE GLT0-HSLVT, "所得税费用
JLR LIKE GLT0-HSLVT, "净利润
JBMGSY LIKE GLT0-HSLVT, "基本每股收益
RTCUR LIKE GLT0-RTCUR. "货币
DATA: END OF ITABS.
DATA: JTAB LIKE ITABS OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF ITAB OCCURS 10.
INCLUDE STRUCTURE GLT0.
DATA: TAMOUNT LIKE GLT0-HSLVT, "本年累计数
CAMOUNT LIKE GLT0-HSLVT. "本月数
DATA: END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 10.
INCLUDE STRUCTURE GLFUNCT.
DATA: TAMOUNT LIKE GLT0-HSLVT, "本年累计数
CAMOUNT LIKE GLT0-HSLVT. "本月数
DATA: END OF ITAB1.
DATA: P_RTCUR LIKE GLT0-RTCUR.
DATA: I_XSFY(22),I_GLFY(22),I_CWFY(22),I_YYLR(22),I_TZSY(22),
I_LRZE(22),I_JLR(22),I_GYJZBD(22),I_LYTZSY(22),I_QTSY(22),I_ZCCZSY(22),
* 20190102 AMBER ADD S
I_ZCJZSS(22),
I_SDSFY(22),
* 20190102 AMBER ADD E
* 20181029 AMBER ADD S
I_YFFY(22),
I_LXFY(22),
I_LXSR(22)
* 20181029 AMBER ADD E
.
DATA: J_XSFY(22),J_GLFY(22),J_CWFY(22),J_YYLR(22),J_TZSY(22),J_QTSY(22),J_ZCCZSY(22),
J_LRZE(22),J_JLR(22),J_GYJZBD(22),J_LYTZSY(22),
* 20190102 AMBER ADD S
J_ZCJZSS(22),
J_SDSFY(22),
* 20190102 AMBER ADD E
* 20181029 AMBER ADD S
J_YFFY(22),
J_LXFY(22),
J_LXSR(22)
* 20181029 AMBER ADD E
.
DATA: TMP(21),
ILEN1 TYPE I,
ILEN2 TYPE I,
ILEN3 TYPE I,
ILEN4 TYPE I,
ILEN5 TYPE I,
ILEN6 TYPE I,
ILEN7 TYPE I,
ILEN8 TYPE I,
ILEN9 TYPE I,
ILEN10 TYPE I,"wjb
ILEN11 TYPE I,"wjb
* 20181029 AMBER ADD S
ILEN12 TYPE I,
ILEN13 TYPE I,
ILEN14 TYPE I,
* 20181029 AMBER ADD E
* 20190102 AMBER ADD S
ILEN15 TYPE I,
ILEN16 TYPE I,
* 20190102 AMBER ADD E
JLEN1 TYPE I,
JLEN2 TYPE I,
JLEN3 TYPE I,
JLEN4 TYPE I,
JLEN5 TYPE I,
JLEN6 TYPE I,
JLEN7 TYPE I,
JLEN8 TYPE I,
JLEN9 TYPE I,
JLEN10 TYPE I,"wjb
JLEN11 TYPE I,"wjb
* 20181029 AMBER ADD S
JLEN12 TYPE I,
JLEN13 TYPE I,
JLEN14 TYPE I,
* 20181029 AMBER ADD E
* 20190102 AMBER ADD S
JLEN15 TYPE I,
JLEN16 TYPE I,
* 20190102 AMBER ADD E
TYEAR(4) TYPE P,
E_DAY(2),
P_LEN TYPE I,
P_MOD TYPE I.
**************************************************************
* selection screen *
**************************************************************
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: BUKRS LIKE GLT0-BUKRS OBLIGATORY DEFAULT '1100'.
PARAMETERS: RYEAR(4) TYPE C OBLIGATORY DEFAULT SY-DATUM+0(4).
PARAMETERS: PERID(2) TYPE C OBLIGATORY DEFAULT SY-DATUM+4(2).
SELECT-OPTIONS: RBUSA FOR GLT0-RBUSA.
SELECTION-SCREEN END OF BLOCK BLK1.
TYEAR = RYEAR - 1.
*权限检查
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'Z_FI_BUKRS'
ID 'BUKRS' FIELD BUKRS.
IF SY-SUBRC NE 0 .
MESSAGE E000(00) WITH BUKRS '公司代码中没有权限!'.
ELSE.
IF BUKRS = '1100'.
*add***********************
DATA:BEGIN OF IT_TAB OCCURS 0,
RBUSA LIKE GLT0-RBUSA,
END OF IT_TAB.
CLEAR IT_TAB.REFRESH IT_TAB.
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE IT_TAB
FROM GLT0
WHERE RBUSA IN RBUSA.
SORT IT_TAB BY RBUSA.
DELETE ADJACENT DUPLICATES FROM IT_TAB COMPARING RBUSA.
LOOP AT IT_TAB.
*end add*******************
AUTHORITY-CHECK OBJECT 'Z_FI_GSBER'
ID 'GSBER' FIELD IT_TAB-RBUSA.
IF SY-SUBRC NE 0 .
MESSAGE E000(00) WITH IT_TAB-RBUSA '业务范围中没有权限!'.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
***********************
* initialization *
INITIALIZATION .
********Report header*******************************
TOP-OF-PAGE.
PERFORM WRITE_REPORT_HEADER.
******Get Data and Process Data*********************
START-OF-SELECTION.
PERFORM CAL_DAY.
PERFORM AUTHRIZATION.
PERFORM GET_DATA.
PERFORM GET_GY_DATA. "营业费用和管理费用
*货币
SELECT SINGLE RTCUR FROM GLT0
INTO P_RTCUR WHERE BUKRS = BUKRS.
*add 3.8.2005 当为2005年1,2月时本年累计数硬写进去,
PERFORM PROCESS_DATA.
*end add 3.8.2005
PERFORM SUBTOTAL.
**********Output Data*******************************
PERFORM WRITE_BS.
PERFORM WRITE_REPORT_ENDER.
*PERFORM CALL_FUNCTION.
*&---------------------------------------------------------------------*
*& Form suntotal
*&---------------------------------------------------------------------*
FORM SUBTOTAL.
ITABS-YYSR = ITABS-YYSR * -1.
ITABS-GYJZBD = ITABS-GYJZBD * -1.
ITABS-TZSY = ITABS-TZSY * -1.
ITABS-QTSY = ITABS-QTSY * -1.
ITABS-ZCCZSY = ITABS-ZCCZSY * -1.
ITABS-LYTZSY = ITABS-LYTZSY * -1.
ITABS-YYWSR = ITABS-YYWSR * -1.
JTAB-YYSR = JTAB-YYSR * -1.
JTAB-QTSY = JTAB-QTSY * -1.
JTAB-ZCCZSY = JTAB-ZCCZSY * -1.
JTAB-GYJZBD = JTAB-GYJZBD * -1.
JTAB-TZSY = JTAB-TZSY * -1.
JTAB-LYTZSY = JTAB-LYTZSY * -1.
JTAB-YYWSR = JTAB-YYWSR * -1.
ITABS-YYLR = ITABS-YYSR - ITABS-YYCB - ITABS-YYSJ - ITABS-XSFY - ITABS-GLFY
* 20181029 AMBER ADD S
- ITABS-YFFY
* 20181029 AMBER ADD E
- ITABS-CWFY - ITABS-ZCJZSS + ITABS-GYJZBD + ITABS-TZSY + ITABS-QTSY + ITABS-ZCCZSY.
ITABS-LRZE = ITABS-YYLR + ITABS-YYWSR - ITABS-YYWZC.
ITABS-JLR = ITABS-LRZE - ITABS-SDSFY.
MODIFY ITABS INDEX SY-TABIX.
JTAB-YYLR = JTAB-YYSR - JTAB-YYCB - JTAB-YYSJ - JTAB-XSFY - JTAB-GLFY
* 20181029 AMBER ADD S
- JTAB-YFFY
* 20181029 AMBER ADD E
- JTAB-CWFY - JTAB-ZCJZSS + JTAB-GYJZBD + JTAB-TZSY + JTAB-QTSY + JTAB-ZCCZSY.
JTAB-LRZE = JTAB-YYLR + JTAB-YYWSR - JTAB-YYWZC.
JTAB-JLR = JTAB-LRZE - JTAB-SDSFY.
MODIFY JTAB INDEX SY-TABIX.
* 20181107 AMBER ADD S
IF P_RTCUR = 'KRW'.
JTAB-XSFY = JTAB-XSFY * 100 .
ITABS-XSFY = ITABS-XSFY * 100 .
JTAB-GLFY = JTAB-GLFY * 100 .
ITABS-GLFY = ITABS-GLFY * 100 .
JTAB-CWFY = JTAB-CWFY * 100 .
ITABS-CWFY = ITABS-CWFY * 100 .
JTAB-GYJZBD = JTAB-GYJZBD * 100 .
ITABS-GYJZBD = ITABS-GYJZBD * 100 .
JTAB-TZSY = JTAB-TZSY * 100 .
ITABS-TZSY = ITABS-TZSY * 100 .
JTAB-QTSY = JTAB-QTSY * 100 .
ITABS-QTSY = ITABS-QTSY * 100 .
JTAB-ZCCZSY = JTAB-ZCCZSY * 100 ."add by wjb
ITABS-ZCCZSY = ITABS-ZCCZSY * 100 ."add by wjb
JTAB-LYTZSY = JTAB-LYTZSY * 100 .
ITABS-LYTZSY = ITABS-LYTZSY * 100 .
JTAB-YYLR = JTAB-YYLR * 100 .
ITABS-YYLR = ITABS-YYLR * 100 .
JTAB-LRZE = JTAB-LRZE * 100 .
ITABS-LRZE = ITABS-LRZE * 100 .
JTAB-JLR = JTAB-JLR * 100 .
ITABS-JLR = ITABS-JLR * 100 .
JTAB-YFFY = JTAB-YFFY * 100 .
ITABS-YFFY = ITABS-YFFY * 100 .
JTAB-LXFY = JTAB-LXFY * 100 .
ITABS-LXFY = ITABS-LXFY * 100 .
JTAB-LXSR = JTAB-LXSR * 100 .
ITABS-LXSR = ITABS-LXSR * 100 .
ITABS-YYSR = ITABS-YYSR * 100 .
ITABS-YYCB = ITABS-YYCB * 100 .
ITABS-YYSJ = ITABS-YYSJ * 100 .
ITABS-ZCJZSS = ITABS-ZCJZSS * 100 .
ITABS-YYWSR = ITABS-YYWSR * 100 .
ITABS-YYWZC = ITABS-YYWZC * 100 .
ITABS-FLDCZ = ITABS-FLDCZ * 100 .
ITABS-SDSFY = ITABS-SDSFY * 100 .
ITABS-JBMGSY = ITABS-JBMGSY * 100 .
JTAB-YYSR = JTAB-YYSR * 100 .
JTAB-YYCB = JTAB-YYCB * 100 .
JTAB-YYSJ = JTAB-YYSJ * 100 .
JTAB-ZCJZSS = JTAB-ZCJZSS * 100 .
JTAB-YYWSR = JTAB-YYWSR * 100 .
JTAB-YYWZC = JTAB-YYWZC * 100 .
JTAB-FLDCZ = JTAB-FLDCZ * 100 .
JTAB-SDSFY = JTAB-SDSFY * 100 .
JTAB-JBMGSY = JTAB-JBMGSY * 100 .
ELSE.
ENDIF.
* 20181107 AMBER ADD E
IF JTAB-XSFY < 0.
JTAB-XSFY = ABS( JTAB-XSFY ).
WRITE JTAB-XSFY TO TMP.
CONCATENATE '-' TMP INTO J_XSFY.
ELSE.
WRITE JTAB-XSFY TO J_XSFY.
ENDIF.
CONDENSE J_XSFY NO-GAPS.
JLEN1 = 70 - STRLEN( J_XSFY ).
IF JTAB-GLFY < 0.
JTAB-GLFY = ABS( JTAB-GLFY ).
WRITE JTAB-GLFY TO TMP.
CONCATENATE '-' TMP INTO J_GLFY.
ELSE.
WRITE JTAB-GLFY TO J_GLFY.
ENDIF.
CONDENSE J_GLFY NO-GAPS.
JLEN2 = 70 - STRLEN( J_GLFY ).
IF JTAB-CWFY < 0.
JTAB-CWFY = ABS( JTAB-CWFY ).
WRITE JTAB-CWFY TO TMP.
CONCATENATE '-' TMP INTO J_CWFY.
ELSE.
WRITE JTAB-CWFY TO J_CWFY .
ENDIF.
CONDENSE J_CWFY NO-GAPS.
JLEN3 = 70 - STRLEN( J_CWFY ).
IF JTAB-YYLR < 0.
JTAB-YYLR = ABS( JTAB-YYLR ).
WRITE JTAB-YYLR TO TMP.
CONCATENATE '-' TMP INTO J_YYLR.
ELSE.
WRITE JTAB-YYLR TO J_YYLR.
ENDIF.
CONDENSE J_YYLR NO-GAPS.
JLEN4 = 70 - STRLEN( J_YYLR ).
IF JTAB-TZSY < 0.
JTAB-TZSY = ABS( JTAB-TZSY ).
WRITE JTAB-TZSY TO TMP.
CONCATENATE '-' TMP INTO J_TZSY.
ELSE.
WRITE JTAB-TZSY TO J_TZSY.
ENDIF.
CONDENSE J_TZSY NO-GAPS.
JLEN5 = 70 - STRLEN( J_TZSY ).
*************wjb******
IF JTAB-QTSY < 0.
JTAB-QTSY = ABS( JTAB-QTSY ).
WRITE JTAB-QTSY TO TMP.
CONCATENATE '-' TMP INTO J_QTSY.
ELSE.
WRITE JTAB-QTSY TO J_QTSY.
ENDIF.
CONDENSE J_QTSY NO-GAPS.
JLEN10 = 70 - STRLEN( J_QTSY ).
*************wjb******
*************wjb******
IF JTAB-ZCCZSY < 0.
JTAB-ZCCZSY = ABS( JTAB-ZCCZSY ).
WRITE JTAB-ZCCZSY TO TMP.
CONCATENATE '-' TMP INTO J_ZCCZSY.
ELSE.
WRITE JTAB-ZCCZSY TO J_ZCCZSY.
ENDIF.
CONDENSE J_ZCCZSY NO-GAPS.
JLEN11 = 70 - STRLEN( J_ZCCZSY ).
*************wjb******
* 20181029 AMBER ADD S
* 研发费用
IF JTAB-YFFY < 0.
JTAB-YFFY = ABS( JTAB-YFFY ).
WRITE JTAB-YFFY TO TMP.
CONCATENATE '-' TMP INTO J_YFFY.
ELSE.
WRITE JTAB-YFFY TO J_YFFY.
ENDIF.
CONDENSE J_YFFY NO-GAPS.
JLEN12 = 70 - STRLEN( J_YFFY ).
* 利息费用
IF JTAB-LXFY < 0.
JTAB-LXFY = ABS( JTAB-LXFY ).
WRITE JTAB-LXFY TO TMP.
CONCATENATE '-' TMP INTO J_LXFY.
ELSE.
WRITE JTAB-LXFY TO J_LXFY.
ENDIF.
CONDENSE J_LXFY NO-GAPS.
JLEN13 = 70 - STRLEN( J_LXFY ).
* 利息收入
IF JTAB-LXSR < 0.
JTAB-LXSR = ABS( JTAB-LXSR ).
"20190430 取消利息收入数字前的负号 MZG S
* WRITE JTAB-LXSR TO TMP.
* CONCATENATE '-' TMP INTO J_LXSR.
WRITE JTAB-LXSR TO J_LXSR.
"20190430 取消利息收入数字前的负号 MZG E
ELSE.
WRITE JTAB-LXSR TO J_LXSR.
ENDIF.
CONDENSE J_LXSR NO-GAPS.
JLEN14 = 70 - STRLEN( J_LXSR ).
* 20181029 AMBER ADD E
* 20190102 AMBER ADD S
* 资产减值损失
IF JTAB-ZCJZSS < 0.
JTAB-ZCJZSS = ABS( JTAB-ZCJZSS ).
WRITE JTAB-ZCJZSS TO TMP.
CONCATENATE '-' TMP INTO J_ZCJZSS.
ELSE.
WRITE JTAB-ZCJZSS TO J_ZCJZSS.
ENDIF.
CONDENSE J_ZCJZSS NO-GAPS.
JLEN15 = 70 - STRLEN( J_ZCJZSS ).
* 所得税费用
IF JTAB-SDSFY < 0.
JTAB-SDSFY = ABS( JTAB-SDSFY ).
WRITE JTAB-SDSFY TO TMP.
CONCATENATE '-' TMP INTO J_SDSFY.
ELSE.
WRITE JTAB-SDSFY TO J_SDSFY.
ENDIF.
CONDENSE J_SDSFY NO-GAPS.
JLEN16 = 70 - STRLEN( J_SDSFY ).
* 20190102 AMBER ADD E
IF JTAB-LRZE < 0.
JTAB-LRZE = ABS( JTAB-LRZE ).
WRITE JTAB-LRZE TO TMP.
CONCATENATE '-' TMP INTO J_LRZE.
ELSE.
WRITE JTAB-LRZE TO J_LRZE.
ENDIF.
CONDENSE J_LRZE NO-GAPS.
JLEN6 = 70 - STRLEN( J_LRZE ).
IF JTAB-JLR < 0.
JTAB-JLR = ABS( JTAB-JLR ).
WRITE JTAB-JLR TO TMP.
CONCATENATE '-' TMP INTO J_JLR.
ELSE.
WRITE JTAB-JLR TO J_JLR.
ENDIF.
CONDENSE J_JLR NO-GAPS.
JLEN7 = 70 - STRLEN( J_JLR ).
IF JTAB-GYJZBD < 0.
JTAB-GYJZBD = ABS( JTAB-GYJZBD ).
WRITE JTAB-GYJZBD TO TMP.
CONCATENATE '-' TMP INTO J_GYJZBD.
ELSE.
WRITE JTAB-GYJZBD TO J_GYJZBD.
ENDIF.
CONDENSE J_GYJZBD NO-GAPS.
JLEN8 = 70 - STRLEN( J_GYJZBD ).
IF JTAB-LYTZSY < 0.
JTAB-LYTZSY = ABS( JTAB-LYTZSY ).
WRITE JTAB-LYTZSY TO TMP.
CONCATENATE '-' TMP INTO J_LYTZSY.
ELSE.
WRITE JTAB-LYTZSY TO J_LYTZSY.
ENDIF.
CONDENSE J_LYTZSY NO-GAPS.
JLEN9 = 70 - STRLEN( J_LYTZSY ).
IF ITABS-XSFY < 0.
ITABS-XSFY = ABS( ITABS-XSFY ).
WRITE ITABS-XSFY TO TMP.
CONCATENATE '-' TMP INTO I_XSFY.
ELSE.
WRITE ITABS-XSFY TO I_XSFY.
ENDIF.
CONDENSE I_XSFY NO-GAPS.
ILEN1 = 105 - STRLEN( I_XSFY ).
IF ITABS-GLFY < 0.
ITABS-GLFY = ABS( ITABS-GLFY ).
WRITE ITABS-GLFY TO TMP.
CONCATENATE '-' TMP INTO I_GLFY.
ELSE.
WRITE ITABS-GLFY TO I_GLFY.
ENDIF.
CONDENSE I_GLFY NO-GAPS.
ILEN2 = 105 - STRLEN( I_GLFY ).
IF ITABS-CWFY < 0.
ITABS-CWFY = ABS( ITABS-CWFY ).
WRITE ITABS-CWFY TO TMP.
CONCATENATE '-' TMP INTO I_CWFY.
ELSE.
WRITE ITABS-CWFY TO I_CWFY.
ENDIF.
CONDENSE I_CWFY NO-GAPS.
ILEN3 = 105 - STRLEN( I_CWFY ).
IF ITABS-YYLR < 0.
ITABS-YYLR = ABS( ITABS-YYLR ).
WRITE ITABS-YYLR TO TMP.
CONCATENATE '-' TMP INTO I_YYLR.
ELSE.
WRITE ITABS-YYLR TO I_YYLR.
ENDIF.
CONDENSE I_YYLR NO-GAPS.
ILEN4 = 105 - STRLEN( I_YYLR ).
IF ITABS-TZSY < 0.
ITABS-TZSY = ABS( ITABS-TZSY ).
WRITE ITABS-TZSY TO TMP.
CONCATENATE '-' TMP INTO I_TZSY.
ELSE.
WRITE ITABS-TZSY TO I_TZSY.
ENDIF.
CONDENSE I_TZSY NO-GAPS.
ILEN5 = 105 - STRLEN( I_TZSY ).
*******************************wjb***********
IF ITABS-QTSY < 0.
ITABS-QTSY = ABS( ITABS-QTSY ).
WRITE ITABS-QTSY TO TMP.
CONCATENATE '-' TMP INTO I_QTSY.
ELSE.
WRITE ITABS-QTSY TO I_QTSY.
ENDIF.
CONDENSE I_QTSY NO-GAPS.
ILEN10 = 105 - STRLEN( I_QTSY ).
*********************************************
*******************************wjb***********
IF ITABS-ZCCZSY < 0.
ITABS-ZCCZSY = ABS( ITABS-ZCCZSY ).
WRITE ITABS-ZCCZSY TO TMP.
CONCATENATE '-' TMP INTO I_ZCCZSY.
ELSE.
WRITE ITABS-ZCCZSY TO I_ZCCZSY.
ENDIF.
CONDENSE I_ZCCZSY NO-GAPS.
ILEN11 = 105 - STRLEN( I_ZCCZSY ).
***********************************************
* 20181029 AMBER ADD S
* 研发费用
IF ITABS-YFFY < 0.
ITABS-YFFY = ABS( ITABS-YFFY ).
WRITE ITABS-YFFY TO TMP.
CONCATENATE '-' TMP INTO I_YFFY.
ELSE.
WRITE ITABS-YFFY TO I_YFFY.
ENDIF.
CONDENSE I_YFFY NO-GAPS.
ILEN12 = 105 - STRLEN( I_YFFY ).
* 利息费用
IF ITABS-LXFY < 0.
ITABS-LXFY = ABS( ITABS-LXFY ).
WRITE ITABS-LXFY TO TMP.
CONCATENATE '-' TMP INTO I_LXFY.
ELSE.
WRITE ITABS-LXFY TO I_LXFY.
ENDIF.
CONDENSE I_LXFY NO-GAPS.
ILEN13 = 105 - STRLEN( I_LXFY ).
* 利息收入
IF ITABS-LXSR < 0.
ITABS-LXSR = ABS( ITABS-LXSR ).
"20190430 取消利息收入数字前的负号 MZG S
* WRITE ITABS-LXSR TO TMP.
* CONCATENATE '-' TMP INTO I_LXSR.
WRITE ITABS-LXSR TO I_LXSR.
"20190430 取消利息收入数字前的负号 MZG E
ELSE.
WRITE ITABS-LXSR TO I_LXSR.
ENDIF.
CONDENSE I_LXSR NO-GAPS.
ILEN14 = 105 - STRLEN( I_LXSR ).
* 20181029 AMBER ADD E
* 20190102 AMBER ADD S
* 资产减值损失
IF ITABS-ZCJZSS < 0.
ITABS-ZCJZSS = ABS( ITABS-ZCJZSS ).
WRITE ITABS-ZCJZSS TO TMP.
CONCATENATE '-' TMP INTO I_ZCJZSS.
ELSE.
WRITE ITABS-ZCJZSS TO I_ZCJZSS.
ENDIF.
CONDENSE I_ZCJZSS NO-GAPS.
ILEN15 = 105 - STRLEN( I_ZCJZSS ).
* 所得税费用
IF ITABS-SDSFY < 0.
ITABS-SDSFY = ABS( ITABS-SDSFY ).
WRITE ITABS-SDSFY TO TMP.
CONCATENATE '-' TMP INTO I_SDSFY.
ELSE.
WRITE ITABS-SDSFY TO I_SDSFY.
ENDIF.
CONDENSE I_SDSFY NO-GAPS.
ILEN16 = 105 - STRLEN( I_SDSFY ).
* 20190102 AMBER ADD E
IF ITABS-LRZE < 0.
ITABS-LRZE = ABS( ITABS-LRZE ).
WRITE ITABS-LRZE TO TMP.
CONCATENATE '-' TMP INTO I_LRZE.
ELSE.
WRITE ITABS-LRZE TO I_LRZE.
ENDIF.
CONDENSE I_LRZE NO-GAPS.
ILEN6 = 105 - STRLEN( I_LRZE ).
IF ITABS-JLR < 0.
ITABS-JLR = ABS( ITABS-JLR ).
WRITE ITABS-JLR TO TMP.
CONCATENATE '-' TMP INTO I_JLR.
ELSE.
WRITE ITABS-JLR TO I_JLR.
ENDIF.
CONDENSE I_JLR NO-GAPS.
ILEN7 = 105 - STRLEN( I_JLR ).
IF ITABS-GYJZBD < 0.
ITABS-GYJZBD = ABS( ITABS-GYJZBD ).
WRITE ITABS-GYJZBD TO TMP.
CONCATENATE '-' TMP INTO I_GYJZBD.
ELSE.
WRITE ITABS-GYJZBD TO I_GYJZBD.
ENDIF.
CONDENSE I_GYJZBD NO-GAPS.
ILEN8 = 105 - STRLEN( I_GYJZBD ).
IF ITABS-LYTZSY < 0.
ITABS-LYTZSY = ABS( ITABS-LYTZSY ).
WRITE ITABS-LYTZSY TO TMP.
CONCATENATE '-' TMP INTO I_LYTZSY.
ELSE.
WRITE ITABS-LYTZSY TO I_LYTZSY.
ENDIF.
CONDENSE I_LYTZSY NO-GAPS.
ILEN9 = 105 - STRLEN( I_LYTZSY ).
ENDFORM. "subtotal
*&---------------------------------------------------------------------*
*& Form WRITE_REPORT_HEADER
*&---------------------------------------------------------------------*
FORM WRITE_REPORT_HEADER.
DATA : COMP(24) TYPE C,
COMP1(30) TYPE C,
TITL_POSI TYPE I,
BTITL_POSI TYPE I,
DATE_POSI TYPE I.
DATA: P_BUTXT LIKE T001-BUTXT.
*公司代码
SELECT SINGLE BUTXT FROM T001
INTO P_BUTXT WHERE BUKRS = BUKRS.
*分厂代码
SELECT SINGLE NAME1 FROM T001W
INTO COMP1 WHERE WERKS = RBUSA-LOW.
COMP = P_BUTXT.
TITL_POSI = ( SY-LINSZ - STRLEN( SY-TITLE ) ) / 2 - 6.
BTITL_POSI = ( SY-LINSZ - STRLEN( COMP ) ) / 2 + 1.
DATE_POSI = TITL_POSI + 1.
SKIP 4.
WRITE:/ '',AT TITL_POSI '利 润 表'.
SKIP 2.
IF P_RTCUR = 'KRW'.
IF COMP1 NE SPACE.
WRITE:/ '编制单位:',COMP,'/',COMP1,
70 ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单 位:',P_RTCUR.
ELSE.
WRITE:/ '编制单位:',COMP,
AT DATE_POSI ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单 位:',P_RTCUR.
ENDIF.
ELSEIF P_RTCUR = 'USD'.
IF COMP1 NE SPACE.
WRITE:/ '编制单位:',COMP,'/',COMP1,
70 ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单 位:',P_RTCUR.
ELSE.
WRITE:/ '编制单位:',COMP,
AT DATE_POSI ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单 位:',P_RTCUR.
ENDIF.
ELSE.
IF COMP1 NE SPACE.
WRITE:/ '编制单位:',COMP,'/',COMP1,
70 ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单位:人民币元'.
ELSE.
WRITE:/ '编制单位:',COMP,
AT DATE_POSI ' ', RYEAR,'年',PERID,'月', "e_day,'日',
AT 106 '单位:人民币元'.
ENDIF.
ENDIF.
ENDFORM. " WRITE_REPORT_HEADER
*&---------------------------------------------------------------------*
*& Form WRITE_BS
*&---------------------------------------------------------------------*
FORM WRITE_BS.
* IF P_RTCUR = 'KRW'.
* J_XSFY = J_XSFY * 100 .
* I_XSFY = I_XSFY * 100 .
* J_GLFY = J_GLFY * 100 .
* I_GLFY = I_GLFY * 100 .
* J_CWFY = J_CWFY * 100 .
* I_CWFY = I_CWFY * 100 .
* J_GYJZBD = J_GYJZBD * 100 .
* I_GYJZBD = I_GYJZBD * 100 .
* J_TZSY = J_TZSY * 100 .
* I_TZSY = I_TZSY * 100 .
*
* J_QTSY = J_QTSY * 100 .
* I_QTSY = I_QTSY * 100 .
*
*
* J_ZCCZSY = J_ZCCZSY * 100 ."add by wjb
* I_ZCCZSY = I_ZCCZSY * 100 ."add by wjb
*
* J_LYTZSY = J_LYTZSY * 100 .
* I_LYTZSY = I_LYTZSY * 100 .
* J_YYLR = J_YYLR * 100 .
* I_YYLR = I_YYLR * 100 .
* J_LRZE = J_LRZE * 100 .
* I_LRZE = I_LRZE * 100 .
* J_JLR = J_JLR * 100 .
* I_JLR = I_JLR * 100 .
*
** 20181029 AMBER ADD S
* J_YFFY = J_YFFY * 100 .
* I_YFFY = I_YFFY * 100 .
* J_LXFY = J_LXFY * 100 .
* I_LXFY = I_LXFY * 100 .
* J_LXSR = J_LXSR * 100 .
* I_LXSR = I_LXSR * 100 .
** 20181029 AMBER ADD E
*
* ITABS-YYSR = ITABS-YYSR * 100 .
* ITABS-YYCB = ITABS-YYCB * 100 .
* ITABS-YYSJ = ITABS-YYSJ * 100 .
* ITABS-ZCJZSS = ITABS-ZCJZSS * 100 .
* ITABS-YYWSR = ITABS-YYWSR * 100 .
* ITABS-YYWZC = ITABS-YYWZC * 100 .
* ITABS-FLDCZ = ITABS-FLDCZ * 100 .
* ITABS-SDSFY = ITABS-SDSFY * 100 .
* ITABS-JBMGSY = ITABS-JBMGSY * 100 .
*
* JTAB-YYSR = JTAB-YYSR * 100 .
* JTAB-YYCB = JTAB-YYCB * 100 .
* JTAB-YYSJ = JTAB-YYSJ * 100 .
* JTAB-ZCJZSS = JTAB-ZCJZSS * 100 .
* JTAB-YYWSR = JTAB-YYWSR * 100 .
* JTAB-YYWZC = JTAB-YYWZC * 100 .
* JTAB-FLDCZ = JTAB-FLDCZ * 100 .
* JTAB-SDSFY = JTAB-SDSFY * 100 .
* JTAB-JBMGSY = JTAB-JBMGSY * 100 .
* ELSE.
*
* ENDIF.
PERFORM WRITE_PAGE.
PERFORM OUTPUT_FORMAT USING ' 一、营业收入' ' 1 ' JTAB-YYSR ITABS-YYSR.
PERFORM OUTPUT_FORMAT USING ' 减:营业成本' ' 2 ' JTAB-YYCB ITABS-YYCB.
PERFORM OUTPUT_FORMAT USING ' 营业税金及附加' ' 3 ' JTAB-YYSJ ITABS-YYSJ.
PERFORM OUTPUT_STRFORMAT USING ' 销售费用' ' 4 ' JLEN1 J_XSFY ILEN1 I_XSFY.
PERFORM OUTPUT_STRFORMAT USING ' 管理费用' ' 5 ' JLEN2 J_GLFY ILEN2 I_GLFY.
* 20181029 AMBER ADD S
PERFORM OUTPUT_STRFORMAT USING ' 研发费用' ' 6 ' JLEN12 J_YFFY ILEN12 I_YFFY.
* 20181029 AMBER ADD E
PERFORM OUTPUT_STRFORMAT USING ' 财务费用' ' 7 ' JLEN3 J_CWFY ILEN3 I_CWFY.
* 20181029 AMBER ADD S
PERFORM OUTPUT_STRFORMAT USING ' 其中:利息费用' ' 8 ' JLEN13 J_LXFY ILEN13 I_LXFY.
PERFORM OUTPUT_STRFORMAT USING ' 利息收入' ' 9 ' JLEN14 J_LXSR ILEN14 I_LXSR.
* 20181029 AMBER ADD E
* 20181029 AMBER MODIFY S
* PERFORM OUTPUT_FORMAT USING ' 资产减值损失' ' 8 ' JTAB-ZCJZSS ITABS-ZCJZSS.
*
* PERFORM OUTPUT_STRFORMAT USING ' 加:公允价值变动收益' ' 8 ' JLEN8 J_GYJZBD ILEN8 I_GYJZBD.
*
* PERFORM OUTPUT_STRFORMAT USING ' 投资收益' ' 9 ' JLEN5 J_TZSY ILEN5 I_TZSY.
*
* PERFORM OUTPUT_STRFORMAT USING ' 其中:对联营企业和合营企业的投资收益'
* ' 10 ' JLEN9 J_LYTZSY ILEN9 I_LYTZSY.
*
*
* PERFORM OUTPUT_FORMAT USING ' 资产处置收益' ' 11 ' JTAB-ZCCZSY ITABS-ZCCZSY.
*
* PERFORM OUTPUT_FORMAT USING ' 其他收益' ' 12 ' JTAB-QTSY ITABS-QTSY.
*
* PERFORM OUTPUT_STRFORMAT USING '二、营业利润' ' 13 ' JLEN4 J_YYLR ILEN4 I_YYLR.
*
* PERFORM OUTPUT_FORMAT USING ' 加:营业外收入' ' 14 ' JTAB-YYWSR ITABS-YYWSR.
*
* PERFORM OUTPUT_FORMAT USING ' 减:营业外支出' ' 15 ' JTAB-YYWZC ITABS-YYWZC.
*
* PERFORM OUTPUT_FORMAT USING ' 其中:非流动资产处置损失' ' 16 ' JTAB-FLDCZ ITABS-FLDCZ.
*
* PERFORM OUTPUT_STRFORMAT USING '三、利润总额' ' 17 ' JLEN6 J_LRZE ILEN6 I_LRZE.
*
* PERFORM OUTPUT_FORMAT USING ' 减:所得税费用' ' 18 ' JTAB-SDSFY ITABS-SDSFY.
*
* PERFORM OUTPUT_STRFORMAT USING '四、净利润' ' 19 ' JLEN7 J_JLR ILEN7 I_JLR.
*
* PERFORM OUTPUT_FORMAT USING '五、每股收益:' ' 20 ' ' ' ' '.
*
* PERFORM OUTPUT_FORMAT USING ' (一)基本每股收益' ' 21 ' JTAB-JBMGSY ITABS-JBMGSY.
*
* PERFORM OUTPUT_FORMAT USING ' (二)稀释每股收益' ' 22' ' ' ' '.
* 20190102 AMBER MODIFY S
* PERFORM OUTPUT_FORMAT USING ' 资产减值损失' ' 10 ' JTAB-ZCJZSS ITABS-ZCJZSS.
PERFORM OUTPUT_STRFORMAT USING ' 资产减值损失' ' 10 ' JLEN15 J_ZCJZSS ILEN15 I_ZCJZSS.
* 20190102 AMBER MODIFY E
* 20190102 AMBER MODIFY S
* PERFORM OUTPUT_FORMAT USING ' 加:其他收益' ' 11 ' JTAB-QTSY ITABS-QTSY.
PERFORM OUTPUT_STRFORMAT USING ' 加:其他收益' ' 11 ' JLEN10 J_QTSY ILEN10 I_QTSY.
* 20190102 AMBER MODIFY E
PERFORM OUTPUT_STRFORMAT USING ' 投资收益' ' 12 ' JLEN5 J_TZSY ILEN5 I_TZSY.
PERFORM OUTPUT_STRFORMAT USING ' 其中:对联营企业和合营企业的投资收益'
' 13 ' JLEN9 J_LYTZSY ILEN9 I_LYTZSY.
PERFORM OUTPUT_STRFORMAT USING ' 公允价值变动收益' ' 14 ' JLEN8 J_GYJZBD ILEN8 I_GYJZBD.
* 20181103 AMBER MODIFY S
* PERFORM OUTPUT_FORMAT USING ' 资产处置收益' ' 15 ' JTAB-ZCCZSY ITABS-ZCCZSY.
PERFORM OUTPUT_STRFORMAT USING ' 资产处置收益' ' 15 ' JLEN11 J_ZCCZSY ILEN11 I_ZCCZSY.
* 20181103 AMBER MODIFY E
PERFORM OUTPUT_STRFORMAT USING '二、营业利润' ' 16 ' JLEN4 J_YYLR ILEN4 I_YYLR.
PERFORM OUTPUT_FORMAT USING ' 加:营业外收入' ' 17 ' JTAB-YYWSR ITABS-YYWSR.
PERFORM OUTPUT_FORMAT USING ' 减:营业外支出' ' 18 ' JTAB-YYWZC ITABS-YYWZC.
PERFORM OUTPUT_FORMAT USING ' 其中:非流动资产处置损失' ' 19 ' JTAB-FLDCZ ITABS-FLDCZ.
PERFORM OUTPUT_STRFORMAT USING '三、利润总额' ' 20 ' JLEN6 J_LRZE ILEN6 I_LRZE.
* 20190102 AMBER MODIFY S
* PERFORM OUTPUT_FORMAT USING ' 减:所得税费用' ' 21 ' JTAB-SDSFY ITABS-SDSFY.
PERFORM OUTPUT_STRFORMAT USING ' 减:所得税费用' ' 21 'JLEN16 J_SDSFY ILEN16 I_SDSFY.
* 20190102 AMBER MODIFY E
PERFORM OUTPUT_STRFORMAT USING '四、净利润' ' 22 ' JLEN7 J_JLR ILEN7 I_JLR.
PERFORM OUTPUT_FORMAT USING '五、每股收益:' ' 23 ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' (一)基本每股收益' ' 24 ' JTAB-JBMGSY ITABS-JBMGSY.
PERFORM OUTPUT_FORMAT USING ' (二)稀释每股收益' ' 25' ' ' ' '.
* 20181029 AMBER MODIFY E
SKIP 2.
WRITE:/ '补充资料:'.
SKIP.
ULINE 1(120).
WRITE:/ SY-VLINE NO-GAP,16 '项 目',42 SY-VLINE NO-GAP,
44 '行 次',49 SY-VLINE NO-GAP,
53 ' 本 年 累 计 数',84 SY-VLINE NO-GAP,
88 ' 上 年 实 际 数',120 SY-VLINE NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'1.出售、处置部门或被投资单位所得收益',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'2.自然灾害发生的损失',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'3.会计政策变更增加(或减少)利润总额',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'4.会计估计变更增加(或减少)利润总额',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'5.债务重组损失',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
WRITE:/ SY-VLINE NO-GAP,'6.其他',
42 SY-VLINE NO-GAP,49 SY-VLINE NO-GAP,84 SY-VLINE NO-GAP,120 SY-VLINE
NO-GAP.
ULINE 0(120).
ENDFORM. "write_bs
*&---------------------------------------------------------------------*
*& Form write_report_ender
*&---------------------------------------------------------------------*
FORM WRITE_REPORT_ENDER.
SKIP 2.
WRITE:/ '单位负责人:',40 '主管会计工作负责人:',80 '会计机构负责人:'
.
ENDFORM. "write_report_ender
*&--------------------------------------------------------------------*
*& Form authrization
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM AUTHRIZATION.
ENDFORM. " AUTHRIZATION
*&---------------------------------------------------------------------*
*& Form cal_day
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CAL_DAY.
CONDENSE PERID NO-GAPS.
IF PERID+0(1) = '0'.
PERID = PERID+1(1).
ENDIF.
IF PERID = '4' OR PERID = '6' OR
PERID = '9' OR PERID = '11'.
E_DAY = '30'.
ELSEIF PERID = '2'.
P_MOD = RYEAR MOD 4.
IF P_MOD = 0.
E_DAY = '29'.
ELSE.
E_DAY = '28'.
ENDIF.
ELSE.
E_DAY = '31'.
ENDIF.
CONDENSE E_DAY NO-GAPS.
ENDFORM. " cal_day
*&---------------------------------------------------------------------*
*& Form Get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_DATA .
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITAB FROM GLT0
WHERE RYEAR = RYEAR
AND BUKRS = BUKRS
AND RBUSA IN RBUSA
AND RLDNR = '00'
AND RRCTY = '0' "0:实际发生; 1:表示计划发生
AND RACCT >= '0050000000'.
REFRESH ITABS. CLEAR ITABS.
REFRESH JTAB. CLEAR JTAB.
LOOP AT ITAB.
CASE PERID.
WHEN '01' OR '1' OR ' 1' OR '1 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01.
ITAB-CAMOUNT = ITAB-HSL01.
WHEN '02' OR '2' OR ' 2' OR '2 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02.
ITAB-CAMOUNT = ITAB-HSL02.
WHEN '03' OR '3' OR ' 3' OR '3 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03.
ITAB-CAMOUNT = ITAB-HSL03.
WHEN '04' OR '4' OR ' 4' OR '4 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04.
ITAB-CAMOUNT = ITAB-HSL04.
WHEN '05' OR '5' OR ' 5' OR '5 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05.
ITAB-CAMOUNT = ITAB-HSL05.
WHEN '06' OR '6' OR ' 6' OR '6 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06.
ITAB-CAMOUNT = ITAB-HSL06.
WHEN '07' OR '7' OR ' 7' OR '7 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07.
ITAB-CAMOUNT = ITAB-HSL07.
WHEN '08' OR '8' OR ' 8' OR '8 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08.
ITAB-CAMOUNT = ITAB-HSL08.
WHEN '09' OR '9' OR ' 9' OR '9 '.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09.
ITAB-CAMOUNT = ITAB-HSL09.
WHEN '10'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10.
ITAB-CAMOUNT = ITAB-HSL10.
WHEN '11'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11.
ITAB-CAMOUNT = ITAB-HSL11.
WHEN '12'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11
+ ITAB-HSL12.
ITAB-CAMOUNT = ITAB-HSL12.
WHEN '13'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11
+ ITAB-HSL12 + ITAB-HSL13.
ITAB-CAMOUNT = ITAB-HSL13.
WHEN '14'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11
+ ITAB-HSL12 + ITAB-HSL13 + ITAB-HSL14.
ITAB-CAMOUNT = ITAB-HSL14.
WHEN '15'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11
+ ITAB-HSL12 + ITAB-HSL13 + ITAB-HSL14 + ITAB-HSL15
.
ITAB-CAMOUNT = ITAB-HSL15.
WHEN '16'.
ITAB-TAMOUNT = ITAB-HSLVT + ITAB-HSL01 + ITAB-HSL02 + ITAB-HSL03
+ ITAB-HSL04 + ITAB-HSL05 + ITAB-HSL06 + ITAB-HSL07
+ ITAB-HSL08 + ITAB-HSL09 + ITAB-HSL10 + ITAB-HSL11
+ ITAB-HSL12 + ITAB-HSL13 + ITAB-HSL14 + ITAB-HSL15
+ ITAB-HSL16.
ITAB-CAMOUNT = ITAB-HSL16.
ENDCASE.
MODIFY ITAB INDEX SY-TABIX.
CASE ITAB-RACCT+2(4).
WHEN '5101' OR '5102'. "营业收入
IF ITAB-RACCT+2(4) = '5101' OR ITAB-RACCT+2(4) = '5102'. "Modify by Rex on 2011.8.15
ITABS-YYSR = ITABS-YYSR + ITAB-TAMOUNT.
JTAB-YYSR = JTAB-YYSR + ITAB-CAMOUNT.
ENDIF.
WHEN '5401' OR '5405'. "营业成本
IF ITAB-RACCT+2(4) = '5401' OR ITAB-RACCT+2(4) = '5405'. "Modify by Rex on 2011.8.15
ITABS-YYCB = ITABS-YYCB + ITAB-TAMOUNT.
JTAB-YYCB = JTAB-YYCB + ITAB-CAMOUNT.
ENDIF.
WHEN '5402'. "营业税金及附加
ITABS-YYSJ = ITABS-YYSJ + ITAB-TAMOUNT.
JTAB-YYSJ = JTAB-YYSJ + ITAB-CAMOUNT.
WHEN '5503'. "财务费用
ITABS-CWFY = ITABS-CWFY + ITAB-TAMOUNT.
JTAB-CWFY = JTAB-CWFY + ITAB-CAMOUNT.
* 20181029 AMBER ADD S
CASE ITAB-RACCT+2(8).
* 利息费用
WHEN '55030101' OR "财务费用-利息支出
'55030501' OR "财务费用-融资费用
'55030701'. "财务费用-贴息费用
ITABS-LXFY = ITABS-LXFY + ITAB-TAMOUNT.
JTAB-LXFY = JTAB-LXFY + ITAB-CAMOUNT.
* 利息收入
WHEN '55030201'. "财务费用-利息收入
ITABS-LXSR = ITABS-LXSR + ITAB-TAMOUNT.
JTAB-LXSR = JTAB-LXSR + ITAB-CAMOUNT.
ENDCASE.
* 20181029 AMBER ADD E
WHEN '5590'. "资产减值损失
ITABS-ZCJZSS = ITABS-ZCJZSS + ITAB-TAMOUNT.
JTAB-ZCJZSS = JTAB-ZCJZSS + ITAB-CAMOUNT.
WHEN '5111'. "公允价值变动收益
ITABS-GYJZBD = ITABS-GYJZBD + ITAB-TAMOUNT.
JTAB-GYJZBD = JTAB-GYJZBD + ITAB-CAMOUNT.
WHEN '5302'. "其他收益
ITABS-QTSY = ITABS-QTSY + ITAB-TAMOUNT.
JTAB-QTSY = JTAB-QTSY + ITAB-CAMOUNT.
WHEN '5303'. "资产处置收益
ITABS-ZCCZSY = ITABS-ZCCZSY + ITAB-TAMOUNT.
JTAB-ZCCZSY = JTAB-ZCCZSY + ITAB-CAMOUNT.
WHEN '5201'. "投资收益
ITABS-TZSY = ITABS-TZSY + ITAB-TAMOUNT.
JTAB-TZSY = JTAB-TZSY + ITAB-CAMOUNT.
IF ITAB-RACCT = '0052010201'. "对联营企业和合营企业的投资收益
ITABS-LYTZSY = ITABS-LYTZSY + ITAB-TAMOUNT.
JTAB-LYTZSY = JTAB-LYTZSY + ITAB-CAMOUNT.
ENDIF.
WHEN '5301'. "营业外收入
ITABS-YYWSR = ITABS-YYWSR + ITAB-TAMOUNT.
JTAB-YYWSR = JTAB-YYWSR + ITAB-CAMOUNT.
WHEN '5601'. "营业外支出
ITABS-YYWZC = ITABS-YYWZC + ITAB-TAMOUNT.
JTAB-YYWZC = JTAB-YYWZC + ITAB-CAMOUNT.
IF ITAB-RACCT = '0056010401'. "非流动资产处置损失
ITABS-FLDCZ = ITABS-FLDCZ + ITAB-TAMOUNT.
JTAB-FLDCZ = JTAB-FLDCZ + ITAB-CAMOUNT.
ENDIF.
WHEN '5701'. "所得税费用
ITABS-SDSFY = ITABS-SDSFY + ITAB-TAMOUNT.
JTAB-SDSFY = JTAB-SDSFY + ITAB-CAMOUNT.
ENDCASE.
IF ITAB-RACCT = '0090000004'. "Modify by Rex on 2011.8.15
ITABS-YYSR = ITABS-YYSR + ITAB-TAMOUNT.
JTAB-YYSR = JTAB-YYSR + ITAB-CAMOUNT.
ENDIF.
IF ITAB-RACCT = '0090000006'.
ITABS-YYCB = ITABS-YYCB + ITAB-TAMOUNT.
JTAB-YYCB = JTAB-YYCB + ITAB-CAMOUNT.
ENDIF.
MODIFY JTAB INDEX SY-TABIX.
MODIFY ITABS INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " Get_data
*&---------------------------------------------------------------------*
*& Form write_page
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE_PAGE .
ULINE.
WRITE:/ SY-VLINE NO-GAP,10 '项 目',42 SY-VLINE NO-GAP,
44 '行 次',
49 SY-VLINE NO-GAP, 53 ' 本 月 数',
84 SY-VLINE NO-GAP, 88 ' 本 年 累 计 数',
120 SY-VLINE NO-GAP.
ULINE.
ENDFORM. " write_page
*&---------------------------------------------------------------------*
*& Form output_format
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ZDES 科目描述
* -->P_ZL 行次
* -->P_ZMV 本月数
* -->P_ZYV 本年累计数
*----------------------------------------------------------------------*
FORM OUTPUT_FORMAT USING P_ZDES
P_ZL
P_ZMV
P_ZYV.
WRITE:/ SY-VLINE NO-GAP,P_ZDES,42 SY-VLINE NO-GAP,
44 P_ZL.
IF P_ZMV NE 0 .
WRITE: 49 SY-VLINE NO-GAP, P_ZMV.
ELSE.
WRITE: 49 SY-VLINE NO-GAP.
ENDIF.
IF P_ZYV NE 0 .
WRITE: 84 SY-VLINE NO-GAP, P_ZYV.
ELSE.
WRITE: 84 SY-VLINE NO-GAP.
ENDIF.
WRITE: 120 SY-VLINE NO-GAP.
ULINE.
ENDFORM. " output_format
*&---------------------------------------------------------------------*
*& Form output_strformat
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ZDES 科目描述
* -->P_ZL 行次
* -->P_ZMV 本月数
* -->P_ZYV 本年累计数
*----------------------------------------------------------------------*
FORM OUTPUT_STRFORMAT USING P_ZDES
P_ZL
P_ZMV_POS
P_ZMV
P_ZYV_POS
P_ZYV.
WRITE:/ SY-VLINE NO-GAP,P_ZDES,42 SY-VLINE NO-GAP,
44 P_ZL.
CONDENSE P_ZMV NO-GAPS.
IF ( P_ZMV NE ' ' AND P_ZMV NE '0.00' ).
WRITE: 49 SY-VLINE NO-GAP, AT P_ZMV_POS P_ZMV.
ELSE.
WRITE: 49 SY-VLINE NO-GAP.
ENDIF.
CONDENSE P_ZYV NO-GAPS.
IF ( P_ZYV NE ' ' AND P_ZYV NE '0.00' ).
WRITE: 84 SY-VLINE NO-GAP,AT P_ZYV_POS P_ZYV.
ELSE.
WRITE: 84 SY-VLINE NO-GAP.
ENDIF.
WRITE: 120 SY-VLINE NO-GAP.
ULINE.
ENDFORM. " output_strformat
*&---------------------------------------------------------------------*
*& Form GET_GY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_GY_DATA .
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITAB1 FROM GLFUNCT
WHERE RYEAR = RYEAR
AND RBUKRS = BUKRS
AND RBUSA IN RBUSA
AND RLDNR = '0F'
AND RRCTY = '0' "0:实际发生; 1:表示计划发生
AND RACCT >= '0055040000'
AND RACCT <= '0055049999'.
LOOP AT ITAB1.
CASE PERID.
WHEN '01' OR '1' OR ' 1' OR '1 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01.
ITAB1-CAMOUNT = ITAB1-HSL01.
WHEN '02' OR '2' OR ' 2' OR '2 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02.
ITAB1-CAMOUNT = ITAB1-HSL02.
WHEN '03' OR '3' OR ' 3' OR '3 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03.
ITAB1-CAMOUNT = ITAB1-HSL03.
WHEN '04' OR '4' OR ' 4' OR '4 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04.
ITAB1-CAMOUNT = ITAB1-HSL04.
WHEN '05' OR '5' OR ' 5' OR '5 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05.
ITAB1-CAMOUNT = ITAB1-HSL05.
WHEN '06' OR '6' OR ' 6' OR '6 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06.
ITAB1-CAMOUNT = ITAB1-HSL06.
WHEN '07' OR '7' OR ' 7' OR '7 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07.
ITAB1-CAMOUNT = ITAB1-HSL07.
WHEN '08' OR '8' OR ' 8' OR '8 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08.
ITAB1-CAMOUNT = ITAB1-HSL08.
WHEN '09' OR '9' OR ' 9' OR '9 '.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09.
ITAB1-CAMOUNT = ITAB1-HSL09.
WHEN '10'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10.
ITAB1-CAMOUNT = ITAB1-HSL10.
WHEN '11'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11.
ITAB1-CAMOUNT = ITAB1-HSL11.
WHEN '12'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11
+ ITAB1-HSL12.
ITAB1-CAMOUNT = ITAB1-HSL12.
WHEN '13'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11
+ ITAB1-HSL12 + ITAB1-HSL13.
ITAB1-CAMOUNT = ITAB1-HSL13.
WHEN '14'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11
+ ITAB1-HSL12 + ITAB1-HSL13 + ITAB1-HSL14.
ITAB1-CAMOUNT = ITAB1-HSL14.
WHEN '15'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11
+ ITAB1-HSL12 + ITAB1-HSL13 + ITAB1-HSL14
+ ITAB1-HSL15.
ITAB1-CAMOUNT = ITAB1-HSL15.
WHEN '16'.
ITAB1-TAMOUNT = ITAB1-HSLVT + ITAB1-HSL01 + ITAB1-HSL02
+ ITAB1-HSL03 + ITAB1-HSL04 + ITAB1-HSL05
+ ITAB1-HSL06 + ITAB1-HSL07 + ITAB1-HSL08
+ ITAB1-HSL09 + ITAB1-HSL10 + ITAB1-HSL11
+ ITAB1-HSL12 + ITAB1-HSL13 + ITAB1-HSL14
+ ITAB1-HSL15 + ITAB1-HSL16 .
ITAB1-CAMOUNT = ITAB1-HSL16.
ENDCASE.
MODIFY ITAB1 INDEX SY-TABIX.
CASE ITAB1-RACCT+2(4).
WHEN '5504'.
* 20181029 amber MODIFY S
IF ITAB1-RFAREA = '0004'. "销售费用
ITABS-XSFY = ITABS-XSFY + ITAB1-TAMOUNT.
JTAB-XSFY = JTAB-XSFY + ITAB1-CAMOUNT.
ENDIF.
IF ITAB1-RFAREA = '0003'.
IF ITAB1-RACCT+2(6) = '550406'.
ITABS-YFFY = ITABS-YFFY + ITAB1-TAMOUNT. "研发费用
JTAB-YFFY = JTAB-YFFY + ITAB1-CAMOUNT.
ELSE. "管理费用
ITABS-GLFY = ITABS-GLFY + ITAB1-TAMOUNT.
JTAB-GLFY = JTAB-GLFY + ITAB1-CAMOUNT.
ENDIF.
ENDIF.
* 20181029 amber MODIFY E
ENDCASE.
MODIFY JTAB INDEX SY-TABIX.
MODIFY ITABS INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " GET_GY_DATA
*&---------------------------------------------------------------------*
*& Form PROCESS_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PROCESS_DATA .
ENDFORM. " PROCESS_DATA
资产负债表
*********************************************************************
* PROGRAM NAME : 资产负债表(新会计制度) *
* APPLICATION NAME : FI *
* SUBSYSTEM : GL *
* AUTHOR : *
* TRANSACTION : ZFIR003N *
* SAP RELEASE : 6.0 *
* PROGRAM ID : *
* PROGRAM DESCRIPTION : 资产负债表(新会计制度) *
*********************************************************************
* REVISION LOG *
* LOG# DATE AUTHOR DESCRIPTION *
* ---- ------- -------- ----------- *
* 0000 10/30/2014 资产负债表 *
*********************************************************************
REPORT ZFIR003V2 NO STANDARD PAGE HEADING MESSAGE-ID 00
LINE-SIZE 155 LINE-COUNT 120.
TABLES : t001, "公司代码
t001w, "分厂代码
glt0, "总帐科目主记录业务额
anlc. "资产值字段
******itabs:期未数*****jtab:期初数***********************************
DATA: BEGIN OF itabs OCCURS 10,
* 流动资产:
hbzj LIKE glt0-hslvt, "货币资金
jyxjrz LIKE glt0-hslvt, "交易性金融资产 以公允价值计量且其变动计入当期损益的金融资产
yspj LIKE glt0-hslvt, "应收票据
yszk LIKE glt0-hslvt, "应收帐款
yshzzb LIKE glt0-hslvt, "应收帐款坏帐准备
yszkje LIKE glt0-hslvt, "应收帐款净额
yufzk LIKE glt0-hslvt, "预付帐款
yslx LIKE glt0-hslvt, "应收利息
ysgl LIKE glt0-hslvt, "应收股利
qtysk LIKE glt0-hslvt, "其他应收款
qthzzb LIKE glt0-hslvt, "其他应收帐款坏帐准备
* 20190106 amber insert s
cqhzzb LIKE glt0-hslvt, "长期应收帐款坏帐准备
* 20190106 amber insert e
qtyszkje LIKE glt0-hslvt, "其他应收帐款净额
cuih LIKE glt0-hslvt, "存货
chdjzb LIKE glt0-hslvt, "存货跌价准备
chje LIKE glt0-hslvt, "存货净额
dtfei LIKE glt0-hslvt, "待摊费用
qtldzc LIKE glt0-hslvt, "其他流动资产
nbwl LIKE glt0-hslvt, "内部往来
ldzchj LIKE glt0-hslvt, "流动资产合计
*非流动资产:
kgcsjr LIKE glt0-hslvt, "可供出售金融资产
cyzdq LIKE glt0-hslvt, "持有至到期投资
cqysk LIKE glt0-hslvt, "长期应收款
cqgq LIKE glt0-hslvt, "长期股权投资
cqgqjz LIKE glt0-hslvt, "长期投资减值准备
tzxfdc LIKE glt0-hslvt, "投资性房地产
gdzc LIKE glt0-hslvt, "固定资产原价
ljzj LIKE glt0-hslvt, "累计折旧
gdzcjz LIKE glt0-hslvt, "固定资产净值
gdzcjzz LIKE glt0-hslvt, "固定资产减值准备
gdzcje LIKE glt0-hslvt, "固定资产净额
zjgc LIKE glt0-hslvt, "在建工程
gcwz LIKE glt0-hslvt, "工程物资
gdzcql LIKE glt0-hslvt, "固定资产清理
* GDZCHJ LIKE GLT0-HSLVT, "固定资产合计
wxzc LIKE glt0-hslvt, "无形资产
kfzc LIKE glt0-hslvt, "开发支出
sy LIKE glt0-hslvt, "商誉
cqdtf LIKE glt0-hslvt, "长期待摊费用
dysdsz LIKE glt0-hslvt, "递延所得税资产
qtcqzc LIKE glt0-hslvt, "其他长期资产
qtfld LIKE glt0-hslvt, "其他非流动资产
fldzchj LIKE glt0-hslvt, "非流动资产合计
*资产总计
zchj LIKE glt0-hslvt, "资产总计
*流动负债:
dqjk LIKE glt0-hslvt, "短期借款
jyxjrf LIKE glt0-hslvt, "交易性金融负债 以公允价值计量且其变动计入当期损益的金融负债
yfpj LIKE glt0-hslvt, "应付票据
yfzk LIKE glt0-hslvt, "应付帐款
yuszk LIKE glt0-hslvt, "预收帐款
yfzgxc LIKE glt0-hslvt, "应付职工薪酬
yjsf LIKE glt0-hslvt, "应交税费
yflx LIKE glt0-hslvt, "应付利息
yfgl LIKE glt0-hslvt, "应付股利
qtyfk LIKE glt0-hslvt, "其他应付款
ytfy LIKE glt0-hslvt, "预提费用
qtldfz LIKE glt0-hslvt, "其他流动负债
ldfzhj LIKE glt0-hslvt, "流动负债合计
*非流动负债:
cqjk LIKE glt0-hslvt, "长期借款
yfzq LIKE glt0-hslvt, "应付债券
cqyfk LIKE glt0-hslvt, "长期应付款
zxyfk LIKE glt0-hslvt, "专项应付款
yjfz LIKE glt0-hslvt, "预计负债
dysy LIKE glt0-hslvt, "递延收益
dysdsf LIKE glt0-hslvt, "递延所得税负债
qtcqfz LIKE glt0-hslvt, "其他长期负债
fldfzhj LIKE glt0-hslvt, "非流动负债合计
*负债合计
fzhj LIKE glt0-hslvt, "负债合计
*所有者权益(或股东权益):
sszb LIKE glt0-hslvt, "实收资本(或股本)
zbgj LIKE glt0-hslvt, "资本公积
qtzhsy LIKE glt0-hslvt, "其他综合收益
kcg LIKE glt0-hslvt, "库存股
yygj LIKE glt0-hslvt, "盈余公积
gyj LIKE glt0-hslvt, "公益金
wfplr LIKE glt0-hslvt, "未分配利润
syzqlhj LIKE glt0-hslvt, "所有者权益(或股东权益)合计
*负债和所有者权益(或股东权益)总计
fzsyhj LIKE glt0-hslvt,
ncycl LIKE glt0-hslvt, "年初原材料存货
ncsp LIKE glt0-hslvt, "年初库存商品
ncbcp LIKE glt0-hslvt, "年初自制半成品
ncfqfk LIKE glt0-hslvt, "分期付款发出商品
ncwtjg LIKE glt0-hslvt, "委托加工物资
nczzp LIKE glt0-hslvt, "在制品
ncdzyh LIKE glt0-hslvt, "低值易耗品
ncbzw LIKE glt0-hslvt, "包装物
nmycl LIKE glt0-hslvt, "年末原材料存货
nmsp LIKE glt0-hslvt, "年末库存商品
nmbcp LIKE glt0-hslvt, "年末自制半成品
nmfqfk LIKE glt0-hslvt, "分期付款发出商品
nmwtjg LIKE glt0-hslvt, "委托加工物资
nmzzp LIKE glt0-hslvt, "在制品
nmdzyh LIKE glt0-hslvt, "低值易耗品
nmbzw LIKE glt0-hslvt, "包装物
fdgyj LIKE glt0-hslvt, "法定公益金
rtcur LIKE glt0-rtcur, "货币
END OF itabs.
DATA: jtab LIKE itabs OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF itab OCCURS 10.
INCLUDE STRUCTURE glt0.
DATA: tamount LIKE glt0-hslvt.
DATA: END OF itab.
DATA: e_day(2),
p_len TYPE i,
p_mod TYPE i,
v_kansw LIKE anlc-kansw,
v_knafa LIKE anlc-knafa,
p_kansw LIKE anlc-kansw.
DATA: p_butxt LIKE t001-butxt.
DATA: p_rtcur LIKE glt0-rtcur.
******************************************************
* selection screen *
******************************************************
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS : bukrs LIKE t001-bukrs OBLIGATORY DEFAULT '8300'.
PARAMETERS : ryear(4) TYPE c OBLIGATORY DEFAULT sy-datum+0(4).
PARAMETERS : perid(2) TYPE c OBLIGATORY DEFAULT sy-datum+4(2).
SELECT-OPTIONS : rbusa FOR glt0-rbusa.
SELECTION-SCREEN END OF BLOCK blk1.
*权限检查
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'Z_FI_BUKRS'
ID 'BUKRS' FIELD bukrs.
IF sy-subrc NE 0 .
MESSAGE e000(00) WITH bukrs '公司代码中没有权限!'.
ELSE.
IF bukrs = '1100'.
DATA:BEGIN OF it_tab OCCURS 0,
rbusa LIKE glt0-rbusa,
END OF it_tab.
CLEAR it_tab.REFRESH it_tab.
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE it_tab
FROM glt0
WHERE rbusa IN rbusa.
SORT it_tab BY rbusa.
DELETE ADJACENT DUPLICATES FROM it_tab COMPARING rbusa.
LOOP AT it_tab.
AUTHORITY-CHECK OBJECT 'Z_FI_GSBER'
ID 'GSBER' FIELD it_tab-rbusa.
IF sy-subrc NE 0 .
MESSAGE e000(00) WITH it_tab-rbusa '业务范围中没有权限!'.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
INITIALIZATION.
********Report header********************************
TOP-OF-PAGE.
PERFORM write_report_header.
**********Report Footer******************************
***********Get Data**********************************
START-OF-SELECTION.
PERFORM cal_day.
PERFORM authrization.
PERFORM select_data.
*********Process Data*******************************
END-OF-SELECTION.
REFRESH itabs. CLEAR itabs.
REFRESH jtab. CLEAR jtab.
*货币
SELECT SINGLE rtcur FROM glt0
INTO p_rtcur WHERE bukrs = bukrs.
PERFORM con_wfplr. "未分配利润
PERFORM process_data.
*add 3.8.2005 当业务为1120并且为2005年时,其年初数硬写进去
PERFORM process_data1.
*end add 3.8.2005
PERFORM subtotal.
********Output Data*********************************
PERFORM write_bs.
FREE itabs. FREE itab. FREE jtab.
********Perfrom*********************************************************
*&---------------------------------------------------------------------*
*& Form suntotal
*&---------------------------------------------------------------------*
FORM subtotal.
*----------------------------期末数合计-------------------------------
*应收帐款净额
itabs-yszkje = itabs-yszk + itabs-yshzzb.
*其他应收帐款净额
itabs-qtyszkje = itabs-qtysk + itabs-qthzzb.
* 20190106 amber s
itabs-cqysk = itabs-cqysk + itabs-cqhzzb.
* 20190106 amber e
*存货净额
itabs-chje = itabs-cuih + itabs-chdjzb.
*流动资产合计
itabs-ldzchj = itabs-hbzj + itabs-jyxjrz + itabs-yspj + itabs-yszkje +
itabs-yufzk + itabs-yslx + itabs-ysgl + itabs-qtyszkje +
itabs-chje + itabs-dtfei + itabs-qtldzc + itabs-nbwl .
*固定资产净值=固定资产原价-累计折旧
itabs-gdzcjz = itabs-gdzc + itabs-ljzj.
*固定资产净额=固定资产净值-固定资产减值准备
itabs-gdzcje = itabs-gdzcjz + itabs-gdzcjzz.
*固定资产合计
* ITABS-GDZCHJ = ITABS-GDZCJE + ITABS-GCWZ + ITABS-ZJGC + ITABS-GDZCQL.
*长期股权投资=长期股权投资-长期投资减值准备
itabs-cqgq = itabs-cqgq + itabs-cqgqjz.
*非流动资产合计
itabs-fldzchj = itabs-kgcsjr + itabs-cyzdq + itabs-cqysk + itabs-cqgq
+ itabs-tzxfdc + itabs-gdzcje + itabs-gcwz + itabs-zjgc
+ itabs-gdzcql + itabs-wxzc + itabs-kfzc + itabs-sy
+ itabs-cqdtf + itabs-dysdsz + itabs-qtcqzc + itabs-qtfld.
*资产总计
itabs-zchj = itabs-ldzchj + itabs-fldzchj.
*流动负债合计
itabs-ldfzhj = itabs-dqjk + itabs-jyxjrf + itabs-yfpj + itabs-yfzk
+ itabs-yuszk + itabs-yfzgxc + itabs-yjsf + itabs-yflx + itabs-yfgl
+ itabs-qtyfk + itabs-ytfy + itabs-qtldfz.
*非流动负债合计
itabs-fldfzhj = itabs-cqjk + itabs-yfzq + itabs-cqyfk + itabs-zxyfk
+ itabs-yjfz + itabs-dysy + itabs-dysdsf + itabs-qtcqfz.
*负债合计
itabs-fzhj = itabs-ldfzhj + itabs-fldfzhj.
*所有者权益(或股东权益)合计
itabs-syzqlhj = itabs-sszb + itabs-zbgj + itabs-qtzhsy + itabs-kcg + itabs-yygj + itabs-wfplr.
* 负债和所有者权益(或股东权益)总计
itabs-fzsyhj = itabs-syzqlhj + itabs-fzhj.
MODIFY itabs INDEX sy-tabix.
*----------------------------期初数合计-------------------------------
jtab-yszkje = jtab-yszk + jtab-yshzzb.
jtab-qtyszkje = jtab-qtysk + jtab-qthzzb.
* 20190106 amber s
jtab-cqysk = jtab-cqysk + jtab-cqhzzb.
* 20190106 amber e
jtab-chje = jtab-cuih + jtab-chdjzb.
jtab-ldzchj = jtab-hbzj + jtab-jyxjrz + jtab-yspj + jtab-yszkje +
jtab-yufzk + jtab-yslx + jtab-ysgl + jtab-qtyszkje +
jtab-chje + jtab-dtfei + jtab-qtldzc + jtab-nbwl .
jtab-gdzcjz = jtab-gdzc + jtab-ljzj.
jtab-gdzcje = jtab-gdzcjz + jtab-gdzcjzz.
jtab-cqgq = jtab-cqgq + jtab-cqgqjz.
* JTAB-GDZCHJ = JTAB-GDZCJE + JTAB-GCWZ + JTAB-ZJGC + JTAB-GDZCQL.
jtab-fldzchj = jtab-kgcsjr + jtab-cyzdq + jtab-cqysk + jtab-cqgq +
jtab-tzxfdc + jtab-gdzcje + jtab-gcwz + jtab-zjgc + jtab-gdzcql +
jtab-wxzc + jtab-kfzc + jtab-sy + jtab-cqdtf + jtab-dysdsz + jtab-qtcqzc + jtab-qtfld.
jtab-zchj = jtab-ldzchj + jtab-fldzchj.
jtab-ldfzhj = jtab-dqjk + jtab-jyxjrf + jtab-yfpj + jtab-yfzk
+ jtab-yuszk + jtab-yfzgxc + jtab-yjsf + jtab-yflx + jtab-yfgl
+ jtab-qtyfk + jtab-ytfy + jtab-qtldfz.
jtab-fldfzhj = jtab-cqjk + jtab-yfzq + jtab-cqyfk + jtab-zxyfk
+ jtab-yjfz + jtab-dysy + jtab-dysdsf + jtab-qtcqfz.
jtab-fzhj = jtab-ldfzhj + jtab-fldfzhj.
jtab-syzqlhj = jtab-sszb + jtab-zbgj + jtab-qtzhsy + jtab-kcg + jtab-yygj + jtab-wfplr.
jtab-fzsyhj = jtab-syzqlhj + jtab-fzhj.
MODIFY jtab INDEX sy-tabix.
ENDFORM. "subtotal
*&---------------------------------------------------------------------*
*& Form WRITE_REPORT_HEADER
*&---------------------------------------------------------------------*
FORM write_report_header.
DATA : comp(24) TYPE c,
comp1(30) TYPE c,
titl_posi TYPE i,
btitl_posi TYPE i,
date_posi TYPE i.
*公司代码
SELECT SINGLE butxt FROM t001
INTO p_butxt WHERE bukrs = bukrs.
*分厂代码
SELECT SINGLE name1 FROM t001w
INTO comp1 WHERE werks = rbusa-low.
comp = p_butxt.
btitl_posi = ( sy-linsz - STRLEN( comp ) ) / 2 .
titl_posi = ( sy-linsz - STRLEN( sy-title ) ) / 2 - 8.
date_posi = titl_posi + 2.
PRINT-CONTROL FONT '012'.
WRITE:/,AT titl_posi '资 产 负 债 表'.
PRINT-CONTROL FONT '006'.
IF p_rtcur = 'KRW'.
IF comp1 NE space.
WRITE:/, 2 '编 制 单 位:',comp,'/',comp1,85 ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:',p_rtcur.
ELSE.
WRITE:/, 2 '编 制 单 位:',comp,AT date_posi ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:',p_rtcur.
ENDIF.
ELSEIF p_rtcur = 'USD'.
IF comp1 NE space.
WRITE:/, 2 '编 制 单 位:',comp,'/',comp1,85 ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:',p_rtcur.
ELSE.
WRITE:/, 2 '编 制 单 位:',comp,AT date_posi ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:',p_rtcur.
ENDIF.
ELSE.
IF comp1 NE space.
WRITE:/, 2 '编 制 单 位:',comp,'/',comp1,85 ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:人 民 币 元'.
ELSE.
WRITE:/, 2 '编 制 单 位:',comp,AT date_posi ' ', ryear,
'年',perid,'月',e_day,'日',135 '单 位:人 民 币 元'.
ENDIF.
ENDIF.
ULINE.
IF perid = '12'.
WRITE:/ sy-vline NO-GAP,8 '资 产',28 sy-vline NO-GAP,
29 '行次', 33 sy-vline NO-GAP,38 '年 初 数',
55 sy-vline NO-GAP,60 '年 末 数',77 sy-vline NO-GAP,
80 '负 债 及 股 东 权 益',106 sy-vline NO-GAP,107 '行次',
111 sy-vline NO-GAP,115 '年 初 数',133 sy-vline NO-GAP,
138 '年 末 数',155 sy-vline.
ELSE.
WRITE:/ sy-vline NO-GAP,8 '资 产',28 sy-vline NO-GAP,
29 '行次', 33 sy-vline NO-GAP,38 '年 初 数',
55 sy-vline NO-GAP,60 '期 末 数',77 sy-vline NO-GAP,
80 '负 债 及 股 东 权 益',106 sy-vline NO-GAP,107 '行次',
111 sy-vline NO-GAP,115 '年 初 数',133 sy-vline NO-GAP,
138 '期 末 数',155 sy-vline.
ENDIF.
ULINE.
ENDFORM. " WRITE_REPORT_HEADER
*&---------------------------------------------------------------------*
*& Form WRITE_BS
*&---------------------------------------------------------------------*
FORM write_bs.
DATA: tmp(21),
i_nbwl(22),
j_nbwl(22),
i_qtyszkje(22),
j_qtyszkje(22),
i_nmfqfk(22),
j_ncfqfk(22),
i_yjsj(22),
j_yjsj(22),
ilen1 TYPE i,
jlen1 TYPE i,
ilen2 TYPE i,
jlen2 TYPE i,
ilen3 TYPE i,
jlen3 TYPE i,
ilen4 TYPE i,
jlen4 TYPE i.
* 20181107 liujinghua delete S
* WRITE itabs-nbwl TO i_nbwl.
* CONDENSE i_nbwl NO-GAPS.
* ilen1 = 76 - STRLEN( i_nbwl ).
*
* WRITE jtab-nbwl TO j_nbwl.
* CONDENSE j_nbwl NO-GAPS.
* jlen1 = 54 - STRLEN( j_nbwl ).
* WRITE itabs-qtyszkje TO i_qtyszkje.
* CONDENSE i_qtyszkje NO-GAPS.
* ilen2 = 76 - STRLEN( i_qtyszkje ).
*
* WRITE jtab-qtyszkje TO j_qtyszkje.
* CONDENSE j_qtyszkje NO-GAPS.
* jlen2 = 54 - STRLEN( j_qtyszkje ).
* WRITE itabs-nmfqfk TO i_nmfqfk.
* CONDENSE i_nmfqfk NO-GAPS.
* ilen3 = 142 - STRLEN( i_nmfqfk ).
*
* WRITE jtab-ncfqfk TO j_ncfqfk.
* CONDENSE j_ncfqfk NO-GAPS.
* jlen3 = 142 - STRLEN( j_ncfqfk ).
* 20181107 liujinghua delete E
IF p_rtcur = 'KRW'.
* 20181107 liujinghua MODIFY S
* i_nbwl = i_nbwl * 100 .
* j_nbwl = j_nbwl * 100 .
* i_qtyszkje = i_qtyszkje * 100 .
* j_qtyszkje = j_qtyszkje * 100 .
* j_ncfqfk = j_ncfqfk * 100 .
* i_nmfqfk = i_nmfqfk * 100 .
itabs-nbwl = itabs-nbwl * 100 .
jtab-nbwl = jtab-nbwl * 100 .
itabs-qtyszkje = itabs-qtyszkje * 100 .
jtab-qtyszkje = jtab-qtyszkje * 100 .
jtab-ncfqfk = jtab-ncfqfk * 100 .
itabs-nmfqfk = itabs-nmfqfk * 100 .
* 20181107 liujinghua MODIFY E
itabs-hbzj = itabs-hbzj * 100.
itabs-jyxjrz = itabs-jyxjrz * 100 .
itabs-yspj = itabs-yspj * 100 .
itabs-yszk = itabs-yszk * 100 .
itabs-yszkje = itabs-yszkje * 100 .
itabs-yufzk = itabs-yufzk * 100 .
itabs-yslx = itabs-yslx * 100 .
itabs-ysgl = itabs-ysgl * 100 .
itabs-qtysk = itabs-qtysk * 100 .
itabs-cuih = itabs-cuih * 100 .
itabs-chje = itabs-chje * 100 .
itabs-dtfei = itabs-dtfei * 100 .
itabs-qtldzc = itabs-qtldzc * 100 .
itabs-ldzchj = itabs-ldzchj * 100 .
itabs-kgcsjr = itabs-kgcsjr * 100 .
itabs-cyzdq = itabs-cyzdq * 100 .
itabs-cqysk = itabs-cqysk * 100 .
itabs-cqgq = itabs-cqgq * 100 .
itabs-tzxfdc = itabs-tzxfdc * 100 .
itabs-gdzc = itabs-gdzc * 100 .
itabs-gdzcjz = itabs-gdzcjz * 100 .
itabs-sszb = itabs-sszb * 100 .
itabs-gdzcje = itabs-gdzcje * 100 .
itabs-zbgj = itabs-zbgj * 100 .
itabs-zjgc = itabs-zjgc * 100 .
itabs-kcg = itabs-kcg * 100 .
itabs-gcwz = itabs-gcwz * 100 .
itabs-yygj = itabs-yygj * 100 .
itabs-gdzcql = itabs-gdzcql * 100 .
itabs-wxzc = itabs-wxzc * 100 .
itabs-kfzc = itabs-kfzc * 100 .
itabs-sy = itabs-sy * 100 .
itabs-cqdtf = itabs-cqdtf * 100 .
itabs-dysdsz = itabs-dysdsz * 100 .
itabs-qtcqzc = itabs-qtcqzc * 100 .
itabs-qtfld = itabs-qtfld * 100 .
itabs-fldzchj = itabs-fldzchj * 100 .
itabs-zchj = itabs-zchj * 100 .
itabs-nmycl = itabs-nmycl * 100 .
itabs-nmsp = itabs-nmsp * 100 .
itabs-nmbcp = itabs-nmbcp * 100 .
itabs-nmfqfk = itabs-nmfqfk * 100 .
itabs-nmwtjg = itabs-nmwtjg * 100 .
itabs-nmzzp = itabs-nmzzp * 100 .
itabs-nmdzyh = itabs-nmdzyh * 100 .
itabs-nmbzw = itabs-nmbzw * 100 .
itabs-yshzzb = 0 - itabs-yshzzb * 100.
itabs-qthzzb = 0 - itabs-qthzzb * 100.
* 20190106 AMBER S
itabs-cqhzzb = 0 - itabs-cqhzzb * 100.
* 20190106 AMBER E
itabs-chdjzb = 0 - itabs-chdjzb * 100.
itabs-ljzj = 0 - itabs-ljzj * 100.
itabs-gdzcjzz = 0 - itabs-gdzcjzz * 100.
itabs-dqjk = 0 - itabs-dqjk * 100.
itabs-jyxjrf = 0 - itabs-jyxjrf * 100.
itabs-yfpj = 0 - itabs-yfpj * 100.
itabs-yfzk = 0 - itabs-yfzk * 100.
itabs-yuszk = 0 - itabs-yuszk * 100.
itabs-yfzgxc = 0 - itabs-yfzgxc * 100.
itabs-yjsf = 0 - itabs-yjsf * 100.
itabs-yflx = 0 - itabs-yflx * 100.
itabs-yfgl = 0 - itabs-yfgl * 100.
itabs-qtyfk = 0 - itabs-qtyfk * 100.
itabs-ytfy = 0 - itabs-ytfy * 100.
itabs-qtldfz = 0 - itabs-qtldfz * 100.
itabs-ldfzhj = 0 - itabs-ldfzhj * 100.
itabs-cqjk = 0 - itabs-cqjk * 100.
itabs-yfzq = 0 - itabs-yfzq * 100.
itabs-cqyfk = 0 - itabs-cqyfk * 100.
itabs-zxyfk = 0 - itabs-zxyfk * 100.
itabs-yjfz = 0 - itabs-yjfz * 100.
itabs-dysy = 0 - itabs-dysy * 100.
itabs-dysdsf = 0 - itabs-dysdsf * 100.
itabs-qtcqfz = 0 - itabs-qtcqfz * 100.
itabs-fldfzhj = 0 - itabs-fldfzhj * 100.
itabs-fzhj = 0 - itabs-fzhj * 100.
itabs-sszb = 0 - itabs-sszb * 100.
itabs-zbgj = 0 - itabs-zbgj * 100.
itabs-qtzhsy = 0 - itabs-qtzhsy * 100.
itabs-yygj = 0 - itabs-yygj * 100.
itabs-gyj = 0 - itabs-gyj * 100.
itabs-wfplr = 0 - itabs-wfplr * 100.
itabs-syzqlhj = 0 - itabs-syzqlhj * 100.
itabs-fzsyhj = 0 - itabs-fzsyhj * 100.
jtab-hbzj = jtab-hbzj * 100.
jtab-jyxjrz = jtab-jyxjrz * 100 .
jtab-yspj = jtab-yspj * 100 .
jtab-yszk = jtab-yszk * 100 .
jtab-yszkje = jtab-yszkje * 100 .
jtab-yufzk = jtab-yufzk * 100 .
jtab-yslx = jtab-yslx * 100 .
jtab-ysgl = jtab-ysgl * 100 .
jtab-qtysk = jtab-qtysk * 100 .
jtab-cuih = jtab-cuih * 100 .
jtab-chje = jtab-chje * 100 .
jtab-dtfei = jtab-dtfei * 100 .
jtab-qtldzc = jtab-qtldzc * 100 .
jtab-ldzchj = jtab-ldzchj * 100 .
jtab-kgcsjr = jtab-kgcsjr * 100 .
jtab-cyzdq = jtab-cyzdq * 100 .
jtab-cqysk = jtab-cqysk * 100 .
jtab-cqgq = jtab-cqgq * 100 .
jtab-tzxfdc = jtab-tzxfdc * 100 .
jtab-gdzc = jtab-gdzc * 100 .
jtab-gdzcjz = jtab-gdzcjz * 100 .
jtab-sszb = jtab-sszb * 100 .
jtab-gdzcje = jtab-gdzcje * 100 .
jtab-zbgj = jtab-zbgj * 100 .
jtab-zjgc = jtab-zjgc * 100 .
jtab-kcg = jtab-kcg * 100 .
jtab-gcwz = jtab-gcwz * 100 .
jtab-yygj = jtab-yygj * 100 .
jtab-gdzcql = jtab-gdzcql * 100 .
jtab-wxzc = jtab-wxzc * 100 .
jtab-kfzc = jtab-kfzc * 100 .
jtab-sy = jtab-sy * 100 .
jtab-cqdtf = jtab-cqdtf * 100 .
jtab-dysdsz = jtab-dysdsz * 100 .
jtab-qtcqzc = jtab-qtcqzc * 100 .
jtab-qtfld = jtab-qtfld * 100 .
jtab-fldzchj = jtab-fldzchj * 100 .
jtab-zchj = jtab-zchj * 100 .
jtab-ncycl = jtab-ncycl * 100 .
jtab-ncsp = jtab-ncsp * 100 .
jtab-ncbcp = jtab-ncbcp * 100 .
jtab-ncfqfk = jtab-ncfqfk * 100 .
jtab-ncwtjg = jtab-ncwtjg * 100 .
jtab-nczzp = jtab-nczzp * 100 .
jtab-ncdzyh = jtab-ncdzyh * 100 .
jtab-ncbzw = jtab-ncbzw * 100 .
jtab-yshzzb = 0 - jtab-yshzzb * 100.
jtab-qthzzb = 0 - jtab-qthzzb * 100.
* 20190106 amber s
jtab-cqhzzb = 0 - jtab-cqhzzb * 100.
* 20190106 amber e
jtab-chdjzb = 0 - jtab-chdjzb * 100.
jtab-ljzj = 0 - jtab-ljzj * 100.
jtab-gdzcjzz = 0 - jtab-gdzcjzz * 100.
jtab-dqjk = 0 - jtab-dqjk * 100.
jtab-jyxjrf = 0 - jtab-jyxjrf * 100.
jtab-yfpj = 0 - jtab-yfpj * 100.
jtab-yfzk = 0 - jtab-yfzk * 100.
jtab-yuszk = 0 - jtab-yuszk * 100.
jtab-yfzgxc = 0 - jtab-yfzgxc * 100.
jtab-yjsf = 0 - jtab-yjsf * 100.
jtab-yflx = 0 - jtab-yflx * 100.
jtab-yfgl = 0 - jtab-yfgl * 100.
jtab-qtyfk = 0 - jtab-qtyfk * 100.
jtab-ytfy = 0 - jtab-ytfy * 100.
jtab-qtldfz = 0 - jtab-qtldfz * 100.
jtab-ldfzhj = 0 - jtab-ldfzhj * 100.
jtab-cqjk = 0 - jtab-cqjk * 100.
jtab-yfzq = 0 - jtab-yfzq * 100.
jtab-cqyfk = 0 - jtab-cqyfk * 100.
jtab-zxyfk = 0 - jtab-zxyfk * 100.
jtab-yjfz = 0 - jtab-yjfz * 100.
jtab-dysy = 0 - jtab-dysy * 100.
jtab-dysdsf = 0 - jtab-dysdsf * 100.
jtab-qtcqfz = 0 - jtab-qtcqfz * 100.
jtab-fldfzhj = 0 - jtab-fldfzhj * 100.
jtab-fzhj = 0 - jtab-fzhj * 100.
jtab-sszb = 0 - jtab-sszb * 100.
jtab-zbgj = 0 - jtab-zbgj * 100.
jtab-qtzhsy = 0 - jtab-qtzhsy * 100.
jtab-yygj = 0 - jtab-yygj * 100.
jtab-gyj = 0 - jtab-gyj * 100.
jtab-wfplr = 0 - jtab-wfplr * 100.
jtab-syzqlhj = 0 - jtab-syzqlhj * 100.
jtab-fzsyhj = 0 - jtab-fzsyhj * 100.
ELSE.
itabs-yshzzb = 0 - itabs-yshzzb.
itabs-qthzzb = 0 - itabs-qthzzb.
* 20190106 amber s
itabs-cqhzzb = 0 - itabs-cqhzzb.
* 20190106 amber e
itabs-chdjzb = 0 - itabs-chdjzb.
itabs-ljzj = 0 - itabs-ljzj.
itabs-gdzcjzz = 0 - itabs-gdzcjzz.
itabs-dqjk = 0 - itabs-dqjk.
itabs-jyxjrf = 0 - itabs-jyxjrf.
itabs-yfpj = 0 - itabs-yfpj.
itabs-yfzk = 0 - itabs-yfzk.
itabs-yuszk = 0 - itabs-yuszk.
itabs-yfzgxc = 0 - itabs-yfzgxc.
itabs-yjsf = 0 - itabs-yjsf.
itabs-yflx = 0 - itabs-yflx.
itabs-yfgl = 0 - itabs-yfgl.
itabs-qtyfk = 0 - itabs-qtyfk.
itabs-ytfy = 0 - itabs-ytfy.
itabs-qtldfz = 0 - itabs-qtldfz.
itabs-ldfzhj = 0 - itabs-ldfzhj.
itabs-cqjk = 0 - itabs-cqjk.
itabs-yfzq = 0 - itabs-yfzq.
itabs-cqyfk = 0 - itabs-cqyfk.
itabs-zxyfk = 0 - itabs-zxyfk.
itabs-yjfz = 0 - itabs-yjfz.
itabs-dysy = 0 - itabs-dysy.
itabs-dysdsf = 0 - itabs-dysdsf.
itabs-qtcqfz = 0 - itabs-qtcqfz.
itabs-fldfzhj = 0 - itabs-fldfzhj.
itabs-fzhj = 0 - itabs-fzhj.
itabs-sszb = 0 - itabs-sszb.
itabs-zbgj = 0 - itabs-zbgj.
itabs-qtzhsy = 0 - itabs-qtzhsy.
itabs-yygj = 0 - itabs-yygj.
itabs-gyj = 0 - itabs-gyj.
itabs-wfplr = 0 - itabs-wfplr.
itabs-syzqlhj = 0 - itabs-syzqlhj.
itabs-fzsyhj = 0 - itabs-fzsyhj.
jtab-yshzzb = 0 - jtab-yshzzb.
jtab-qthzzb = 0 - jtab-qthzzb.
* 20190106 amber insert s
jtab-cqhzzb = 0 - jtab-cqhzzb.
* 20190106 amber insert e
jtab-chdjzb = 0 - jtab-chdjzb.
jtab-ljzj = 0 - jtab-ljzj.
jtab-gdzcjzz = 0 - jtab-gdzcjzz.
jtab-dqjk = 0 - jtab-dqjk.
jtab-jyxjrf = 0 - jtab-jyxjrf.
jtab-yfpj = 0 - jtab-yfpj.
jtab-yfzk = 0 - jtab-yfzk.
jtab-yuszk = 0 - jtab-yuszk.
jtab-yfzgxc = 0 - jtab-yfzgxc.
jtab-yjsf = 0 - jtab-yjsf.
jtab-yflx = 0 - jtab-yflx.
jtab-yfgl = 0 - jtab-yfgl.
jtab-qtyfk = 0 - jtab-qtyfk.
jtab-ytfy = 0 - jtab-ytfy.
jtab-qtldfz = 0 - jtab-qtldfz.
jtab-ldfzhj = 0 - jtab-ldfzhj.
jtab-cqjk = 0 - jtab-cqjk.
jtab-yfzq = 0 - jtab-yfzq.
jtab-cqyfk = 0 - jtab-cqyfk.
jtab-zxyfk = 0 - jtab-zxyfk.
jtab-yjfz = 0 - jtab-yjfz.
jtab-dysy = 0 - jtab-dysy.
jtab-dysdsf = 0 - jtab-dysdsf.
jtab-qtcqfz = 0 - jtab-qtcqfz.
jtab-fldfzhj = 0 - jtab-fldfzhj.
jtab-fzhj = 0 - jtab-fzhj.
jtab-sszb = 0 - jtab-sszb.
jtab-zbgj = 0 - jtab-zbgj.
jtab-qtzhsy = 0 - jtab-qtzhsy.
jtab-yygj = 0 - jtab-yygj.
jtab-gyj = 0 - jtab-gyj.
jtab-wfplr = 0 - jtab-wfplr.
jtab-syzqlhj = 0 - jtab-syzqlhj.
jtab-fzsyhj = 0 - jtab-fzsyhj.
ENDIF.
* 20181107 liujinghua ADD S
WRITE itabs-nbwl TO i_nbwl.
CONDENSE i_nbwl NO-GAPS.
ilen1 = 76 - STRLEN( i_nbwl ).
WRITE jtab-nbwl TO j_nbwl.
CONDENSE j_nbwl NO-GAPS.
jlen1 = 54 - STRLEN( j_nbwl ).
WRITE itabs-qtyszkje TO i_qtyszkje.
CONDENSE i_qtyszkje NO-GAPS.
ilen2 = 76 - STRLEN( i_qtyszkje ).
WRITE jtab-qtyszkje TO j_qtyszkje.
CONDENSE j_qtyszkje NO-GAPS.
jlen2 = 54 - STRLEN( j_qtyszkje ).
WRITE itabs-nmfqfk TO i_nmfqfk.
CONDENSE i_nmfqfk NO-GAPS.
ilen3 = 142 - STRLEN( i_nmfqfk ).
WRITE jtab-ncfqfk TO j_ncfqfk.
CONDENSE j_ncfqfk NO-GAPS.
jlen3 = 142 - STRLEN( j_ncfqfk ).
* 20181107 liujinghua ADD E
PERFORM output_format USING: '流 动 资 产:' ' ' ' ' ' '
'流 动 负 债:' ' ' ' ' ' '.
PERFORM output_format USING:' 货 币 资 金' '1' jtab-hbzj itabs-hbzj
' 短 期 借 款' '43' jtab-dqjk itabs-dqjk.
PERFORM output_format USING ' 以公允价值计量且其变动' '' '' ''
' 以公允价值计量且其变动' '' '' ''.
PERFORM output_format USING '' '2' jtab-jyxjrz itabs-jyxjrz
'' '44' jtab-jyxjrf itabs-jyxjrf.
PERFORM output_format USING ' 计入当期损益的金融资产' '' '' ''
' 计入当期损益的金融负债' '' '' ''.
PERFORM output_format USING ' 应 收 票 据' '3' jtab-yspj itabs-yspj
' 应 付 票 据' '45' jtab-yfpj itabs-yfpj.
PERFORM output_format USING ' 应 收 帐 款' '4' jtab-yszk itabs-yszk
' 应 付 帐 款' '46' jtab-yfzk itabs-yfzk.
PERFORM output_format USING ' 减:坏 账 准 备' '5' jtab-yshzzb itabs-yshzzb
' 预 收 帐 款' '47' jtab-yuszk itabs-yuszk.
PERFORM output_format USING ' 应 收 账 款 净 额' '6' jtab-yszkje itabs-yszkje
' 应 付 职 工 薪 酬' '48' jtab-yfzgxc itabs-yfzgxc.
PERFORM output_format USING ' 预 付 帐 款' '7' jtab-yufzk itabs-yufzk
' 应 交 税 费' '49' jtab-yjsf itabs-yjsf.
PERFORM output_format USING ' 应 收 利 息' '8' jtab-yslx itabs-yslx
' 应 付 利 息' '50' jtab-yflx itabs-yflx.
PERFORM output_format USING ' 应 收 股 利' '9' jtab-ysgl itabs-ysgl
' 应 付 股 利' '51' jtab-yfgl itabs-yfgl.
PERFORM output_format USING ' 其 他 应 收 款' '10' jtab-qtysk itabs-qtysk
' 其 他 应 付 款' '52' jtab-qtyfk itabs-qtyfk.
PERFORM output_format USING ' 减:坏 账 准 备' '11' jtab-qthzzb itabs-qthzzb
' 预 提 费 用' '53' jtab-ytfy itabs-ytfy.
PERFORM output_format USING ' ' '' '' ''
' 划分为持有待售的' '' ' ' ' '.
PERFORM output_sformat USING:' 其 他 应 收 款 净 额' '12' jlen2 j_qtyszkje ilen2 i_qtyszkje
'' '54' ' ' ' '.
PERFORM output_format USING ' ' '' '' ''
' 处置组中的负债' '' ' ' ' '. "modify
PERFORM output_format USING ' 存 货' '13' jtab-cuih itabs-cuih
' 一年内到期的非流动负债' '55' ' ' ' '.
PERFORM output_format USING ' 减:存 货 跌 价 准 备' '14' jtab-chdjzb itabs-chdjzb
' 其 它 流 动 负 债' '56' ' ' ' '.
PERFORM output_format USING ' 存 货 净 额' '15' jtab-chje itabs-chje
' ' ' ' ' ' ' '.
PERFORM output_format USING ' 划分为持有待售的非流动' '' '' ''
'' '' '' ''.
PERFORM output_format USING ' ' '' '' ''
'' '' '' ''.
PERFORM output_format USING ' 资产及被划分为持有待售' '16' '' ''
'流 动 负 债 合 计' '57' jtab-ldfzhj itabs-ldfzhj.
PERFORM output_format USING ' ' '' '' ''
'' '' '' ''.
PERFORM output_format USING ' 的处置组中的资产' '' '' ''
'' '' '' ''.
PERFORM output_format USING ' 待 摊 费 用' '17' jtab-dtfei itabs-dtfei
'非 流 动 负 债:' ' ' ' ' ' '.
PERFORM output_format USING ' 一年内到期的非流动资产' '18' ' ' ' '
' 长 期 借 款' '58' jtab-cqjk itabs-cqjk.
PERFORM output_format USING ' 其 他 流 动 资 产' '19' jtab-qtldzc itabs-qtldzc
' 应 付 债 券' '59' jtab-yfzq itabs-yfzq.
PERFORM output_sformat USING:' 内 部 往 来' '20' jlen1 j_nbwl ilen1 i_nbwl
' 长 期 应 付 款' '60' jtab-cqyfk itabs-cqyfk.
PERFORM output_format USING '流 动 资 产 合 计' '21' jtab-ldzchj itabs-ldzchj
' 专 项 应 付 款' '61' jtab-zxyfk itabs-zxyfk.
PERFORM output_format USING '非 流 动 资 产:' ' ' ' ' ' '
' 预 计 负 债' '62' jtab-yjfz itabs-yjfz.
PERFORM output_format USING ' 可供出售金融资产' '22' jtab-kgcsjr itabs-kgcsjr
' 递 延 收 益' '63' jtab-dysy itabs-dysy.
PERFORM output_format USING ' 持 有 至 到 期 投 资' '23' jtab-cyzdq itabs-cyzdq
' 递 延 所 得 税 负 债' '64' jtab-dysdsf itabs-dysdsf.
PERFORM output_format USING ' 长 期 应 收 款' '24' jtab-cqysk itabs-cqysk
' 其 他 长 期 负 债' '65' jtab-qtcqfz itabs-qtcqfz.
PERFORM output_format USING ' 长 期 股 权 投 资' '25' jtab-cqgq itabs-cqgq
' 其他非流动负债' '66' ' ' ' '.
PERFORM output_format USING ' 投 资 性 房 地 产' '26' jtab-tzxfdc itabs-tzxfdc
' ' ' ' ' ' ' '.
PERFORM output_format USING ' 固 定 资 产 原 价' '27' jtab-gdzc itabs-gdzc
' 非 流 动 负 债 合 计' '67' jtab-fldfzhj itabs-fldfzhj.
PERFORM output_format USING ' 减:累 计 折 旧' '28' jtab-ljzj itabs-ljzj
' 负 债 合 计' '68' jtab-fzhj itabs-fzhj.
PERFORM output_format USING ' 固 定 资 产 净 值' '29' jtab-gdzcjz itabs-gdzcjz
'所 有 者 权 益:' ' ' ' ' ' '.
PERFORM output_format USING ' 减:固定资产减值准备' '30' jtab-gdzcjzz itabs-gdzcjzz
' 股 本' '69' jtab-sszb itabs-sszb.
PERFORM output_format USING ' 固 定 资 产 净 额' '31' jtab-gdzcje itabs-gdzcje
' 资 本 公 积' '70' jtab-zbgj itabs-zbgj.
PERFORM output_format USING ' 在 建 工 程' '32' jtab-zjgc itabs-zjgc
' 其 他 综 合 收 益' '71' jtab-qtzhsy itabs-qtzhsy.
PERFORM output_format USING ' 工 程 物 资' '33' jtab-gcwz itabs-gcwz
' 减:库 存 股' '72' jtab-kcg itabs-kcg.
PERFORM output_format USING ' 固 定 资 产 清 理' '34' jtab-gdzcql itabs-gdzcql
' 盈 余 公 积' '73' jtab-yygj itabs-yygj.
PERFORM output_format USING ' 无 形 资 产' '35' jtab-wxzc itabs-wxzc
' 其 中:公 益 金' '74' jtab-gyj itabs-gyj.
PERFORM output_format USING ' 开 发 支 出' '36' jtab-kfzc itabs-kfzc
' 未 分 配 利 润' '75' jtab-wfplr itabs-wfplr.
PERFORM output_format USING ' 商 誉' '37' jtab-sy itabs-sy
' 其中:已宣告未发放的现金股利' '76' ' ' ' '.
PERFORM output_format USING ' 长 期 待 摊 费 用' '38' jtab-cqdtf itabs-cqdtf
' 外 币 折 算 差 额 ' '77' ' ' ' '.
PERFORM output_format USING ' 递 延 所 得 税 资 产' '39' jtab-dysdsz itabs-dysdsz
' 累积未弥补子公司亏损' '78' ' ' ' '.
PERFORM output_format USING ' 其 他 长 期 资 产' '40' jtab-qtcqzc itabs-qtcqzc
' ' ' ' ' ' ' '.
PERFORM output_format USING ' 其 他 非 流 动 资 产' '41' jtab-qtfld itabs-qtfld
' 股 东 权 益 合 计' '79' jtab-syzqlhj itabs-syzqlhj.
PERFORM output_format USING ' 非 流 动 资 产 合 计' '42' jtab-fldzchj itabs-fldzchj
' ' ' ' ' ' ' '.
PERFORM output_format USING '资 产 总 计' '43' jtab-zchj itabs-zchj
'负债和股东权益总计' '80' jtab-fzsyhj itabs-fzsyhj.
WRITE:'补 充 资 料:'.
SKIP 1.
WRITE:/ '年 初 存 货 库 存 情 况:'.
SKIP 1.
CONDENSE j_ncfqfk NO-GAPS.
WRITE:/2'原 材 料:',jtab-ncycl,38 '元',
41 '库存商品:',jtab-ncsp,73 '元',
77 '自制半成品:',jtab-ncbcp,
* 20181107 AMBER MODIFY S
* 110'元',
* 113 '分期收款发出商品:'.
111'元',
114 '分期收款发出商品:'.
* 20181107 AMBER MODIFY E
IF jlen3 = 142.
WRITE: jtab-ncfqfk ,154'元'.
ELSE.
WRITE: 131 j_ncfqfk RIGHT-JUSTIFIED,154'元'.
ENDIF.
SKIP 1.
WRITE:/2 '委托加工物资:',jtab-ncwtjg,38 '元',
41 '在 制 品:',jtab-nczzp,73 '元',
77 '低值易耗品:', jtab-ncdzyh,
* 20181107 AMBER MODIFY S
* 110 '元',
* 113 '包 装 物: ',
* jtab-ncbzw,153 '元'. "add by zhj 2006.05.11
111 '元',
114 '包 装 物: ',
jtab-ncbzw,154 '元'. "add by zhj 2006.05.11
* 20181107 AMBER MODIFY E
SKIP 1.
WRITE:/ '月 底 存 货 库 存 情 况:'.
SKIP 1.
CONDENSE i_nmfqfk NO-GAPS.
WRITE:/2'原 材 料:',itabs-nmycl,38 '元',
41 '库存商品:',itabs-nmsp,73 '元',
77 '自制半成品:',itabs-nmbcp,
* 20181107 AMBER MODIFY S
* 110'元',
* 113 '分期收款发出商品:'.
111'元',
114 '分期收款发出商品:'.
* 20181107 AMBER MODIFY E
IF ilen3 = 142.
WRITE: itabs-nmfqfk ,154'元'.
ELSE.
WRITE: 131 i_nmfqfk RIGHT-JUSTIFIED,154'元'.
ENDIF.
SKIP 1.
WRITE:/2 '委托加工物资:',itabs-nmwtjg,38 '元',
41 '在 制 品:',itabs-nmzzp,73 '元',
77 '低值易耗品:', itabs-nmdzyh,
* 20181107 AMBER MODIFY S
* 110'元',
* 113 '包 装 物: ',
* itabs-nmbzw ,153'元'. "add by zhj 2006.5.11
111'元',
114 '包 装 物: ',
itabs-nmbzw ,154'元'. "add by zhj 2006.5.11
* 20181107 AMBER MODIFY E
SKIP 1.
WRITE:/ '单位负责人:',50 '主管会计工作负责人:',100 '会计机构负责人:'
.
ENDFORM. "write_bs
*&---------------------------------------------------------------------*
*& Form WRITE_report_ender
*&---------------------------------------------------------------------*
FORM write_report_ender.
WRITE:/ ' 核 准:',40 '财务主管:',83 '复 核:',123 '制 表:'.
ENDFORM. "write_report_ender
*&---------------------------------------------------------------------*
*& Form con_wfplr
*&---------------------------------------------------------------------*
FORM con_wfplr. "未分配利润
SELECT * FROM glt0
WHERE ryear = ryear AND
bukrs = bukrs AND
rbusa IN rbusa AND "限定业务范围 ZHJ 2006.04.01
( racct between '0051010000' and '0059999999'
or racct = '0090000004' or racct = '0090000006' ).
jtab-wfplr = jtab-wfplr + glt0-hslvt.
CASE perid.
WHEN '1'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01.
WHEN '2'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02.
WHEN '3'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03.
WHEN '4'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04.
WHEN '5'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05.
WHEN '6'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06.
WHEN '7'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07.
WHEN '8'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08.
WHEN '9'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09.
WHEN '10'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10.
WHEN '11'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11.
WHEN '12'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11 + glt0-hsl12.
WHEN '13'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11 + glt0-hsl12 + glt0-hsl13 .
WHEN '14'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11 + glt0-hsl12 + glt0-hsl13
+ glt0-hsl14.
WHEN '15'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11 + glt0-hsl12 + glt0-hsl13
+ glt0-hsl14 + glt0-hsl15.
WHEN '16'.
itabs-wfplr = itabs-wfplr + glt0-hslvt + glt0-hsl01
+ glt0-hsl02 + glt0-hsl03 + glt0-hsl04
+ glt0-hsl05 + glt0-hsl06 + glt0-hsl07
+ glt0-hsl08 + glt0-hsl09 + glt0-hsl10
+ glt0-hsl11 + glt0-hsl12 + glt0-hsl13
+ glt0-hsl14 + glt0-hsl15 + glt0-hsl16.
ENDCASE.
ENDSELECT.
ENDFORM. " con_wfplr
*&---------------------------------------------------------------------*
*& Form AUTHRIZATION
*&---------------------------------------------------------------------*
FORM authrization.
ENDFORM. " AUTHRIZATION
*&---------------------------------------------------------------------*
*& Form cal_day
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM cal_day.
CONDENSE perid NO-GAPS.
IF perid+0(1) = '0'.
perid = perid+1(1).
ENDIF.
IF perid = '4' OR perid = '6' OR
perid = '9' OR perid = '11'.
e_day = '30'.
ELSEIF perid = '2'.
p_mod = ryear MOD 4.
IF p_mod = 0.
e_day = '29'.
ELSE.
e_day = '28'.
ENDIF.
ELSE.
e_day = '31'.
ENDIF.
CONDENSE e_day NO-GAPS.
ENDFORM. " cal_day
*&---------------------------------------------------------------------*
*& Form select_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM select_data .
SELECT * INTO CORRESPONDING FIELDS OF TABLE itab FROM glt0
WHERE ryear = ryear
AND bukrs = bukrs
AND rbusa IN rbusa
AND rldnr = '00'
AND rrcty = '0' "0:实际发生; 1:表示计划发生
AND racct > '0010000000'
AND racct <= '0099990000'.
SORT itab BY racct.
ENDFORM. " select_data
*&---------------------------------------------------------------------*
*& Form Process_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM process_data .
DATA: jkm1404 LIKE glt0-hslvt,
jkm1422 LIKE glt0-hslvt,
jkm1511 LIKE glt0-hslvt,
jkm1515 LIKE glt0-hslvt,
jkm1516 LIKE glt0-hslvt,
jkm1801 LIKE glt0-hslvt,
jkm1804 LIKE glt0-hslvt,
jkm1825 LIKE glt0-hslvt,
jkm1826 LIKE glt0-hslvt,
ikm1404 LIKE glt0-hslvt,
ikm1422 LIKE glt0-hslvt,
ikm1511 LIKE glt0-hslvt,
ikm1515 LIKE glt0-hslvt,
ikm1516 LIKE glt0-hslvt,
ikm1801 LIKE glt0-hslvt,
ikm1804 LIKE glt0-hslvt,
ikm1825 LIKE glt0-hslvt,
ikm1826 LIKE glt0-hslvt.
LOOP AT itab.
CASE perid.
WHEN '1'.
itab-tamount = itab-hslvt + itab-hsl01.
WHEN '2'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02.
WHEN '3'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
.
WHEN '4'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04.
WHEN '5'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05.
WHEN '6'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06
.
WHEN '7'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
.
WHEN '8'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08.
WHEN '9'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09.
WHEN '10'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10.
WHEN '11'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
.
WHEN '12'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
+ itab-hsl12.
WHEN '13'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
+ itab-hsl12 + itab-hsl13.
WHEN '14'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
+ itab-hsl12 + itab-hsl13 + itab-hsl14.
WHEN '15'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
+ itab-hsl12 + itab-hsl13 + itab-hsl14 + itab-hsl15
.
WHEN '16'.
itab-tamount = itab-hslvt + itab-hsl01 + itab-hsl02 + itab-hsl03
+ itab-hsl04 + itab-hsl05 + itab-hsl06 + itab-hsl07
+ itab-hsl08 + itab-hsl09 + itab-hsl10 + itab-hsl11
+ itab-hsl12 + itab-hsl13 + itab-hsl14 + itab-hsl15
+ itab-hsl16.
ENDCASE.
MODIFY itab INDEX sy-tabix.
CASE itab-racct+2(4).
***************流动资产
WHEN '1001' OR '1002' OR '1003' OR '1004' OR '1005' OR '1006'
OR '1007' OR '1008' OR '1009'. "货币资金
itabs-hbzj = itabs-hbzj + itab-tamount.
jtab-hbzj = jtab-hbzj + itab-hslvt.
WHEN '1403'. "以公允价值计量且其变动计入当期损益的金融资产=1403+1406
itabs-jyxjrz = itabs-jyxjrz + itab-tamount.
jtab-jyxjrz = jtab-jyxjrz + itab-hslvt.
WHEN '1406'. "以公允价值计量且其变动计入当期损益的金融资产
itabs-jyxjrz = itabs-jyxjrz + itab-tamount.
jtab-jyxjrz = jtab-jyxjrz + itab-hslvt.
WHEN '1111' . "应收票据
itabs-yspj = itabs-yspj + itab-tamount.
jtab-yspj = jtab-yspj + itab-hslvt.
WHEN '1131'. "应收帐款
* IF itab-racct+2(4) = '1131' OR itab-racct = '0090000005'. "Modify by Rex on 2011.8.15
itabs-yszk = itabs-yszk + itab-tamount.
jtab-yszk = jtab-yszk + itab-hslvt.
* ENDIF.
WHEN '1141'. "坏帐准备-应收帐款
IF itab-racct+2(6) = '114101' OR itab-racct = '0011419999'. "坏帐准备-应收帐款
itabs-yshzzb = itabs-yshzzb + itab-tamount.
jtab-yshzzb = jtab-yshzzb + itab-hslvt.
ENDIF.
IF itab-racct+2(6) = '114102' OR itab-racct = '0011419998'. "坏帐准备-其他应收款
itabs-qthzzb = itabs-qthzzb + itab-tamount.
jtab-qthzzb = jtab-qthzzb + itab-hslvt.
ENDIF.
* 20190106 AMBER INSERT S
IF itab-racct+2(6) = '114103' OR itab-racct = '0011419998'. "坏帐准备-长期应收款
itabs-cqhzzb = itabs-cqhzzb + itab-tamount.
jtab-cqhzzb = jtab-cqhzzb + itab-hslvt.
ENDIF.
* 20190106 AMBER INSERT E
WHEN '1151'. "预付帐款
itabs-yufzk = itabs-yufzk + itab-tamount.
jtab-yufzk = jtab-yufzk + itab-hslvt.
WHEN '1122'. "应收利息
itabs-yslx = itabs-yslx + itab-tamount.
jtab-yslx = jtab-yslx + itab-hslvt.
WHEN '1121'. "应收股利
itabs-ysgl = itabs-ysgl + itab-tamount.
jtab-ysgl = jtab-ysgl + itab-hslvt.
WHEN '1133' . "其他应收款
itabs-qtysk = itabs-qtysk + itab-tamount.
jtab-qtysk = jtab-qtysk + itab-hslvt.
WHEN '1201' OR '1211' OR '1221' OR '1231' OR '1232' OR '1241' OR '1242' OR
'1243' OR '1244' OR '1251' OR '1261' OR '1271' OR '1291'. "存货
itabs-cuih = itabs-cuih + itab-tamount.
jtab-cuih = jtab-cuih + itab-hslvt.
IF itab-racct+2(4) = '1211' OR itab-racct = '0012320101'. "原材料存货
itabs-nmycl = itabs-nmycl + itab-tamount.
jtab-ncycl = jtab-ncycl + itab-hslvt.
ELSEIF itab-racct+2(4) = '1243'. "库存商品
itabs-nmsp = itabs-nmsp + itab-tamount.
jtab-ncsp = jtab-ncsp + itab-hslvt.
ELSEIF itab-racct+2(4) = '1241'. "自制半成品
itabs-nmbcp = itabs-nmbcp + itab-tamount.
jtab-ncbcp = jtab-ncbcp + itab-hslvt.
ELSEIF itab-racct+2(4) = '1291'. "分期付款发出商品
itabs-nmfqfk = itabs-nmfqfk + itab-tamount.
jtab-ncfqfk = jtab-ncfqfk + itab-hslvt.
ELSEIF itab-racct+2(4) = '1251'. "委托加工物资
itabs-nmwtjg = itabs-nmwtjg + itab-tamount.
jtab-ncwtjg = jtab-ncwtjg + itab-hslvt.
ELSEIF itab-racct+2(4) = '1242'. "在制品
itabs-nmzzp = itabs-nmzzp + itab-tamount.
jtab-nczzp = jtab-nczzp + itab-hslvt.
ELSEIF itab-racct+2(4) = '1231'. "低值易耗品
itabs-nmdzyh = itabs-nmdzyh + itab-tamount.
jtab-ncdzyh = jtab-ncdzyh + itab-hslvt.
ELSEIF itab-racct+2(4) = '1221'. "包装物
itabs-nmbzw = itabs-nmbzw + itab-tamount.
jtab-ncbzw = jtab-ncbzw + itab-hslvt.
ENDIF.
WHEN '1281'. "存货跌价准备
itabs-chdjzb = itabs-chdjzb + itab-tamount.
jtab-chdjzb = jtab-chdjzb + itab-hslvt.
WHEN '1301'. "待摊费用
itabs-dtfei = itabs-dtfei + itab-tamount.
jtab-dtfei = jtab-dtfei + itab-hslvt.
WHEN '1911' OR '1431' . " OR '1432'. "其他流动资产 zhj 2011.4.1
itabs-qtldzc = itabs-qtldzc + itab-tamount.
jtab-qtldzc = jtab-qtldzc + itab-hslvt.
WHEN '1999'. "内部往来
itabs-nbwl = itabs-nbwl + itab-tamount.
jtab-nbwl = jtab-nbwl + itab-hslvt.
**************非流动资产
WHEN '1405'. "可供出售金融资产
itabs-kgcsjr = itabs-kgcsjr + itab-tamount.
jtab-kgcsjr = jtab-kgcsjr + itab-hslvt.
WHEN '1404' OR '1422' . "持有至到期投资
IF itab-racct+2(4) = '1404' .
ikm1404 = ikm1404 + itab-tamount.
jkm1404 = jkm1404 + itab-hslvt.
ELSE.
ikm1422 = ikm1422 + itab-tamount.
jkm1422 = jkm1422 + itab-hslvt.
ENDIF.
itabs-cyzdq = ikm1404 - ikm1422.
jtab-cyzdq = jkm1404 - jkm1422.
WHEN '1171'. "长期应收款
itabs-cqysk = itabs-cqysk + itab-tamount.
jtab-cqysk = jtab-cqysk + itab-hslvt.
WHEN '1401' . "长期股权投资
itabs-cqgq = itabs-cqgq + itab-tamount.
jtab-cqgq = jtab-cqgq + itab-hslvt.
WHEN '1421' . "长期投资减值准备
itabs-cqgqjz = itabs-cqgqjz + itab-tamount.
jtab-cqgqjz = jtab-cqgqjz + itab-hslvt.
WHEN '1511' OR '1515' OR '1516'. "投资性房地产
IF itab-racct+2(4) = '1511' .
ikm1511 = ikm1511 + itab-tamount.
jkm1511 = jkm1511 + itab-hslvt.
ELSEIF itab-racct+2(4) = '1515'.
ikm1515 = ikm1515 + itab-tamount.
jkm1515 = jkm1515 + itab-hslvt.
ELSE.
ikm1516 = ikm1516 + itab-tamount.
jkm1516 = jkm1516 + itab-hslvt.
ENDIF.
itabs-tzxfdc = ikm1511 - ikm1515 - ikm1516.
jtab-tzxfdc = jkm1511 - jkm1515 - jkm1516.
WHEN '1501'. "固定资产
itabs-gdzc = itabs-gdzc + itab-tamount.
jtab-gdzc = jtab-gdzc + itab-hslvt.
WHEN '1502'. "累计折旧
itabs-ljzj = itabs-ljzj + itab-tamount.
jtab-ljzj = jtab-ljzj + itab-hslvt.
WHEN '1505' . "固定资产减值准备
itabs-gdzcjzz = itabs-gdzcjzz + itab-tamount.
jtab-gdzcjzz = jtab-gdzcjzz + itab-hslvt.
WHEN '1603' OR '1605'. "在建工程
itabs-zjgc = itabs-zjgc + itab-tamount.
jtab-zjgc = jtab-zjgc + itab-hslvt.
WHEN '1601'. "工程物资
itabs-gcwz = itabs-gcwz + itab-tamount.
jtab-gcwz = jtab-gcwz + itab-hslvt.
WHEN '1701'. "固定资产清理
itabs-gdzcql = itabs-gdzcql + itab-tamount.
jtab-gdzcql = jtab-gdzcql + itab-hslvt.
WHEN '1801' OR '1804' . "无形资产
IF itab-racct+2(4) = '1801' .
ikm1801 = ikm1801 + itab-tamount.
jkm1801 = jkm1801 + itab-hslvt.
ELSE.
ikm1804 = ikm1804 + itab-tamount.
jkm1804 = jkm1804 + itab-hslvt.
ENDIF.
itabs-wxzc = ikm1801 + ikm1804.
jtab-wxzc = jkm1801 + jkm1804.
WHEN '1609'. "开发支出
itabs-kfzc = itabs-kfzc + itab-tamount.
jtab-kfzc = jtab-kfzc + itab-hslvt.
WHEN '1825' OR '1826' . "商誉
IF itab-racct+2(4) = '1825' .
ikm1825 = ikm1825 + itab-tamount.
jkm1825 = jkm1825 + itab-hslvt.
ELSE.
ikm1826 = ikm1826 + itab-tamount.
jkm1826 = jkm1826 + itab-hslvt.
ENDIF.
itabs-sy = ikm1825 - ikm1826.
jtab-sy = jkm1825 - jkm1826.
WHEN '1901'. "长期待摊费用
itabs-cqdtf = itabs-cqdtf + itab-tamount.
jtab-cqdtf = jtab-cqdtf + itab-hslvt.
WHEN '1851'. "递延所得税资产
itabs-dysdsz = itabs-dysdsz + itab-tamount.
jtab-dysdsz = jtab-dysdsz + itab-hslvt.
WHEN '1802'. "其他长期资产
itabs-qtcqzc = itabs-qtcqzc + itab-tamount.
jtab-qtcqzc = jtab-qtcqzc + itab-hslvt.
WHEN '1815'. "其他非流动资产
itabs-qtfld = itabs-qtfld + itab-tamount.
jtab-qtfld = jtab-qtfld + itab-hslvt.
*****************流动负债
WHEN '2101'. "短期借款
itabs-dqjk = itabs-dqjk + itab-tamount.
jtab-dqjk = jtab-dqjk + itab-hslvt.
WHEN '2102'. "以公允价值计量且其变动计入当期损益的金融负债
itabs-jyxjrf = itabs-jyxjrf + itab-tamount.
jtab-jyxjrf = jtab-jyxjrf + itab-hslvt.
WHEN '2103'. "以公允价值计量且其变动计入当期损益的金融负债 add
itabs-jyxjrf = itabs-jyxjrf + itab-tamount.
jtab-jyxjrf = jtab-jyxjrf + itab-hslvt.
WHEN '2111'. "应付票据
itabs-yfpj = itabs-yfpj + itab-tamount.
jtab-yfpj = jtab-yfpj + itab-hslvt.
WHEN '2121'. "应付帐款
* IF itab-racct+2(4) = '2121' OR itab-racct = '0090000007'. "Modify by Rex on 2011.8.15
itabs-yfzk = itabs-yfzk + itab-tamount.
jtab-yfzk = jtab-yfzk + itab-hslvt.
* ENDIF.
WHEN '2131'. "预收帐款
itabs-yuszk = itabs-yuszk + itab-tamount.
jtab-yuszk = jtab-yuszk + itab-hslvt.
WHEN '2154'. "应付职工薪酬
itabs-yfzgxc = itabs-yfzgxc + itab-tamount.
jtab-yfzgxc = jtab-yfzgxc + itab-hslvt.
WHEN '2178' OR '2171'. "应交税费
itabs-yjsf = itabs-yjsf + itab-tamount.
jtab-yjsf = jtab-yjsf + itab-hslvt.
WHEN '2221'. "应付利息
itabs-yflx = itabs-yflx + itab-tamount.
jtab-yflx = jtab-yflx + itab-hslvt.
WHEN '2161'. "应付股利
itabs-yfgl = itabs-yfgl + itab-tamount.
jtab-yfgl = jtab-yfgl + itab-hslvt.
WHEN '2181'. "其他应付款
itabs-qtyfk = itabs-qtyfk + itab-tamount.
jtab-qtyfk = jtab-qtyfk + itab-hslvt.
WHEN '2191'. "预提费用
itabs-ytfy = itabs-ytfy + itab-tamount.
jtab-ytfy = jtab-ytfy + itab-hslvt.
************************非流动负债
WHEN '2223'. "长期借款
itabs-cqjk = itabs-cqjk + itab-tamount.
jtab-cqjk = jtab-cqjk + itab-hslvt.
WHEN '2311'. "应付债券
itabs-yfzq = itabs-yfzq + itab-tamount.
jtab-yfzq = jtab-yfzq + itab-hslvt.
WHEN '2321'. "长期应付款
itabs-cqyfk = itabs-cqyfk + itab-tamount.
jtab-cqyfk = jtab-cqyfk + itab-hslvt.
WHEN '2331'. "专项应付款
itabs-zxyfk = itabs-zxyfk + itab-tamount.
jtab-zxyfk = jtab-zxyfk + itab-hslvt.
WHEN '2211'. "预计负债
itabs-yjfz = itabs-yjfz + itab-tamount.
jtab-yjfz = jtab-yjfz + itab-hslvt.
WHEN '2212'. "递延收益
itabs-dysy = itabs-dysy + itab-tamount.
jtab-dysy = jtab-dysy + itab-hslvt.
WHEN '2341'. "递延所得税负债
** IF ITAB-DRCRK = 'S'. zhj 2011.4.2
** ELSE.
itabs-dysdsf = itabs-dysdsf + itab-tamount.
jtab-dysdsf = jtab-dysdsf + itab-hslvt.
** ENDIF.
WHEN '2999'. "其他长期负债
itabs-qtcqfz = itabs-qtcqfz + itab-tamount.
jtab-qtcqfz = jtab-qtcqfz + itab-hslvt.
**********************所有者权益
WHEN '3101' OR '3102'. "实收资本(或股本) add by zhj 2006-12-13
itabs-sszb = itabs-sszb + itab-tamount.
jtab-sszb = jtab-sszb + itab-hslvt.
WHEN '3111'. "资本公积
itabs-zbgj = itabs-zbgj + itab-tamount.
jtab-zbgj = jtab-zbgj + itab-hslvt.
WHEN '3161'. "其他综合收益
itabs-qtzhsy = itabs-qtzhsy + itab-tamount.
jtab-qtzhsy = jtab-qtzhsy + itab-hslvt.
WHEN '3151'. "库存股
itabs-kcg = itabs-kcg + itab-tamount.
jtab-kcg = jtab-kcg + itab-hslvt.
WHEN '3121'. "盈余公积
itabs-yygj = itabs-yygj + itab-tamount.
jtab-yygj = jtab-yygj + itab-hslvt.
IF itab-racct = '0031210301' OR itab-racct = '0031210201'. "公益金
itabs-gyj = itabs-gyj + itab-tamount.
jtab-gyj = jtab-gyj + itab-hslvt.
ENDIF.
WHEN '3131' OR '3141'. "未分配利润
itabs-wfplr = itabs-wfplr + itab-tamount.
jtab-wfplr = jtab-wfplr + itab-hslvt.
ENDCASE.
IF itab-racct = '0090000002'.
itabs-yjsf = itabs-yjsf + itab-tamount.
jtab-yjsf = jtab-yjsf + itab-hslvt.
ENDIF.
IF itab-racct = '0090000005'.
itabs-yszk = itabs-yszk + itab-tamount.
jtab-yszk = jtab-yszk + itab-hslvt.
ENDIF.
IF itab-racct = '0090000007'.
itabs-yfzk = itabs-yfzk + itab-tamount.
jtab-yfzk = jtab-yfzk + itab-hslvt.
ENDIF.
MODIFY jtab INDEX sy-tabix.
MODIFY itabs INDEX sy-tabix.
ENDLOOP.
ENDFORM. " Process_data
*&---------------------------------------------------------------------*
*& Form output_format
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ZCDES 资产边描述
* -->P_ZCL 资产边行次
* -->P_ZCCV 资产边期初值
* -->P_ZCV 资产边期未值
* -->P_FJDES 负债边描述
* -->P_FJL 负债边行次
* -->P_FJCV 负债边期初值
* -->P_FJV 负债边期未值
*----------------------------------------------------------------------*
FORM output_format USING p_zcdes
p_zcl
p_zccv
p_zcv
p_fjdes
p_fjl
p_fjcv
p_fjv.
WRITE:/ sy-vline NO-GAP,p_zcdes,28 sy-vline NO-GAP,
30 p_zcl.
IF p_zccv NE 0 .
WRITE: 33 sy-vline NO-GAP, p_zccv.
ELSE.
WRITE: 33 sy-vline NO-GAP.
ENDIF.
IF p_zcv NE 0 .
WRITE: 55 sy-vline NO-GAP, p_zcv.
ELSE.
WRITE: 55 sy-vline NO-GAP.
ENDIF.
WRITE: 77 sy-vline NO-GAP,p_fjdes,
106 sy-vline NO-GAP,108 p_fjl.
IF p_fjcv NE 0 .
WRITE: 111 sy-vline NO-GAP, p_fjcv.
ELSE.
WRITE: 111 sy-vline NO-GAP.
ENDIF.
IF p_fjv NE 0 .
WRITE: 133 sy-vline NO-GAP, p_fjv.
ELSE.
WRITE: 133 sy-vline NO-GAP.
ENDIF.
WRITE: 155 sy-vline.
* IF p_zcdes = ' 以公允价值计量且其变动'.
* ELSE.
* ULINE.
* ENDIF.
case p_zcdes.
when ' 以公允价值计量且其变动' or ' 划分为持有待售的非流动' or ' 资产及被划分为持有待售' or ' 其 他 应 收 款 净 额'.
when ''.
if p_fjdes = ' 处置组中的负债'.
uline.
endif.
when others.
uline.
endcase.
ENDFORM. " output_format
*&---------------------------------------------------------------------*
*& Form OUTPUT_SFORMAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_1579 text
* -->P_1580 text
* -->P_JLEN1 text
* -->P_JTAB_HBZJ text
* -->P_ILEN1 text
* -->P_ITABS_HBZJ text
* -->P_1585 text
* -->P_1586 text
* -->P_JTAB_DQJK text
* -->P_ITABS_DQJK text
*----------------------------------------------------------------------*
FORM output_sformat USING p_zcdes
p_zcl
jlen1
p_zccv
ilen1
p_zcv
p_fjdes
p_fjl
p_fjcv
p_fjv.
WRITE:/ sy-vline NO-GAP,p_zcdes,28 sy-vline NO-GAP,
30 p_zcl.
CONDENSE p_zccv NO-GAPS.
IF ( p_zccv NE ' ' AND p_zccv NE '0.00' ).
WRITE: 33 sy-vline NO-GAP, AT jlen1 p_zccv.
ELSE.
WRITE: 33 sy-vline NO-GAP.
ENDIF.
CONDENSE p_zcv NO-GAPS.
IF ( p_zcv NE ' ' AND p_zcv NE '0.00' ).
WRITE: 55 sy-vline NO-GAP, AT ilen1 p_zcv.
ELSE.
WRITE: 55 sy-vline NO-GAP.
ENDIF.
WRITE: 77 sy-vline NO-GAP,p_fjdes,
106 sy-vline NO-GAP,108 p_fjl.
IF p_fjcv NE 0 .
WRITE: 111 sy-vline NO-GAP, p_fjcv.
ELSE.
WRITE: 111 sy-vline NO-GAP.
ENDIF.
IF p_fjv NE 0 .
WRITE: 133 sy-vline NO-GAP, p_fjv.
ELSE.
WRITE: 133 sy-vline NO-GAP.
ENDIF.
WRITE: 155 sy-vline.
if p_zcdes = ' 其 他 应 收 款 净 额'.
else.
ULINE.
endif.
ENDFORM. " OUTPUT_SFORMAT
*&---------------------------------------------------------------------*
*& Form PROCESS_DATA1
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM process_data1 .
ENDFORM. " PROCESS_DATA1
*&---------------------------------------------------------------------*
*& Form OUTPUT_S1FORMAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_1945 text
* -->P_1946 text
* -->P_JTAB_YSZK text
* -->P_ITABS_YSZK text
* -->P_1949 text
* -->P_1950 text
* -->P_JTAB_YJSJ text
* -->P_ITABS_YJSJ text
*----------------------------------------------------------------------*
FORM output_s1format USING p_zcdes
p_zcl
p_zccv
p_zcv
p_fjdes
p_fjl
jlen1
p_fjcv
ilen1
p_fjv.
WRITE:/ sy-vline NO-GAP,p_zcdes,28 sy-vline NO-GAP,
30 p_zcl.
IF p_zccv NE 0 .
WRITE: 33 sy-vline NO-GAP, p_zccv.
ELSE.
WRITE: 33 sy-vline NO-GAP.
ENDIF.
IF p_zcv NE 0 .
WRITE: 55 sy-vline NO-GAP, p_zcv.
ELSE.
WRITE: 55 sy-vline NO-GAP.
ENDIF.
WRITE: 77 sy-vline NO-GAP,p_fjdes,
106 sy-vline NO-GAP, p_fjl.
CONDENSE p_fjcv NO-GAPS.
IF ( p_fjcv NE ' ' AND p_fjcv NE '0.00' ).
WRITE: 111 sy-vline NO-GAP, AT jlen1 p_fjcv.
ELSE.
WRITE: 111 sy-vline NO-GAP.
ENDIF.
CONDENSE p_fjv NO-GAPS.
IF ( p_fjv NE ' ' AND p_fjv NE '0.00' ).
WRITE: 133 sy-vline NO-GAP, AT ilen1 p_fjv.
ELSE.
WRITE: 133 sy-vline NO-GAP.
ENDIF.
WRITE: 155 sy-vline.
ULINE.
ENDFORM. " OUTPUT_S1FORMAT
现金流量表
************************************************************************
* PROGRAM NAME : 现金流量表(新会计准则) *
* APPLICATION NAME : FI *
* SUBSYSTEM : FI *
* AUTHOR : James Yang(朱修改) *
* TRANSACTION : ZFIR005N *
* PROGRAM TYPE : Report *
* SAP RELEASE : 4.7C *
*PROGRAM DESCRIPTION : 现金流量表 *
************************************************************************
* REVISION LOG *
* LOG# DATE AUTHOR DESCRIPTION *
* ---- ------- ------ ----------- *
* 0000 03/03/2005 James Yang 现金流量表 *
************************************************************************
REPORT ZFIR005 NO STANDARD PAGE HEADING MESSAGE-ID ZWL
LINE-COUNT 90 LINE-SIZE 120.
*&---------------------------------------------------------------------*
*& TABLES:
*&---------------------------------------------------------------------*
TABLES:BSEG,BKPF,T001,T001W,GLT0.
*&---------------------------------------------------------------------*
*& PROGRAM VARIABLES
*&---------------------------------------------------------------------*
DATA:LIN TYPE I.
DATA: P_BUTXT LIKE T001-BUTXT.
*&---------------------------------------------------------------------*
* data declaration
*&---------------------------------------------------------------------*
DATA:BEGIN OF ITAB OCCURS 0,
BUDAT LIKE BKPF-BUDAT,
BELNR LIKE BKPF-BELNR, "会计凭证号码
GJAHR LIKE BKPF-GJAHR, "会计年度
BUKRS LIKE BKPF-BUKRS, "公司代码
END OF ITAB.
DATA:BEGIN OF ITAB1 OCCURS 0,
RSTGR LIKE BSEG-RSTGR, "付款原因代码
DMBTR LIKE BSEG-DMBTR,
SHKZG LIKE BSEG-SHKZG, "借方/贷方标识
BUDAT LIKE BKPF-BUDAT,
END OF ITAB1.
DATA:BEGIN OF JTAB OCCURS 0, "本期数
*****经营活动产生的现金流量
JYXS LIKE BSEG-DMBTR, "销售商品、提供劳务收到的现金
JYSFFH LIKE BSEG-DMBTR, "收到税费返还
JYQTSR LIKE BSEG-DMBTR, "其他与经营活动有关的现金
JYLRXJ LIKE BSEG-DMBTR, "经营现金流入小计
JYGM LIKE BSEG-DMBTR, "购买商品、接受劳务支付的现金
JYZF LIKE BSEG-DMBTR, "支付给职工以及为职工支付的现金
JYZFSF LIKE BSEG-DMBTR, "支付的各项税费
JYQTZF LIKE BSEG-DMBTR, "支付的其他与经营活动有关的现金
JYLCXJ LIKE BSEG-DMBTR, "经营现金流出小计
JYXJJE LIKE BSEG-DMBTR, "现金流量净额
*****投资活动产生的现金流量
TZSH LIKE BSEG-DMBTR, "收回投资所收到的现金
TZQDSY LIKE BSEG-DMBTR, "取得投资收益所收到的现金
TZCZSH LIKE BSEG-DMBTR, "处置固定资产等收回的现金净额
TZCZXJ LIKE BSEG-DMBTR, "处置子公司及其他营业单位收到的现金净额 ZHU 2007.1.5
TZQTSH LIKE BSEG-DMBTR, "收到的其它与投资活动有关的现金
TZLRXJ LIKE BSEG-DMBTR, "投资现金流入小计
TZGM LIKE BSEG-DMBTR, "购建固定资产等所支付的现金
TZZF LIKE BSEG-DMBTR, "投资所支付的现金
TZQDXJ LIKE BSEG-DMBTR, "取得子公司及其他营业单位支付的现金净额 ZHU 2007.1.5
TZQTZF LIKE BSEG-DMBTR, "支付的其它与投资活动有关的现金
TZLCXJ LIKE BSEG-DMBTR, "投资现金流出小计
TZXJJE LIKE BSEG-DMBTR, "投资活动产生的现金流量净额
*****筹资活动产生的现金流量
CZXS LIKE BSEG-DMBTR, "吸收投资所收到的现金
CZJK LIKE BSEG-DMBTR, "借款所收到的现金
CZQT LIKE BSEG-DMBTR, "收到的其他与筹资活动有关的现金
CZLRXJ LIKE BSEG-DMBTR, "筹资现金流入小计
CZCH LIKE BSEG-DMBTR, "偿还债务所支付的现金
CZZF LIKE BSEG-DMBTR, "分配股利利润或偿还利息所支付的现金
* CZZCZF LIKE BSEG-DMBTR, "减少注册资本所支付的现金
CZQTZF LIKE BSEG-DMBTR, "支付的其他与筹资活动有关的现金
CZLCXJ LIKE BSEG-DMBTR, "筹资现金流出小计
CZXJJE LIKE BSEG-DMBTR, "筹资活动产生的现金流量净额
*****汇率变动对现金的影响额
HLBD LIKE BSEG-DMBTR, "汇率变动对现金的影响额
*****现金及现金等价物净增加额
JZJE LIKE BSEG-DMBTR, "现金及现金等价物净增加额
END OF JTAB.
****** 期初现金及现金等价物上月末余额
DATA: SYYE LIKE GLT0-HSLVT.
****** 期初现金及现金等价物上年末余额
DATA: SNYE LIKE GLT0-HSLVT.
****** 期末现金及现金等价物余额
DATA: QMYE LIKE GLT0-HSLVT.
****** 期末现金及现金等价物余额(累计数)
DATA: LJQMYE LIKE GLT0-HSLVT.
DATA: BEGIN OF ITAB2 OCCURS 10.
INCLUDE STRUCTURE GLT0.
DATA: TAMOUNT LIKE GLT0-HSLVT.
DATA: END OF ITAB2.
DATA:JTAB1 LIKE JTAB OCCURS 0 WITH HEADER LINE.
*&---------------------------------------------------------------------*
*& SELECT-OPTIONS
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS:S_BUKRS LIKE BSEG-BUKRS OBLIGATORY DEFAULT '1100',
S_YEAR(4) TYPE C OBLIGATORY DEFAULT SY-DATUM+0(4),
S_MONTH(2) TYPE C OBLIGATORY DEFAULT SY-DATUM+4(2).
* S_GSBER LIKE BSEG-GSBER." OBLIGATORY.
SELECT-OPTIONS: S_GSBER FOR BSEG-GSBER.
* S_BUDAT FOR BKPF-BUDAT OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
*&------------------------------------------------------------------*
*& at selection-screen.
*&------------------------------------------------------------------*
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'Z_FI_BUKRS'
ID 'BUKRS' FIELD S_BUKRS.
IF SY-SUBRC NE 0 .
MESSAGE E000 WITH S_BUKRS '公司代码中没有权限!'.
ELSE.
IF S_BUKRS = '1100'.
*add***********************
DATA:BEGIN OF IT_TAB OCCURS 0,
GSBER LIKE TGSBT-GSBER,
END OF IT_TAB.
CLEAR IT_TAB.REFRESH IT_TAB.
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE IT_TAB
FROM TGSBT
WHERE GSBER IN S_GSBER.
SORT IT_TAB BY GSBER.
DELETE ADJACENT DUPLICATES FROM IT_TAB COMPARING GSBER.
LOOP AT IT_TAB.
*end add*******************
AUTHORITY-CHECK OBJECT 'Z_FI_GSBER'
ID 'GSBER' FIELD IT_TAB-GSBER.
IF SY-SUBRC NE 0 .
MESSAGE E000(00) WITH IT_TAB-GSBER '业务范围中没有权限!'.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
*----------------------------------------------------------------------*
* top-of-page
*----------------------------------------------------------------------*
TOP-OF-PAGE.
PERFORM WRITE_TITLE.
PERFORM WRITE_PAGE.
*----------------------------------------------------------------------*
* End-of-page
*----------------------------------------------------------------------*
END-OF-PAGE.
*----------------------------------------------------------------------*
*START-OF-SELECTION
*----------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM MAIN.
*&---------------------------------------------------------------------*
*& Form MAIN
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM MAIN.
PERFORM SELECT_DATA.
PERFORM PROCESS_DATA.
*add 3.12.2005 当公司代码为1300并且为2005年1,2月份(灯塔)时,由于系统中无
*数据,所以本年累计数要硬写进去的,而且PERFORM PROCESS_DATA时不需要判断当
*为2005年1,2月份时不取值而是用写进去的数值,因为取了也一样是空值,同时其他
*月份算本年累计数时也要加上2月份时写进去的该本年累计数
PERFORM PROCESS_DATA1.
*end add 3.12.2005
******取现金及现金等价物上月末和上年末数据
PERFORM SELECT_DATA2.
PERFORM PROCESS_DATA2.
*********END 5/6/2007
PERFORM SUBTOTAL.
PERFORM WRITE_DATA.
ENDFORM. " MAIN
*&---------------------------------------------------------------------*
*& Form SELECT_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM SELECT_DATA.
DATA:YEAR(4) TYPE C,
MONTH(2) TYPE C,
DATE TYPE D,
DATE1 TYPE D,
SLEN TYPE I.
YEAR = S_YEAR.
MONTH = S_MONTH.
CONCATENATE YEAR '01' '01' INTO DATE.
IF MONTH = 12.
YEAR = YEAR + 1.
MONTH = '01'.
ELSE.
YEAR = YEAR.
MONTH = MONTH + 1.
ENDIF.
SLEN = STRLEN( MONTH ).
IF SLEN = 1.
CONCATENATE '0' MONTH INTO MONTH.
ENDIF.
CONCATENATE YEAR MONTH '01' INTO DATE1.
SELECT BUDAT BELNR GJAHR BUKRS
APPENDING CORRESPONDING FIELDS OF TABLE ITAB
FROM BKPF
WHERE BUKRS = S_BUKRS
AND BUDAT >= DATE
AND BUDAT < DATE1
AND BLART NOT IN ('WA','WE','WI','WL','WN').
* 区分事业部和公司的现金流量表
IF S_GSBER-LOW = ' ' AND S_GSBER-HIGH = ' '. " ADD BY ZHJ
LOOP AT ITAB.
SELECT RSTGR DMBTR SHKZG INTO (ITAB1-RSTGR,ITAB1-DMBTR,ITAB1-SHKZG)
FROM BSEG
WHERE BUKRS = ITAB-BUKRS
AND BELNR = ITAB-BELNR
AND GJAHR = ITAB-GJAHR
AND GSBER IN S_GSBER
AND HKONT >= '0010010000'
AND HKONT <= '0010099999'.
ITAB1-BUDAT = ITAB-BUDAT.
APPEND ITAB1.
ENDSELECT.
ENDLOOP.
* ADD BY ZHJ
ELSE.
LOOP AT ITAB.
SELECT RSTGR DMBTR SHKZG INTO (ITAB1-RSTGR,ITAB1-DMBTR,ITAB1-SHKZG)
FROM BSEG
WHERE BUKRS = ITAB-BUKRS
AND BELNR = ITAB-BELNR
AND GJAHR = ITAB-GJAHR
AND GSBER IN S_GSBER
AND ( HKONT = '0019990501' OR HKONT = '0019990502' OR HKONT =
'0019991001' OR HKONT = '0019990503' ).
ITAB1-BUDAT = ITAB-BUDAT.
APPEND ITAB1.
ENDSELECT.
ENDLOOP.
ENDIF.
*END
ENDFORM. " SELECT_DATA
*&---------------------------------------------------------------------*
*& Form WRITE_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE_DATA.
JTAB-JYGM = 0 - JTAB-JYGM.
JTAB-JYZF = 0 - JTAB-JYZF.
JTAB-JYZFSF = 0 - JTAB-JYZFSF.
JTAB-JYQTZF = 0 - JTAB-JYQTZF.
JTAB-JYLCXJ = 0 - JTAB-JYLCXJ. "add 3.12.2005
JTAB-TZGM = 0 - JTAB-TZGM.
JTAB-TZZF = 0 - JTAB-TZZF.
JTAB-TZQDXJ = 0 - JTAB-TZQDXJ. "ZHU 2007.1.5
JTAB-TZQTZF = 0 - JTAB-TZQTZF.
JTAB-TZLCXJ = 0 - JTAB-TZLCXJ. "add 3.12.2005
JTAB-CZCH = 0 - JTAB-CZCH.
JTAB-CZZF = 0 - JTAB-CZZF.
* JTAB-CZZCZF = 0 - JTAB-CZZCZF.
JTAB-CZQTZF = 0 - JTAB-CZQTZF.
JTAB-CZLCXJ = 0 - JTAB-CZLCXJ. "add 3.12.2005
JTAB1-JYGM = 0 - JTAB1-JYGM.
JTAB1-JYZF = 0 - JTAB1-JYZF.
JTAB1-JYZFSF = 0 - JTAB1-JYZFSF.
JTAB1-JYQTZF = 0 - JTAB1-JYQTZF.
JTAB1-JYLCXJ = 0 - JTAB1-JYLCXJ. "add 3.12.2005
JTAB1-TZGM = 0 - JTAB1-TZGM.
JTAB1-TZZF = 0 - JTAB1-TZZF.
JTAB1-TZQDXJ = 0 - JTAB1-TZQDXJ. "ZHU 2007.1.5
JTAB1-TZQTZF = 0 - JTAB1-TZQTZF.
JTAB1-TZLCXJ = 0 - JTAB1-TZLCXJ. "add 3.12.2005
JTAB1-CZCH = 0 - JTAB1-CZCH.
JTAB1-CZZF = 0 - JTAB1-CZZF.
* JTAB1-CZZCZF = 0 - JTAB1-CZZCZF.
JTAB1-CZQTZF = 0 - JTAB1-CZQTZF.
JTAB1-CZLCXJ = 0 - JTAB1-CZLCXJ. "add 3.12.2005
PERFORM OUTPUT_FORMAT USING '一、经营活动产生的现金流量'
' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 销售商品、提供劳务收到的现金'
'1' JTAB-JYXS JTAB1-JYXS.
PERFORM OUTPUT_FORMAT USING ' 收到税费返还'
'3' JTAB-JYSFFH JTAB1-JYSFFH.
PERFORM OUTPUT_FORMAT USING ' 收到的其他与经营活动有关的现金'
'8' JTAB-JYQTSR JTAB1-JYQTSR.
PERFORM OUTPUT_FORMAT USING ' 现金流入小计'
'9' JTAB-JYLRXJ JTAB1-JYLRXJ.
PERFORM OUTPUT_FORMAT USING ' 购买商品、接受劳务支付的现金'
'10' JTAB-JYGM JTAB1-JYGM.
PERFORM OUTPUT_FORMAT USING ' 支付给职工以及为职工支付的现金'
'12' JTAB-JYZF JTAB1-JYZF.
PERFORM OUTPUT_FORMAT USING ' 支付的各项税费'
'13' JTAB-JYZFSF JTAB1-JYZFSF.
PERFORM OUTPUT_FORMAT USING ' 支付的其他与经营活动有关的现金'
'18' JTAB-JYQTZF JTAB1-JYQTZF.
PERFORM OUTPUT_FORMAT USING ' 现金流出小计'
'20' JTAB-JYLCXJ JTAB1-JYLCXJ.
PERFORM OUTPUT_FORMAT USING ' 经营活动产生的现金流量净额'
'21' JTAB-JYXJJE JTAB1-JYXJJE.
PERFORM OUTPUT_FORMAT USING '二、投资活动产生的现金流量'
' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 收回投资所收到的现金'
'22' JTAB-TZSH JTAB1-TZSH.
* PERFORM OUTPUT_FORMAT USING ' 其中:出售子公司所收到的现金'
* '23' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 取得投资收益所收到的现金'
'24' JTAB-TZQDSY JTAB1-TZQDSY.
PERFORM OUTPUT_FORMAT USING
' 处置固定资产、无形资产和其他长期资产而收回的现金净额'
'25' JTAB-TZCZSH JTAB1-TZCZSH.
PERFORM OUTPUT_FORMAT USING ' 处置子公司及其他营业单位收到的现金净额'
'26' JTAB-TZCZXJ JTAB1-TZCZXJ.
PERFORM OUTPUT_FORMAT USING ' 收到的其它与投资活动有关的现金'
'28' JTAB-TZQTSH JTAB1-TZQTSH.
PERFORM OUTPUT_FORMAT USING ' 现金流入小计'
'29' JTAB-TZLRXJ JTAB1-TZLRXJ.
PERFORM OUTPUT_FORMAT USING
' 购建固定资产、无形资产和其他长期资产所支付的现金'
'30' JTAB-TZGM JTAB1-TZGM.
PERFORM OUTPUT_FORMAT USING ' 投资所支付的现金'
'31' JTAB-TZZF JTAB1-TZZF.
PERFORM OUTPUT_FORMAT USING ' 取得子公司及其他营业单位支付的现金净额'
'32' JTAB-TZZF JTAB1-TZZF.
PERFORM OUTPUT_FORMAT USING ' 支付的其它与投资活动有关的现金'
'35' JTAB-TZQTZF JTAB1-TZQTZF.
PERFORM OUTPUT_FORMAT USING ' 现金流出小计'
'36' JTAB-TZLCXJ JTAB1-TZLCXJ.
PERFORM OUTPUT_FORMAT USING ' 投资活动产生的现金流量净额'
'37' JTAB-TZXJJE JTAB1-TZXJJE.
PERFORM OUTPUT_FORMAT USING '三、筹资活动产生的现金流量'
' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 吸收投资所收到的现金'
'38' JTAB-CZXS JTAB1-CZXS.
PERFORM OUTPUT_FORMAT USING
' 其中:子公司吸收少数股东权益投资收到的现金'
'39' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 借款所收到的现金'
'40' JTAB-CZJK JTAB1-CZJK.
PERFORM OUTPUT_FORMAT USING ' 收到的其他与筹资活动有关的现金'
'43' JTAB-CZQT JTAB1-CZQT.
PERFORM OUTPUT_FORMAT USING ' 现金流入小计'
'44' JTAB-CZLRXJ JTAB1-CZLRXJ.
PERFORM OUTPUT_FORMAT USING ' 偿还债务所支付的现金'
'45' JTAB-CZCH JTAB1-CZCH.
PERFORM OUTPUT_FORMAT USING ' 分配股利利润或偿还利息所支付的现金'
'46' JTAB-CZZF JTAB1-CZZF.
PERFORM OUTPUT_FORMAT USING ' 其中:子公司支付少数股东的股利'
'47' ' ' ' '.
* PERFORM OUTPUT_FORMAT USING ' 减少注册资本所支付的现金'
* '48' JTAB-CZZCZF JTAB1-CZZCZF.
* PERFORM OUTPUT_FORMAT USING ' 其中:子公司依法减资支付给少数股东的现金'
* '49' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 支付的其他与筹资活动有关的现金'
'52' JTAB-CZQTZF JTAB1-CZQTZF.
PERFORM OUTPUT_FORMAT USING ' 现金流出小计'
'53' JTAB-CZLCXJ JTAB1-CZLCXJ.
PERFORM OUTPUT_FORMAT USING ' 筹资活动产生的现金流量净额'
'54' JTAB-CZXJJE JTAB1-CZXJJE.
PERFORM OUTPUT_FORMAT USING '四、汇率变动对现金的影响额'
'55' JTAB-HLBD JTAB1-HLBD.
PERFORM OUTPUT_FORMAT USING '五、现金及现金等价物净增加额'
'56' JTAB-JZJE JTAB1-JZJE.
PERFORM OUTPUT_FORMAT USING ' 加:期初现金及现金等价物余额'
'57' SYYE SNYE.
PERFORM OUTPUT_FORMAT USING '六、期末现金及现金等价物余额'
'58' QMYE LJQMYE.
NEW-PAGE.
WRITE:/ SY-VLINE NO-GAP,'补 充 资 料:',66 SY-VLINE NO-GAP,
69 ' ', 76 SY-VLINE NO-GAP,80 ' ',
98 SY-VLINE NO-GAP,103 ' ',120 SY-VLINE.
ULINE.
PERFORM OUTPUT_FORMAT USING '一、将净利润调节为经营活动的现金流量'
' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 净利润' '60' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 加:资产减值准备' '61' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 固定资产折旧、油气资产折耗、生产性生物资产折旧'
'62' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 无形资产摊销' '63' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 长期待摊费用摊销' '64' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 处置固定资产、无形资产和其他长期资产的损失'
'65' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 固定资产报废损失' '66' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 公允价值变动损失' '67' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 财务费用' '68' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 财务费用' '69' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 递延所得税资产减少' '70' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 递延所得税负债增加' '71' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 存货的减少' '72' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 经营性应收项目的减少' '73' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 经营性应付项目的增加' '74' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 其他' '75' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 经营活动产生的现金流量净额' '76' ' ' ' '.
PERFORM OUTPUT_FORMAT USING '二、不涉及现金收支的重大投资和筹资活动' ' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 债务转为资本' '77' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 一年内到期的可转换公司债券' '78' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 融资租赁固定资产' '79' ' ' ' '.
PERFORM OUTPUT_FORMAT USING '三、现金及现金等价物净增加情况' ' ' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 现金的期末余额' '80' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 减:现金的期初余额' '81' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 加:现金等价物的期末余额' '82' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 减:现金等价物的期初余额' '83' ' ' ' '.
PERFORM OUTPUT_FORMAT USING ' 现金及现金等价物净增加额' '84' ' ' ' '.
WRITE:/ '公司法定代表人:',45 '主管会计工作负责人:',
85 '会计机构负责人:'.
ENDFORM. " WRITE_DATA
*&---------------------------------------------------------------------*
*& Form WRITE_TITLE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE_TITLE.
DATA : COMP(24) TYPE C,
COMP1(30) TYPE C,
TITL_POSI TYPE I,
BTITL_POSI TYPE I,
DATE_POSI TYPE I.
*公司代码
SELECT SINGLE BUTXT FROM T001
INTO P_BUTXT WHERE BUKRS = S_BUKRS.
*分厂代码
SELECT SINGLE NAME1 FROM T001W
INTO COMP1 WHERE WERKS = S_GSBER-LOW.
COMP = P_BUTXT.
BTITL_POSI = ( SY-LINSZ - STRLEN( COMP ) ) / 2 .
TITL_POSI = ( SY-LINSZ - STRLEN( SY-TITLE ) ) / 2 - 8.
DATE_POSI = TITL_POSI + 2.
PRINT-CONTROL FONT '012'.
WRITE:/,AT TITL_POSI '现 金 流 量 表'.
SKIP 1.
PRINT-CONTROL FONT '006'.
IF COMP1 NE SPACE.
WRITE:/, 2 '单位名称:',COMP,'/',COMP1,
70 S_YEAR,'年',S_MONTH,'月',
100 '单位:人民币元'.
ELSE.
WRITE:/, 2 '单位名称:',COMP,AT DATE_POSI ' ',
60 S_YEAR,'年',S_MONTH,'月',
100 '单位:人民币元'.
ENDIF.
ULINE.
WRITE:/ SY-VLINE NO-GAP,11 '项 目',66 SY-VLINE NO-GAP,
69 '行 次', 76 SY-VLINE NO-GAP,80 '本 期 数',
98 SY-VLINE NO-GAP,103 '累 计 数',120 SY-VLINE.
ULINE.
ENDFORM. " WRITE_TITLE
*&---------------------------------------------------------------------*
*& Form WRITE_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE_PAGE.
ENDFORM. " WRITE_PAGE
*&---------------------------------------------------------------------*
*& Form PROCESS_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PROCESS_DATA .
LOOP AT ITAB1.
CASE ITAB1-RSTGR.
WHEN '001'. "销售商品、提供劳务收到的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYXS = JTAB-JYXS + ITAB1-DMBTR.
ENDIF.
JTAB1-JYXS = JTAB1-JYXS + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYXS = JTAB-JYXS - ITAB1-DMBTR.
ENDIF.
JTAB1-JYXS = JTAB1-JYXS - ITAB1-DMBTR.
ENDIF.
WHEN '003'. "收到税费返还
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYSFFH = JTAB-JYSFFH + ITAB1-DMBTR.
ENDIF.
JTAB1-JYSFFH = JTAB1-JYSFFH + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYSFFH = JTAB-JYSFFH - ITAB1-DMBTR.
ENDIF.
JTAB1-JYSFFH = JTAB1-JYSFFH - ITAB1-DMBTR.
ENDIF.
WHEN '008'. "其他与经营活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYQTSR = JTAB-JYQTSR + ITAB1-DMBTR.
ENDIF.
JTAB1-JYQTSR = JTAB1-JYQTSR + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYQTSR = JTAB-JYQTSR - ITAB1-DMBTR.
ENDIF.
JTAB1-JYQTSR = JTAB1-JYQTSR - ITAB1-DMBTR.
ENDIF.
WHEN '010'. "购买商品、接受劳务支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYGM = JTAB-JYGM + ITAB1-DMBTR.
ENDIF.
JTAB1-JYGM = JTAB1-JYGM + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYGM = JTAB-JYGM - ITAB1-DMBTR.
ENDIF.
JTAB1-JYGM = JTAB1-JYGM - ITAB1-DMBTR.
ENDIF.
WHEN '012'. "支付给职工以及为职工支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYZF = JTAB-JYZF + ITAB1-DMBTR.
ENDIF.
JTAB1-JYZF = JTAB1-JYZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYZF = JTAB-JYZF - ITAB1-DMBTR.
ENDIF.
JTAB1-JYZF = JTAB1-JYZF - ITAB1-DMBTR.
ENDIF.
WHEN '013'. "支付的各项税费
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYZFSF = JTAB-JYZFSF + ITAB1-DMBTR.
ENDIF.
JTAB1-JYZFSF = JTAB1-JYZFSF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYZFSF = JTAB-JYZFSF - ITAB1-DMBTR.
ENDIF.
JTAB1-JYZFSF = JTAB1-JYZFSF - ITAB1-DMBTR.
ENDIF.
WHEN '018'. "支付的其他与经营活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYQTZF = JTAB-JYQTZF + ITAB1-DMBTR.
ENDIF.
JTAB1-JYQTZF = JTAB1-JYQTZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-JYQTZF = JTAB-JYQTZF - ITAB1-DMBTR.
ENDIF.
JTAB1-JYQTZF = JTAB1-JYQTZF - ITAB1-DMBTR.
ENDIF.
WHEN '022'. "收回投资所收到的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZSH = JTAB-TZSH + ITAB1-DMBTR.
ENDIF.
JTAB1-TZSH = JTAB1-TZSH + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZSH = JTAB-TZSH - ITAB1-DMBTR.
ENDIF.
JTAB1-TZSH = JTAB1-TZSH - ITAB1-DMBTR.
ENDIF.
WHEN '024'. "取得投资收益所收到的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQDSY = JTAB-TZQDSY + ITAB1-DMBTR.
ENDIF.
JTAB1-TZQDSY = JTAB1-TZQDSY + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQDSY = JTAB-TZQDSY - ITAB1-DMBTR.
ENDIF.
JTAB1-TZQDSY = JTAB1-TZQDSY - ITAB1-DMBTR.
ENDIF.
WHEN '025'. "处置固定资产等收回的现金净额
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZCZSH = JTAB-TZCZSH + ITAB1-DMBTR.
ENDIF.
JTAB1-TZCZSH = JTAB1-TZCZSH + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZCZSH = JTAB-TZCZSH - ITAB1-DMBTR.
ENDIF.
JTAB1-TZCZSH = JTAB1-TZCZSH - ITAB1-DMBTR.
ENDIF.
WHEN '028'. "收到的其它与投资活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQTSH = JTAB-TZQTSH + ITAB1-DMBTR.
ENDIF.
JTAB1-TZQTSH = JTAB1-TZQTSH + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQTSH = JTAB-TZQTSH - ITAB1-DMBTR.
ENDIF.
JTAB1-TZQTSH = JTAB1-TZQTSH - ITAB1-DMBTR.
ENDIF.
WHEN '030'. "购建固定资产等所支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZGM = JTAB-TZGM + ITAB1-DMBTR.
ENDIF.
JTAB1-TZGM = JTAB1-TZGM + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZGM = JTAB-TZGM - ITAB1-DMBTR.
ENDIF.
JTAB1-TZGM = JTAB1-TZGM - ITAB1-DMBTR.
ENDIF.
WHEN '031'. "投资所支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZZF = JTAB-TZZF + ITAB1-DMBTR.
ENDIF.
JTAB1-TZZF = JTAB1-TZZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZZF = JTAB-TZZF - ITAB1-DMBTR.
ENDIF.
JTAB1-TZZF = JTAB1-TZZF - ITAB1-DMBTR.
ENDIF.
WHEN '035'. "支付的其它与投资活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQTZF = JTAB-TZQTZF + ITAB1-DMBTR.
ENDIF.
JTAB1-TZQTZF = JTAB1-TZQTZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQTZF = JTAB-TZQTZF - ITAB1-DMBTR.
ENDIF.
JTAB1-TZQTZF = JTAB1-TZQTZF - ITAB1-DMBTR.
ENDIF.
WHEN '038'. "吸收投资所收到的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZXS = JTAB-CZXS + ITAB1-DMBTR.
ENDIF.
JTAB1-CZXS = JTAB1-CZXS + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZXS = JTAB-CZXS - ITAB1-DMBTR.
ENDIF.
JTAB1-CZXS = JTAB1-CZXS - ITAB1-DMBTR.
ENDIF.
WHEN '040'. "借款所收到的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZJK = JTAB-CZJK + ITAB1-DMBTR.
ENDIF.
JTAB1-CZJK = JTAB1-CZJK + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZJK = JTAB-CZJK - ITAB1-DMBTR.
ENDIF.
JTAB1-CZJK = JTAB1-CZJK - ITAB1-DMBTR.
ENDIF.
WHEN '043'. "收到的其他与筹资活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZQT = JTAB-CZQT + ITAB1-DMBTR.
ENDIF.
JTAB1-CZQT = JTAB1-CZQT + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZQT = JTAB-CZQT - ITAB1-DMBTR.
ENDIF.
JTAB1-CZQT = JTAB1-CZQT - ITAB1-DMBTR.
ENDIF.
WHEN '045'. "偿还债务所支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZCH = JTAB-CZCH + ITAB1-DMBTR.
ENDIF.
JTAB1-CZCH = JTAB1-CZCH + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZCH = JTAB-CZCH - ITAB1-DMBTR.
ENDIF.
JTAB1-CZCH = JTAB1-CZCH - ITAB1-DMBTR.
ENDIF.
WHEN '046'. "分配股利利润或偿还利息所支付的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZZF = JTAB-CZZF + ITAB1-DMBTR.
ENDIF.
JTAB1-CZZF = JTAB1-CZZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZZF = JTAB-CZZF - ITAB1-DMBTR.
ENDIF.
JTAB1-CZZF = JTAB1-CZZF - ITAB1-DMBTR.
ENDIF.
* WHEN '048'. "减少注册资本所支付的现金
* IF ITAB1-SHKZG = 'S'.
* IF ITAB1-BUDAT+4(2) = S_MONTH.
* JTAB-CZZCZF = JTAB-CZZCZF + ITAB1-DMBTR.
* ENDIF.
* JTAB1-CZZCZF = JTAB1-CZZCZF + ITAB1-DMBTR.
* ELSE.
* IF ITAB1-BUDAT+4(2) = S_MONTH.
* JTAB-CZZCZF = JTAB-CZZCZF - ITAB1-DMBTR.
* ENDIF.
* JTAB1-CZZCZF = JTAB1-CZZCZF - ITAB1-DMBTR.
* ENDIF.
WHEN '052'. "支付的其他与筹资活动有关的现金
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZQTZF = JTAB-CZQTZF + ITAB1-DMBTR.
ENDIF.
JTAB1-CZQTZF = JTAB1-CZQTZF + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-CZQTZF = JTAB-CZQTZF - ITAB1-DMBTR.
ENDIF.
JTAB1-CZQTZF = JTAB1-CZQTZF - ITAB1-DMBTR.
ENDIF.
WHEN '053'. "汇率变动对现金的影响额
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-HLBD = JTAB-HLBD + ITAB1-DMBTR.
ENDIF.
JTAB1-HLBD = JTAB1-HLBD + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-HLBD = JTAB-HLBD - ITAB1-DMBTR.
ENDIF.
JTAB1-HLBD = JTAB1-HLBD - ITAB1-DMBTR.
ENDIF.
WHEN '055'. "处置子公司及其他营业单位收到的现金净额 ZHU 2007.1.5
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZCZXJ = JTAB-TZCZXJ + ITAB1-DMBTR.
ENDIF.
JTAB1-TZCZXJ = JTAB1-TZCZXJ + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZCZXJ = JTAB-TZCZXJ - ITAB1-DMBTR.
ENDIF.
JTAB1-TZCZXJ = JTAB1-TZCZXJ - ITAB1-DMBTR.
ENDIF.
WHEN '056'. "取得子公司及其他营业单位支付的现金净额 ZHU 2007.1.5
IF ITAB1-SHKZG = 'S'.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQDXJ = JTAB-TZQDXJ + ITAB1-DMBTR.
ENDIF.
JTAB1-TZQDXJ = JTAB1-TZQDXJ + ITAB1-DMBTR.
ELSE.
IF ITAB1-BUDAT+4(2) = S_MONTH.
JTAB-TZQDXJ = JTAB-TZQDXJ - ITAB1-DMBTR.
ENDIF.
JTAB1-TZQDXJ = JTAB1-TZQDXJ - ITAB1-DMBTR.
ENDIF.
ENDCASE.
MODIFY JTAB INDEX SY-TABIX.
MODIFY JTAB1 INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*&---------------------------------------------------------------------*
*& Form select_data2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM SELECT_DATA2 .
****** 区分事业部和公司
IF S_GSBER-LOW = ' ' AND S_GSBER-HIGH = ' '.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITAB2 FROM GLT0
WHERE RYEAR = S_YEAR
AND BUKRS = S_BUKRS
AND RBUSA IN S_GSBER
AND RLDNR = '00'
AND RRCTY = '0' "0:实际发生; 1:表示计划发生
AND ( ( RACCT >= '0010010000' AND RACCT <= '0010029999' ) OR
( RACCT >= '0010090000' AND RACCT <= '0010099999' ) ).
ELSE.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITAB2 FROM GLT0
WHERE RYEAR = S_YEAR
AND BUKRS = S_BUKRS
AND RBUSA IN S_GSBER
AND RLDNR = '00'
AND RRCTY = '0' "0:实际发生; 1:表示计划发生
AND ( RACCT = '0019990501' OR RACCT = '0019990502' OR RACCT =
'0019991001' OR RACCT = '0019990503' ).
ENDIF.
*END
SORT ITAB2 BY RACCT.
ENDFORM. " select_data2
*&---------------------------------------------------------------------*
*& Form Process_data2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PROCESS_DATA2 .
LOOP AT ITAB2.
CASE S_MONTH.
WHEN '1' OR '01'.
ITAB2-TAMOUNT = ITAB2-HSLVT .
WHEN '2' OR '02'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 .
WHEN '3' OR '03'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 .
WHEN '4' OR '04'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03.
WHEN '5' OR '05'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 .
WHEN '6' OR '06'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 .
WHEN '7' OR '07'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 .
WHEN '8' OR '08'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07.
WHEN '9' OR '09'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 .
WHEN '10'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 .
WHEN '11'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 .
WHEN '12'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 + ITAB2-HSL11.
WHEN '13'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 + ITAB2-HSL11
+ ITAB2-HSL12 .
WHEN '14'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 + ITAB2-HSL11
+ ITAB2-HSL12 + ITAB2-HSL13 .
WHEN '15'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 + ITAB2-HSL11
+ ITAB2-HSL12 + ITAB2-HSL13 + ITAB2-HSL14 .
WHEN '16'.
ITAB2-TAMOUNT = ITAB2-HSLVT + ITAB2-HSL01 + ITAB2-HSL02 + ITAB2-HSL03
+ ITAB2-HSL04 + ITAB2-HSL05 + ITAB2-HSL06 + ITAB2-HSL07
+ ITAB2-HSL08 + ITAB2-HSL09 + ITAB2-HSL10 + ITAB2-HSL11
+ ITAB2-HSL12 + ITAB2-HSL13 + ITAB2-HSL14 + ITAB2-HSL15.
ENDCASE.
MODIFY ITAB2 INDEX SY-TABIX.
SYYE = SYYE + ITAB2-TAMOUNT.
SNYE = SNYE + ITAB2-HSLVT.
ENDLOOP.
ENDFORM. " Process_data2
*&---------------------------------------------------------------------*
*& Form SUBTOTAL
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM SUBTOTAL .
*经营现金流入小计
JTAB-JYLRXJ = JTAB-JYXS + JTAB-JYSFFH + JTAB-JYQTSR.
*经营现金流出小计
JTAB-JYLCXJ = JTAB-JYGM + JTAB-JYZF + JTAB-JYZFSF + JTAB-JYQTZF.
*经营活动产生的现金流量净额
JTAB-JYXJJE = JTAB-JYLRXJ + JTAB-JYLCXJ. "changed 3.12.2005
*投资现金流入小计 2007.1.5 增加 TZCZXJ
JTAB-TZLRXJ = JTAB-TZSH + JTAB-TZQDSY + JTAB-TZCZSH + JTAB-TZCZXJ + JTAB-TZQTSH.
*投资现金流出小计 2007.1.5 增加 TZQDXJ
JTAB-TZLCXJ = JTAB-TZGM + JTAB-TZZF + JTAB-TZQDXJ + JTAB-TZQTZF.
*投资活动产生的现金流量净额
JTAB-TZXJJE = JTAB-TZLRXJ + JTAB-TZLCXJ. "changed 3.12.2005
*筹资现金流入小计
JTAB-CZLRXJ = JTAB-CZXS + JTAB-CZJK + JTAB-CZQT.
*筹资现金流出小计
JTAB-CZLCXJ = JTAB-CZCH + JTAB-CZZF + JTAB-CZQTZF.
*筹资活动产生的现金流量净额
JTAB-CZXJJE = JTAB-CZLRXJ + JTAB-CZLCXJ. "changed 3.12.2005
*现金及现金等价物净增加额
JTAB-JZJE = JTAB-JYXJJE + JTAB-TZXJJE + JTAB-CZXJJE.
MODIFY JTAB INDEX SY-TABIX.
JTAB1-JYLRXJ = JTAB1-JYXS + JTAB1-JYSFFH + JTAB1-JYQTSR.
JTAB1-JYLCXJ = JTAB1-JYGM + JTAB1-JYZF + JTAB1-JYZFSF + JTAB1-JYQTZF.
JTAB1-JYXJJE = JTAB1-JYLRXJ + JTAB1-JYLCXJ. "changed 3.12.2005
JTAB1-TZLRXJ = JTAB1-TZSH + JTAB1-TZQDSY + JTAB1-TZCZSH + JTAB1-TZCZXJ
+ JTAB1-TZQTSH.
JTAB1-TZLCXJ = JTAB1-TZGM + JTAB1-TZZF + JTAB1-TZQDXJ + JTAB1-TZQTZF.
JTAB1-TZXJJE = JTAB1-TZLRXJ + JTAB1-TZLCXJ. "changed 3.12.2005
JTAB1-CZLRXJ = JTAB1-CZXS + JTAB1-CZJK + JTAB1-CZQT.
JTAB1-CZLCXJ = JTAB1-CZCH + JTAB1-CZZF + JTAB1-CZQTZF.
JTAB1-CZXJJE = JTAB1-CZLRXJ + JTAB1-CZLCXJ. "changed 3.12.2005
JTAB1-JZJE = JTAB1-JYXJJE + JTAB1-TZXJJE + JTAB1-CZXJJE.
MODIFY JTAB1 INDEX SY-TABIX.
******期末现金及现金等价物余额
QMYE = JTAB-JZJE + SYYE + JTAB-HLBD.
LJQMYE = JTAB1-JZJE + SNYE + JTAB1-HLBD.
ENDFORM. " SUBTOTAL
*&---------------------------------------------------------------------*
*& Form OUTPUT_FORMAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0500 text
* -->P_0501 text
* -->P_JTAB_DQTZ text
* -->P_ITABS_DQTZ text
* -->P_0504 text
* -->P_0505 text
* -->P_JTAB_YFPJ text
* -->P_ITABS_YFPJ text
*----------------------------------------------------------------------*
FORM OUTPUT_FORMAT USING P_ZCDES
P_ZCL
P_ZCCV
P_ZCV.
WRITE:/ SY-VLINE NO-GAP,P_ZCDES,66 SY-VLINE NO-GAP,
71 P_ZCL.
IF P_ZCCV NE 0 .
WRITE: 76 SY-VLINE NO-GAP, P_ZCCV.
ELSE.
WRITE: 76 SY-VLINE NO-GAP.
ENDIF.
IF P_ZCV NE 0 .
WRITE: 98 SY-VLINE NO-GAP, P_ZCV.
ELSE.
WRITE: 98 SY-VLINE NO-GAP.
ENDIF.
WRITE: 120 SY-VLINE.
ULINE.
ENDFORM. " OUTPUT_FORMAT
*&---------------------------------------------------------------------*
*& Form PROCESS_DATA1
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PROCESS_DATA1 .
******灯塔
IF S_YEAR = '2005' AND S_BUKRS = '1300'.
JTAB1-JYXS = JTAB1-JYXS + '9512458.05'.
JTAB1-JYSFFH = JTAB1-JYSFFH + '198796.40'.
JTAB1-JYQTSR = JTAB1-JYQTSR + '15154953.61'.
JTAB1-JYGM = JTAB1-JYGM + '-15989390.30'.
JTAB1-JYZF = JTAB1-JYZF + '-1754897.14'.
JTAB1-JYZFSF = JTAB1-JYZFSF + '-419308.58'.
JTAB1-JYQTZF = JTAB1-JYQTZF + '-10723250.65'.
JTAB1-TZSH = JTAB1-TZSH + '000000.00'.
JTAB1-TZQDSY = JTAB1-TZQDSY + '000000.00'.
JTAB1-TZGM = JTAB1-TZGM + '-445759.00'.
JTAB1-CZJK = JTAB1-CZJK + '10000000.00'.
JTAB1-CZCH = JTAB1-CZCH + '-10000000.00'.
JTAB1-CZZF = JTAB1-CZZF + '-282046.50'.
MODIFY JTAB1 INDEX SY-TABIX.
ENDIF.
******股份公司 ADD
IF S_YEAR = '2006' AND S_BUKRS = '1100'.
JTAB1-JYXS = JTAB1-JYXS + '101205202.57'.
JTAB1-JYQTSR = JTAB1-JYQTSR + '6037233.67'.
JTAB1-JYGM = JTAB1-JYGM + '-72887793.50'.
JTAB1-JYZF = JTAB1-JYZF + '-4682704.50'.
JTAB1-JYZFSF = JTAB1-JYZFSF + '-9169208.40'.
JTAB1-JYQTZF = JTAB1-JYQTZF + '-8836183.73'.
JTAB1-TZGM = JTAB1-TZGM + '-3835096.05'.
JTAB1-TZZF = JTAB1-TZZF + '-5219996.60'.
JTAB1-CZJK = JTAB1-CZJK + '57000000.00'.
JTAB1-CZCH = JTAB1-CZCH + '-94230000.00'.
JTAB1-CZZF = JTAB1-CZZF + '-2305982.00'.
MODIFY JTAB1 INDEX SY-TABIX.
ENDIF.
******END
ENDFORM. " PROCESS_DATA1
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/19576.html