SAP 与 3大财务报表

财务报表有资产负债表、现金流量表、利润表(又叫损益表)。

资产负债和利润表一般都是根据科目进行汇总计算,现金流量表是根据原因代码进行统计。

科目分类:事务-FSE3

1、资产负债表 ( Balance Sheet )

资产负债表可以反应企业的整体经营情况,由三大部分构成:资产、负债、以及所有者权益,资产 = 负债 + 所有者权益。

资产可以理解为企业拥有的价值,包括:

-现金、应收账款、库存、固定资产、无形资产(专利、商标、著作权、投资股票),前三者变现块成为“流动性资产”,后两者成为“非流动性资产”。

负债,企业间的外债部分包括

短期借款: 向银行、贷款机构申请的短期借款,一般在1年内。

应付账款:供应商的欠款

长期借款:银行的长期借款

前两者为流动性借款,后者是非流动性借款。

所有者权益成为股东权益,

如果想快速做大一个企业,也即快速增加企业的资产主要有以下几种方式 - 股东增加投资,借银行的钱,压供应商的钱。

但用股东的钱和银行的钱,是要回报分红和利息的,看起来并不那么好用,所以一个企业如果在供应链上较为强势,那么它可以做到压供应商的钱,从而迅速扩张自己的规模。

在分析资产负债表时我们应首先注意到资产要素分析,具体包括:

1.流动资产分析。分析公司的现金、各种存款、短期投资、各种应收应付款项、存货等。流动资产比往年增加,说明公司的支付能力与变现能力增强。

2.长期投资分析。分析一年期以上的投资如公司控股、实施多元化经营等。长期投资的增加,表明公司的成长前景看好。因此,我们应该特别注意,折旧、损耗是否合理将直接影响到资产负债表、利润表和其他各种报表的准确性。

3.无形资产分析。主要分析商标权、著作权、土地使用权、非专利技术、商誉、专利权等。商誉及其他无确指的无形资产一般不予列账,除非商誉是购入或合并时形成的。取得无形资产后,应登记入账并在规定期限内摊销完毕。

其次要对负债要素进行分析,包括两个方面:

流动负债分析。各项流动负债应按实际发生额记账,分析的关键在于要避免遗漏,所有的负债均在资产负债表中反映出来。

长期负债分析。包括长期借款、应付债券、长期应付款项等。由于长期负债的形态不同,因此,应注意分析、了解公司债权人的情况。

SAP制作资产负债表:对资产部分根据科目得出明细

REPORT ztestlian_bdc.
TABLES:bkpf.
*&---------------------------------------------------------------------*
*& 包含               ZFIRP0011_TOP
*&---------------------------------------------------------------------*
*全局表
DATA:BEGIN OF gt_out OCCURS 0,
       rstgr  TYPE ergsl,  "原因代码
       txt40  TYPE v_t053r-txt40, "项目文本
       hslvt  TYPE faglflext-hslvt, "年初数
       hsl01  TYPE faglflext-hsl01, "期末数
       rstgr1 TYPE ergsl,  "原因代码
       txt401 TYPE v_t053r-txt40, "项目文本
       hslvt1 TYPE faglflext-hslvt, "年初数
       hsl011 TYPE faglflext-hsl01, "期末数
     END OF gt_out.

DATA:BEGIN OF gt_main OCCURS 0,
       ergsl TYPE fagl_011qt-ergsl, "财务报表项目
       hslvt TYPE faglflext-hslvt,    "年初数
       hsl01 TYPE faglflext-hsl01,    "期末数
     END OF gt_main.
*MARCO
DEFINE %%fill_fcat.
  CLEAR gs_fieldcat.
  gs_fieldcat-fieldname   = &1.
  gs_fieldcat-scrtext_m   = &2.
  gs_fieldcat-scrtext_l   = &2.
  gs_fieldcat-scrtext_s   = &2.
  gs_fieldcat-no_zero     = &3.
  gs_fieldcat-no_zero     = &3.
  gs_fieldcat-ref_table = &4.
  gs_fieldcat-ref_field = &5.
  gs_fieldcat-col_pos = &6.

  APPEND gs_fieldcat TO gt_fieldcat.
END-OF-DEFINITION.
*ALV
DATA: gt_fieldcat TYPE lvc_t_fcat,
      gs_fieldcat LIKE LINE OF gt_fieldcat.
DATA: gs_layout TYPE lvc_s_layo.

*&---------------------------------------------------------------------*
*& 包含               ZFIRP0011_SCR
*&---------------------------------------------------------------------*
PARAMETERS:p_bukrs LIKE bkpf-bukrs OBLIGATORY. "公司代码
PARAMETERS:p_gjahr LIKE bkpf-gjahr OBLIGATORY. "财年
PARAMETERS:p_monat LIKE bkpf-monat OBLIGATORY. "期间

