REPORT ztest.
TYPE-POOLS: slis.
TABLES: anla,
anlb,
anlc,
anlz,
t093d.
*--------------------------------------------------------------------*
* INTERNAL TABLE DECLARATION
*--------------------------------------------------------------------*
DATA: it_t093d LIKE t093d OCCURS 1 WITH HEADER LINE,
it_anfm LIKE anfm OCCURS 1 WITH HEADER LINE,
it_anlb LIKE anlb OCCURS 1 WITH HEADER LINE,
it_anlc LIKE anlc OCCURS 10 WITH HEADER LINE,
it_anlp LIKE anlp OCCURS 1 WITH HEADER LINE,
it_resu LIKE anlp OCCURS 1 WITH HEADER LINE,
it_anlz LIKE anlz OCCURS 1 WITH HEADER LINE.
DATA: w_peraf LIKE t093d-afblpe,
w_afblpe LIKE t093d-afblpe.
DATA: wa_anlp LIKE anlp.
*--------------------------------------------------------------------*
* CONSTANTS
*--------------------------------------------------------------------*
CONSTANTS: c_max TYPE afblpe VALUE '012',
c_min TYPE afblpe VALUE '001'.
*--------------------------------------------------------------------*
* SELECTION SCREEN
*--------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE anlb-bukrs,
p_anln1 TYPE anlb-anln1,
p_anln2 TYPE anlb-anln2,
p_gjahr TYPE anlc-gjahr.
SELECTION-SCREEN END OF BLOCK blk.
*--------------------------------------------------------------------*
* START-OF-SELECTION
*--------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM get_data.
PERFORM display_result.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
FORM get_data.
SELECT SINGLE * FROM anla WHERE bukrs EQ p_bukrs AND
anln1 EQ p_anln1 AND
anln2 EQ p_anln2.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlb FROM anlb WHERE bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2 AND afabe EQ '01'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlc FROM anlc WHERE bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2 AND gjahr EQ p_gjahr AND afabe EQ '01'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_anlz FROM anlz WHERE bukrs EQ p_bukrs AND anln1 EQ p_anln1 AND anln2 EQ p_anln2.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_t093d FROM t093d WHERE bukrs EQ p_bukrs AND afaber EQ '01'.
READ TABLE it_anlc INDEX 1.
IF sy-subrc EQ 0.
w_afblpe = it_anlc-afblpe.
IF w_afblpe EQ 0.
READ TABLE it_t093d WITH KEY afblgj = p_gjahr.
IF sy-subrc EQ 0.
w_afblpe = it_t093d-afblpe.
ENDIF.
ENDIF.
ENDIF.
w_peraf = '001' + w_afblpe.
WHILE w_peraf LE c_max.
IF w_peraf GT w_afblpe.
LOOP AT it_t093d.
IF w_peraf GT c_min.
it_t093d-afblgj = p_gjahr.
it_t093d-afblpe = w_peraf - '001'.
it_t093d-afbanz = '01'.
it_t093d-status = '2'.
ELSE.
it_t093d-afblgj = '0000'.
it_t093d-afblpe = '000'.
it_t093d-afbanz = '00'.
it_t093d-status = '0'.
ENDIF.
MODIFY it_t093d.
ENDLOOP.
ENDIF.
CLEAR it_anlp. REFRESH it_anlp.
CALL FUNCTION 'RA_AFABUCHEN'
EXPORTING
i_afbgjr = p_gjahr
i_afbper = w_peraf
i_again = space
i_anla = anla
i_fehler = 'X'
i_nocheck = 'X'
i_plansatz = 'X'
i_refresh = 'X'
TABLES
t_093d = it_t093d
t_anfm = it_anfm
t_anlb = it_anlb
t_anlc = it_anlc
t_anlp = it_anlp
t_anlz = it_anlz
EXCEPTIONS
diff_years = 1
no_assets_computed = 2
no_posting_period = 3
period_already_posted = 4
period_false = 5
posting_period_forgotten = 6
post_not_posible = 7
OTHERS = 8.
IF sy-subrc EQ 0.
it_resu = it_anlp.
APPEND it_resu.
ENDIF.
ADD 1 TO w_peraf.
ENDWHILE.
ENDFORM. "GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_RESULT
*&---------------------------------------------------------------------*
FORM display_result .
DATA: l_alv TYPE REF TO cl_salv_table,
l_oref TYPE REF TO cx_root,
l_str TYPE string,
l_grid TYPE REF TO cl_gui_custom_container.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = l_alv
CHANGING
t_table = it_resu[].
l_alv->display( ).
CATCH cx_salv_msg INTO l_oref.
l_str = l_oref->get_text( ).
ENDTRY.
ENDFORM. " DISPLAY_RESULT
分享到:
相关推荐
Query Retrieve SCP Emulator
// indicate that the factory will retrieve the value from shared preferences @SharedPreference(key = "keyOfMyInt", defaultValue = "8964") abstract int myIntFromPreference(); ...
描述PB的并发控制机制,详细解释Row changed between retrieve and update错误出现的原因,以及处理方法。对学习PB有一定的帮助。
information retrieve textbook from Standford university
retrieve_data
Basic Save and Retrieve Functions
We propose a novel Knowledge-driven Encode, Retrieve, Paraphrase (KERP) approach which reconciles traditional knowledge- and retrieval-based methods with modern learning-based methods for accurate ...
In order to help mitigate the risk of cross-site scripting, a new feature has been introduced in Microsoft Internet Explorer 6 SP1. This feature is a new attribute for cookies which prevents them from...
retrieve_sqlite_data
Retrieve Form for Data Capture (RFD)
In addition to storing, Ringo should be able to retrieve individual or small sets of data items with low latencies () and provide a convenient on-disk format for bulk data access. 标签:...
Demonstrates how to retrieve various information about specific windows
This demonstrates how to retrieve information about Battery Powered machines.
This demonstrates how to write and retrieve information from the registry.
使用PL/SQL登录ORACLE数据 报错,error while trying to retrieve text for error ORA-01804,的解决方法,操作步骤,在windows server 2008R2 64位,oracle 12C,PLSQL Developer 12 64位,以上使用环境正常,
TILISOFT Internet ActiveX Controls - Retrieve HTML pages from the Net - Post data to HTTP server
This module demostrates how to retrieve information about a joystick. This is a great module for game programmers.
资源来自pypi官网。 资源全名:retrieve-0.0.6.tar.gz
This demonstrates how to retrieve the file size from a specified file.