*&---------------------------------------------------------------------*
*& 包含               ZFIRP0011_FO1
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_data .
  PERFORM get_desc1 USING '10' '20'.
  PERFORM get_item USING '1010' '2002'.
  PERFORM get_item USING '1020' '2003'.
  PERFORM get_item USING '1030' '2006'.
  PERFORM get_item USING '1040' '2007'.
  PERFORM get_item USING '1047' '2009'.
  PERFORM get_item USING '1057' '2011'.
  PERFORM get_item USING '1060' '2013'.
  PERFORM get_item USING '1061' '2015'.
  PERFORM get_item USING '1062' '2017'.
  PERFORM get_item USING '1064' '2019'.
  PERFORM get_item USING '1065' '2021'.
  PERFORM get_item USING '1066' '2023'.
  PERFORM get_item USING '1067' '2025'.
  PERFORM get_amount1 USING '2027'.
  PERFORM get_amount2 USING '11'.
  PERFORM get_desc2 USING '1101' '21'.
  PERFORM get_item USING '1103' '2101'.
  PERFORM get_item USING '1105' '2103'.
  PERFORM get_item USING '1107' '2105'.
  PERFORM get_item USING '1109' '2107'.
  PERFORM get_item USING '1111' '2109'.
  PERFORM get_item USING '1113' '2111'.
  PERFORM get_item USING '1115' '2113'.
  PERFORM get_item USING '1117' '2115'.
  PERFORM get_item USING '1119' '2117'.
  PERFORM get_item USING '1121' '2119'.
  PERFORM get_item USING '1123' '2121'.
  PERFORM get_amount3 USING '1125'.
  PERFORM get_amount4 USING '1127'.
  PERFORM get_item USING '1129' '2201'.
  PERFORM get_item USING '1131' '2203'.
  PERFORM get_item USING '1133' '2205'.
  PERFORM get_amount5 USING '2207'.
  PERFORM get_item1 USING '2209'.
  PERFORM get_item1 USING '2211'.
  PERFORM get_item1 USING '2213'.
  PERFORM get_item1 USING '2215'.
  PERFORM get_item1 USING '2217'.
  PERFORM get_item2.
  PERFORM get_item1 USING '2221'.
  PERFORM get_item1 USING '2223'.
  PERFORM get_amount6.
  PERFORM get_amount7.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_DESC1
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_desc1  USING pv_ergsl pv_ergsl1.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = pv_ergsl1.
*获取项目文本
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  CONCATENATE gt_out-txt40 ':' INTO gt_out-txt40.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl1.
  CONCATENATE gt_out-txt401 ':' INTO gt_out-txt401.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_ITEM
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_item  USING pv_ergsl pv_ergsl1.
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[],
  ls_racct,lr_racct[].
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'IFLY'
     AND ergsl = pv_ergsl.
  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      INTO CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.

  LOOP AT lt_faglflext.

    gt_out-hslvt = gt_out-hslvt + lt_faglflext-hslvt.
    IF lt_faglflext-ryear = p_gjahr.
      CASE p_monat.
        WHEN '01'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01.
        WHEN '02'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02.
        WHEN '03'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03.
        WHEN '04'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04.
        WHEN '05'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05.
        WHEN '06'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06.
        WHEN '07'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07.
        WHEN '08'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08.
        WHEN '09'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09.
        WHEN '10'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10.
        WHEN '11'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11.
        WHEN '12'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12.
        WHEN '13'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13.
        WHEN '14'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14.
        WHEN '15'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14 + lt_faglflext-hsl15.
        WHEN '16'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                      + lt_faglflext-hsl16.
      ENDCASE.
    ENDIF.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hsl01 =  gt_out-hsl01 +  gt_out-hslvt.

  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[],ls_racct,lr_racct[].
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl1.
  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      INTO CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt1 = gt_out-hslvt1 + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hslvt1 = gt_out-hslvt1 * -1.
  gt_out-hsl011 = gt_out-hsl011 * -1.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = pv_ergsl1.
*获取项目文本
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.

  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl1.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT1
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_amount1  USING pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[].
  CLEAR:lv_hslvt,lv_hsl01,gt_out,ls_racct,lr_racct[].
  READ TABLE gt_out WITH  KEY rstgr = '1010'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1020'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1030'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1040'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1047'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1057'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1060'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1061'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1062'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1064'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1065'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1066'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1067'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.
  gt_out-hslvt = lv_hslvt.
  gt_out-hsl01 = lv_hsl01.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl.

  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt1 = gt_out-hslvt1 + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hslvt1 = gt_out-hslvt1 * -1.
  gt_out-hsl011 = gt_out-hsl011 * -1.
*获取原因代码
  gt_out-rstgr = '100'.
  gt_out-rstgr1 = pv_ergsl.
*获取项目文本
  gt_out-txt40 = TEXT-t01.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT2
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_amount2  USING  pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[].
  CLEAR:lv_hslvt,lv_hsl01,gt_out,ls_racct,lr_racct[].
  READ TABLE gt_out WITH  KEY rstgr1 = '2002'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2003'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2006'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2007'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2009'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2011'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2013'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2015'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2017'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2019'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2021'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2023'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2025'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2027'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.
  gt_out-hslvt1 = lv_hslvt.
  gt_out-hsl011 = lv_hsl01.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = '200'.
*获取项目文本
  gt_out-txt401 = TEXT-t02.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  CONCATENATE gt_out-txt40 ':' INTO gt_out-txt40.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_DESC2
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_desc2  USING  pv_ergsl pv_ergsl1.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext,lr_racct[],ls_racct.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl.
  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.

  SELECT *
    FROM faglflext
    APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
   WHERE rbukrs = p_bukrs
     AND ryear = p_gjahr
     AND rldnr = '0L'
     AND racct IN lr_racct.

  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt = gt_out-hslvt + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = pv_ergsl1.
*获取项目文本
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.

  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl1.
  CONCATENATE gt_out-txt401 ':' INTO gt_out-txt401.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT3
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_amount3  USING pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[].
  CLEAR:lv_hslvt,lv_hsl01,gt_out,lr_racct[],ls_racct.

  READ TABLE gt_out WITH  KEY rstgr1 = '2101'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2103'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2105'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2107'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2109'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2111'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2113'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2115'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2117'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2119'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2121'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  gt_out-hslvt1 = lv_hslvt.
  gt_out-hsl011 = lv_hsl01.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl.
  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    gt_out-hslvt = gt_out-hslvt + lt_faglflext-hslvt.

    IF lt_faglflext-ryear = p_gjahr.
      CASE p_monat.
        WHEN '01'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01.
        WHEN '02'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02.
        WHEN '03'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03.
        WHEN '04'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04.
        WHEN '05'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05.
        WHEN '06'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06.
        WHEN '07'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07.
        WHEN '08'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08.
        WHEN '09'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09.
        WHEN '10'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10.
        WHEN '11'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11.
        WHEN '12'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12.
        WHEN '13'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13.
        WHEN '14'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14.
        WHEN '15'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14 + lt_faglflext-hsl15.
        WHEN '16'.
          gt_out-hsl01 = gt_out-hsl01  + lt_faglflext-hsl01
                                      + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                      + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                      + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                      + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                      + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                      + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                      + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                      + lt_faglflext-hsl16.
      ENDCASE.
    ENDIF.
*    GT_OUT-HSLVT = GT_OUT-HSLVT + LT_FAGLFLEXT-HSLVT.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hsl01 =  gt_out-hsl01 +  gt_out-hslvt.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = '300'.
*获取项目文本
  gt_out-txt401 = TEXT-t03.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT4
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_amount4  USING pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[].
  CLEAR:lv_hslvt,lv_hsl01,gt_out,lr_racct[],ls_racct.

  READ TABLE gt_out WITH  KEY rstgr1 = '200'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '300'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  gt_out-hslvt1 = lv_hslvt.
  gt_out-hsl011 = lv_hsl01.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'IFLY'
     AND ergsl = pv_ergsl.

  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl01 = gt_out-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt = gt_out-hslvt + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
*获取原因代码
  gt_out-rstgr = pv_ergsl.
  gt_out-rstgr1 = '400'.
*获取项目文本
  gt_out-txt401 = TEXT-t04.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt40
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT5
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_amount5  USING  pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[].
  CLEAR:lv_hslvt,lv_hsl01,gt_out,lr_racct[],ls_racct.
  READ TABLE gt_out WITH  KEY rstgr = '1101'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1103'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1105'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1107'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1109'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1111'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1113'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1115'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1117'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1119'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1121'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1123'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1125'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1127'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1129'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1131'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '1133'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.
  gt_out-hslvt = lv_hslvt.
  gt_out-hsl01 = lv_hsl01.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl.
  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt1 = gt_out-hslvt1 + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hslvt1 = gt_out-hslvt1 * -1.
  gt_out-hsl011 = gt_out-hsl011 * -1.
*获取原因代码
  gt_out-rstgr = '500'.
  gt_out-rstgr1 = pv_ergsl.
*获取项目文本
  gt_out-txt40 = TEXT-t05.
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  APPEND:gt_out.
  CLEAR:gt_out..

ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_ITEM1
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_item1  USING pv_ergsl.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  DATA:lv_ryear TYPE faglflext-ryear.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext[],lr_racct[],ls_racct.
*获取科目范围
  SELECT vonkt biskt
    FROM fagl_011zc
    INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
   WHERE versn = lc_versn
     AND ktopl = 'XXXX'
     AND ergsl = pv_ergsl.

  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.
  IF lr_racct[] IS NOT INITIAL.
    SELECT *
      FROM faglflext
      APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.
  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_out-hsl011 = gt_out-hsl011 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_out-hslvt1 = gt_out-hslvt1 + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_out-hslvt1 = gt_out-hslvt1 * -1.
  gt_out-hsl011 = gt_out-hsl011 * -1.
*获取原因代码
  gt_out-rstgr1 = pv_ergsl.
*获取项目文本
  SELECT SINGLE txt45
    FROM fagl_011qt
    INTO gt_out-txt401
   WHERE versn = '1000'
     AND spras = 'EN'
     AND ergsl = pv_ergsl.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT6
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_amount6 .
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  CLEAR:lv_hslvt,lv_hsl01,gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2201'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2203'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2205'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2207'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2209'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2211'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2213'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '2215'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2217'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2219'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2221'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '2223'.
  lv_hslvt = lv_hslvt + gt_out-hslvt1.
  lv_hsl01 = lv_hsl01 + gt_out-hsl011.
  CLEAR:gt_out.
  gt_out-hslvt1 = lv_hslvt.
  gt_out-hsl011 = lv_hsl01.

*获取原因代码
  gt_out-rstgr1 = '600'.
*获取项目文本
  gt_out-txt401 = TEXT-t06.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_AMOUNT7
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_amount7 .
  DATA:lv_hslvt TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "期末数
  DATA:lv_hslvt1 TYPE faglflext-hslvt.    "年初数
  DATA:lv_hsl011 TYPE faglflext-hsl01.    "期末数
  CLEAR:lv_hslvt,lv_hsl01,gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '100'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr = '500'.
  lv_hslvt = lv_hslvt + gt_out-hslvt.
  lv_hsl01 = lv_hsl01 + gt_out-hsl01.
  CLEAR:gt_out.

  CLEAR:gt_out.
  READ TABLE gt_out WITH  KEY rstgr1 = '400'.
  lv_hslvt1 = lv_hslvt1 + gt_out-hslvt1.
  lv_hsl011 = lv_hsl011 + gt_out-hsl011.
  CLEAR:gt_out.

  READ TABLE gt_out WITH  KEY rstgr1 = '600'.
  lv_hslvt1 = lv_hslvt1 + gt_out-hslvt1.
  lv_hsl011 = lv_hsl011 + gt_out-hsl011.
  CLEAR:gt_out.
  gt_out-hslvt = lv_hslvt.
  gt_out-hsl01 = lv_hsl01.

  gt_out-hslvt1 = lv_hslvt1.
  gt_out-hsl011 = lv_hsl011.
*获取原因代码
  gt_out-rstgr = '700'.
  gt_out-rstgr1 = '800'.
*获取项目文本
  gt_out-txt40 = TEXT-t07.
  gt_out-txt401 = TEXT-t08.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM display_data .
*创建FIELDCAT
  PERFORM build_fieldcat.
*创建LAYOUT
  PERFORM build_layout.
*展示数据
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_callback_program     = sy-repid
      i_callback_top_of_page = 'FRM_TOP_OF_PAGE'
*     I_DEFAULT              = 'X'
*     I_SAVE                 = 'X'
      is_layout_lvc          = gs_layout
      it_fieldcat_lvc        = gt_fieldcat
    TABLES
      t_outtab               = gt_out
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCAT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM build_fieldcat .
  %%fill_fcat:'TXT40'    TEXT-h01   '' '' '' '1' , "项目
              'HSLVT'    TEXT-h02   '' '' '' '2' , "年初数
              'HSL01'    TEXT-h03   '' '' '' '3' , "期末数
              'TXT401'    TEXT-h04   '' '' '' '4' , "项目
              'HSLVT1'    TEXT-h02   '' '' '' '5' , "年初数
              'HSL011'    TEXT-h03   '' '' '' '6' . "期末数
ENDFORM.
*&---------------------------------------------------------------------*
*& Form BUILD_LAYOUT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM build_layout .
  gs_layout-cwidth_opt = 'X'.
  gs_layout-zebra =  'X'.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  FRM_TOP_OF_PAGE
*&---------------------------------------------------------------------*
*       表头
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM  frm_top_of_page.
  DATA:lv_butxt TYPE t001-butxt.
  DATA: it_listheader TYPE slis_t_listheader.
  DATA lw_listheader TYPE slis_listheader.
  CLEAR: it_listheader, lw_listheader,lv_butxt.
  SELECT SINGLE butxt
    INTO lv_butxt
    FROM t001
   WHERE bukrs = p_bukrs.
  lw_listheader-typ  = 'H'.
  lw_listheader-info = '资产负债表'.
  APPEND lw_listheader TO it_listheader.

  CLEAR lw_listheader.
  lw_listheader-typ  = 'S'.
  lw_listheader-key  = '编制单位:'.
  lw_listheader-info = lv_butxt.
  APPEND lw_listheader TO it_listheader.

  CLEAR lw_listheader.
  CONCATENATE p_gjahr '年' p_monat '月' INTO lw_listheader-info.
  lw_listheader-typ  = 'S'.
  lw_listheader-key  = '编制日期:'.
  APPEND lw_listheader TO it_listheader.

  CLEAR lw_listheader.
  lw_listheader-typ  = 'S'.
  lw_listheader-key  = '单位:'.
  lw_listheader-info = '元'.
  APPEND lw_listheader TO it_listheader.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = it_listheader.
* "TCODE:OAOR,CLASS
* NAME:PICTURES,CLASS TYPE :OT,执行,可以看到所有的PICTURE
ENDFORM.                    "FRM_TOP_OF_PAGE
*&---------------------------------------------------------------------*
*& Form GET_ITEM2
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_item2 .
  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  DATA:lt_faglflext1 TYPE TABLE OF faglflext WITH HEADER LINE.
  DATA:lv_hsl TYPE acdoca-hsl.

  FIELD-SYMBOLS:<fs> TYPE any.
  DATA:lv_month TYPE bkpf-monat.
  CLEAR:lt_faglflext,lt_faglflext[].
  PERFORM get_lirun USING '3004' '' '' '-1'.
  PERFORM get_lirun USING '3005' '' '' '1'.
  PERFORM get_lirun USING '3006' '' '' '1'.
  PERFORM get_lirun USING '3007' '2000' '' '1'.
  PERFORM get_lirun USING '3008' '1000' '6602010000' '1'.
  PERFORM get_lirun USING '3009' '4000' '' '1'.
  PERFORM get_lirun USING '3011' '' '' '1'.
  PERFORM get_lirun USING '3013' '' '' '1'.
  PERFORM get_lirun USING '3015' '' '' '-1'.
  PERFORM get_lirun USING '3016' '' '' '1'.
  PERFORM get_lirun USING '3017' '' '' '-1'.
  PERFORM get_lirun USING '3019' '' '' '-1'.
  PERFORM get_lirun USING '3020' '' '' '-1'.
  PERFORM get_lirun USING '3021' '' '' '-1'.
  PERFORM item_data3023 USING '3023'.
  PERFORM get_lirun USING '3025' '' '' '-1'.
  PERFORM get_lirun USING '3027' '' '' '-1'.
  PERFORM get_lirun USING '3029' '' '' '1'.
  PERFORM get_lirun USING '3031' '' '' '1'.
  PERFORM item_data3033 USING '3033'.
  PERFORM get_lirun USING '3035' '' '' '1'.
  PERFORM item_data3037 USING '3037'.
  PERFORM get_lirun USING '3039' '' '' '0'.
  PERFORM get_lirun USING '3041' '' '' '0'.
  PERFORM get_lirun USING '3045' '' '' '0'.
  PERFORM get_lirun USING '3047' '' '' '0'.
  PERFORM get_lirun USING '3049' '' '' '0'.
  PERFORM get_lirun USING '3053' '' '' '0'.
  PERFORM get_lirun USING '3055' '' '' '0'.
  PERFORM get_lirun USING '3057' '' '' '0'.
  PERFORM item_data3061 USING '3061'.
  PERFORM get_lirun USING '3063' '' '' '0'.
  PERFORM item_data3067 USING '3067'.
  PERFORM get_lirun USING '3069' '' '' '0'.
  PERFORM get_lirun USING '3071' '' '' '0'.
  PERFORM get_lirun USING '3073' '' '' '0'.
  PERFORM get_lirun USING '3075' '' '' '0'.
  PERFORM item_data3 USING '3'.
  CLEAR:gt_out.
  SELECT *
    FROM faglflext
    INTO CORRESPONDING FIELDS OF TABLE lt_faglflext
   WHERE rbukrs = p_bukrs
     AND ryear = p_gjahr
     AND rldnr = '0L'
     AND ( racct LIKE '4104%' OR racct LIKE '4103%' ).
*     and racct = '4104060000'.
  LOOP AT lt_faglflext.
    gt_out-hslvt1 = gt_out-hslvt1 - lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
*--------------------begin--------------------*
  SELECT *
    FROM faglflext
    INTO CORRESPONDING FIELDS OF TABLE lt_faglflext1
    WHERE rbukrs = p_bukrs
     AND ryear = p_gjahr
     AND rldnr = '0L'
    AND ( racct LIKE '4103%' OR racct LIKE '4104%' ).
*     AND racct IN ( '4104060000','4103000000' ).
  CLEAR lv_hsl.
  LOOP AT lt_faglflext1.
    CASE p_monat.
      WHEN '01'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01.
      WHEN '02'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02.
      WHEN '03'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03.
      WHEN '04'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04.
      WHEN '05'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05.
      WHEN '06'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06.
      WHEN '07'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07.
      WHEN '08'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08.
      WHEN '09'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09.
      WHEN '10'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10.
      WHEN '11'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11.
      WHEN '12'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11
                                    + lt_faglflext1-hsl12.
      WHEN '13'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11
                                    + lt_faglflext1-hsl12 + lt_faglflext1-hsl13.
      WHEN '14'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11
                                    + lt_faglflext1-hsl12 + lt_faglflext1-hsl13
                                    + lt_faglflext1-hsl14.
      WHEN '15'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11
                                    + lt_faglflext1-hsl12 + lt_faglflext1-hsl13
                                    + lt_faglflext1-hsl14 + lt_faglflext1-hsl15.
      WHEN '16'.
        lv_hsl = lv_hsl + lt_faglflext1-hsl01
                                    + lt_faglflext1-hsl02 + lt_faglflext1-hsl03
                                    + lt_faglflext1-hsl04 + lt_faglflext1-hsl05
                                    + lt_faglflext1-hsl06 + lt_faglflext1-hsl07
                                    + lt_faglflext1-hsl08 + lt_faglflext1-hsl09
                                    + lt_faglflext1-hsl10 + lt_faglflext1-hsl11
                                    + lt_faglflext1-hsl12 + lt_faglflext1-hsl13
                                    + lt_faglflext1-hsl14 + lt_faglflext1-hsl15
                                    + lt_faglflext1-hsl16.

    ENDCASE.
    CLEAR:lt_faglflext1.
  ENDLOOP.
*--------end by suzh 20190606-----------------*
  READ TABLE gt_main WITH KEY ergsl = '3'.
*  GT_OUT-HSLVT1 = GT_MAIN-HSLVT.
*  gt_out-hsl011 = gt_out-hslvt1 + gt_main-hsl01.
  gt_out-hsl011 = gt_out-hslvt1 + gt_main-hsl01 - lv_hsl.

  gt_out-rstgr1 = '2219'.
  gt_out-txt401 = TEXT-t09.
  APPEND:gt_out.
  CLEAR:gt_out.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_LIRUN
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&      --> P_
*&      --> P_
*&      --> P_
*&---------------------------------------------------------------------*
FORM get_lirun  USING p_ergsl p_rfarea p_racct pv_c.
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CONSTANTS:lc_ktopl TYPE ska1-ktopl VALUE 'XXXX'.       "帐目表
  DATA:lv_ryear TYPE faglflext-ryear.
  RANGES:lr_racct FOR faglflext-racct.
  DATA:ls_racct LIKE LINE OF lr_racct.
  DATA:BEGIN OF lt_fagl_011zc OCCURS 0,
         vonkt TYPE fagl_011zc-vonkt, "科目间隔下限
         biskt TYPE fagl_011zc-biskt, "科目间隔上限
       END OF lt_fagl_011zc.

  DATA:lt_faglflext TYPE TABLE OF faglflext WITH HEADER LINE.
  CLEAR:lt_fagl_011zc,lt_fagl_011zc[],lt_faglflext,lt_faglflext,
  ls_racct,lr_racct[].
*财务报表项目
  gt_main-ergsl =  p_ergsl.

*获取科目间隔
  IF p_rfarea IS NOT INITIAL.
    SELECT vonkt biskt
      FROM fagl_011zc
      INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
     WHERE versn = lc_versn
       AND ktopl = 'IFLY'
       AND ergsl = '3007'.
  ELSE.
    SELECT vonkt biskt
      FROM fagl_011zc
      INTO CORRESPONDING FIELDS OF TABLE lt_fagl_011zc
     WHERE versn = lc_versn
       AND ktopl = 'XXXX'
       AND ergsl = p_ergsl.
  ENDIF.

  LOOP AT lt_fagl_011zc.
    IF lt_fagl_011zc-vonkt = lt_fagl_011zc-biskt.
      ls_racct-sign = 'I'.
      ls_racct-option = 'EQ'.
      ls_racct-low = lt_fagl_011zc-vonkt.
    ELSE.
      ls_racct-sign = 'I'.
      ls_racct-option = 'BT'.
      ls_racct-low = lt_fagl_011zc-vonkt.
      ls_racct-high = lt_fagl_011zc-biskt.
    ENDIF.
    APPEND ls_racct TO lr_racct.
    CLEAR:ls_racct.
  ENDLOOP.


  IF p_rfarea IS NOT INITIAL.
    SELECT *
      FROM faglflext
      INTO CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND rfarea = p_rfarea
       AND racct IN lr_racct.
  ELSE.
    SELECT *
      FROM faglflext
      INTO CORRESPONDING FIELDS OF TABLE lt_faglflext
     WHERE rbukrs = p_bukrs
       AND ryear = p_gjahr
       AND rldnr = '0L'
       AND racct IN lr_racct.
  ENDIF.

  IF p_racct IS NOT INITIAL.
    SELECT *
        FROM faglflext
        APPENDING CORRESPONDING FIELDS OF TABLE lt_faglflext
       WHERE rbukrs = p_bukrs
         AND ryear = p_gjahr
         AND rldnr = '0L'
         AND racct = p_racct.
  ENDIF.

  LOOP AT lt_faglflext.
    CASE p_monat.
      WHEN '01'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01.
      WHEN '02'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02.
      WHEN '03'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03.
      WHEN '04'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04.
      WHEN '05'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05.
      WHEN '06'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06.
      WHEN '07'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07.
      WHEN '08'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08.
      WHEN '09'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09.
      WHEN '10'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10.
      WHEN '11'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11.
      WHEN '12'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12.
      WHEN '13'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13.
      WHEN '14'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14.
      WHEN '15'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15.
      WHEN '16'.
        gt_main-hsl01 = gt_main-hsl01 + lt_faglflext-hslvt + lt_faglflext-hsl01
                                    + lt_faglflext-hsl02 + lt_faglflext-hsl03
                                    + lt_faglflext-hsl04 + lt_faglflext-hsl05
                                    + lt_faglflext-hsl06 + lt_faglflext-hsl07
                                    + lt_faglflext-hsl08 + lt_faglflext-hsl09
                                    + lt_faglflext-hsl10 + lt_faglflext-hsl11
                                    + lt_faglflext-hsl12 + lt_faglflext-hsl13
                                    + lt_faglflext-hsl14 + lt_faglflext-hsl15
                                    + lt_faglflext-hsl16.
    ENDCASE.
    gt_main-hslvt = gt_main-hslvt + lt_faglflext-hslvt.
    CLEAR:lt_faglflext.
  ENDLOOP.
  gt_main-hsl01 = gt_main-hsl01 * pv_c.
  gt_main-hslvt = gt_main-hslvt * pv_c.
  APPEND gt_main.
  CLEAR:gt_main.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3023
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3023  USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3004'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3005'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3006'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3007'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3008'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3009'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3010'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3011'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3013'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3015'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3016'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3017'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3019'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3020'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3021'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3033
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3033   USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3023'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3025'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3027'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3029'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3031'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3037
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3037  USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3033'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3035'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.

  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3061
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3061  USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3037'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3053'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3055'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3057'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3067
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3067  USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3061'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  CLEAR:gt_main.
  READ TABLE gt_main WITH KEY ergsl = '3063'.
  lv_hslvt = lv_hslvt - gt_main-hslvt.
  lv_hsl01 = lv_hsl01 - gt_main-hsl01.


  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form ITEM_DATA3
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> P_
*&---------------------------------------------------------------------*
FORM item_data3  USING  p_ergsl.
  DATA:lv_hslvt TYPE faglflext-hslvt.    "本期金额
  DATA:lv_hsl01 TYPE faglflext-hsl01.    "本年金额
  CONSTANTS:lc_versn TYPE fagl_011qt-versn VALUE '1000'. "会计报表版本
  CLEAR:gt_main,lv_hslvt,lv_hsl01.
  READ TABLE gt_main WITH KEY ergsl = '3037'.
  lv_hslvt = lv_hslvt + gt_main-hslvt.
  lv_hsl01 = lv_hsl01 + gt_main-hsl01.

  gt_main-hslvt = lv_hslvt.
  gt_main-hsl01 = lv_hsl01.
*财务报表项目
  gt_main-ergsl =  p_ergsl.
  APPEND gt_main.
  CLEAR:gt_main.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form AUTO_CHECK
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM auto_check .
  AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
    ID 'BUKRS' FIELD p_bukrs.
*    ID 'ACTVT' FIELD 'xxxxxxxx'.
  IF sy-subrc <> 0.
    MESSAGE e000(00) WITH '您没有权限查看此数据' DISPLAY LIKE 'E'.
  ENDIF.
ENDFORM.

2、利润表(损益表)

利润表反应某一会计期间内经营及分配的会计报表。

对利润表进行分析,只要从两方面入手:

1.收入项目分析。公司通过销售产品、提供劳务取得各项营业收入,也可以将资源提供给他人使用,获得租金与利息等营业外收入。收入的增加,意味着公司资产的增加或负债的减少

2.费用项目分析。费用是收入的扣除,费用的确认、扣除正确与否直接关系到公司的盈利。所以分析费用项目时,应首先注意费用包含的内容是否适当,确认费用应贯彻权责发生制原则、历史成本原则、划分收益性支出与资本性支出的原则等。其次,要对成本费用的结构与变动趋势进行分析,分析各项费用占营业收入百分比,分析费用结构是否合理,对不合理的费用要查明原因。同时对费用的各个项目进行分析,看看各个项目的增减变动趋势,以此判定公司的管理水平和财务状况,预测公司的发展前景。

对于公司而言,赚到的钱和花出去的钱都包括哪些方面呢?这就是损益表的组成了。

   * 收入:公司在经营活动中收到的钱,例如卖出20万的货物,那么这20万就是业务收入;

   * 成本:企业生产产品过程中的耗费成本,也即“料、工、费”,包括使用的各种原材料的成本和工人的工资费用等;

   * 销售费用:销售过程中产生的费用,例如宣传费用、广告费用等;

   * 管理费用:在组织管理企业过程中产生的费用,例如工人的培训,差旅费,办公费用等等;

   * 财务费用:例如向银行的借款利息,由于汇率变动造成的汇率损失等等;

   * 资产减值损失:固定资产的折旧减值,无形资产的减值损失等;

   * 营业外收支:与企业生产经营活动没有直接关系的各种收入和支出,例如捐赠、罚款等等;

   * 所得税:主要指增值税。

企业赚钱主要靠的是 - 主营业务收入;

但在赚钱过程中,也有很多花钱的地方,可以简称为 - “造卖管筹”:

     造 - 生产执照过程中的花费(营业成本);

     卖 - 销售过程中的花费(销售费用);

     管 - 公司的运营成本(管理费用);

     筹 - 用筹集来的钱也是有成本的(财务费用);

    * 毛利

              毛利 = 收入 - 成本

    * 销售利润(营销贡献)

              销售利润 = 收入 - 成本 - 销售费用

    * 经营成果(息税前利润 EBIT)

              经营成果 = 收入 - 成本 - 销售费用 - 管理费用

    * 营业利润(息税、折旧及分摊前利润 EBITDA)

              营业利润 = 收入 - 成本 - 销售费用 - 管理费用 - 财务费用

    * 税前利润

             税前利润 = 收入 - 成本 - 销售费用 - 管理费用 - 财务费用 + 资产减值 + 营业外收支

    * 净利润

              净利润 =  收入 - 成本 - 销售费用 - 管理费用 - 财务费用 + 资产减值 + 营业外收支 - 所得税

3、现金流量表 ( Statement of cash flows )

通过一家企业的现金流,可以反映出一家企业的经营活动、投资活动、和筹资活动对企业现金流的影响。

经营活动(生产、制造、销售产品)、投资活动(股票、债券)、筹资活动(借款、贷款、融资)归根结底可以归纳为以下三个问题 - 

1.现金净流量与短期偿债能力的变化。如果本期现金净流量增加,表明公司短期偿债能力增强,财务状况得到改善;反之,则表明公司财务状况比较困难。但是如果公司的现金净流量过大,表明公司未能有效利用这部分资金,其实是一种资源浪费。

2.现金流入量的结构与公司的长期稳定。经营活动是公司的主营业务,这种活动提供的现金流量,可以不断用于投资,再生出新的现金来,来自主营业务的现金流量越多,表明公司发展的稳定性也就越强。公司的投资活动是为闲置资金寻找投资场所,筹资活动则是为经营活动筹集资金,这两种活动所发生的现金流量,都是辅助性的,服务于主营业务的。这一部分的现金流量过大,表明公司财务缺乏稳定性。

3.投资活动与筹资活动产生的现金流量与公司的未来发展。分析投资活动时,一定要注意分析是对内投资还是对外投资。对内投资的现金流出量增加,意味着固定资产、无形资产等的增加,说明公司正在扩张,这样的公司成长性较好;如果对内投资的现金流量大幅增加,意味着公司正常的经营活动没有能够充分吸纳现有的资金,资金的利用效率有待提高;对外投资的现金流入量大幅增加,意味着公司现有的资金不能满足经营需要,从外部引入了资金;如果对外投资的现金流出量大幅增加,说明公司正在通过非主营业务活动来获取利润。

 

  • 2
    点赞
  • 27
    收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论

打赏作者

SAP小白kenny

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值