开发一个程序
*&---------------------------------------------------------------------* *& Report ZGQ_TEST9 *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT zgq_test9. DATA:BEGIN OF lt_data OCCURS 0. INCLUDE STRUCTURE yvtr. DATA: result LIKE trpari-s_checked, cli_dep LIKE trpari-w_cli_dep, srcsystem LIKE tadir-srcsystem, devclass LIKE tadir-devclass, author LIKE tadir-author, masterlang LIKE tadir-masterlang, srcdep LIKE tadir-srcdep, delflag LIKE tadir-delflag, END OF lt_data. DATA: ls_tadir_key LIKE tadir, ls_tadir LIKE tadir, lt_tadir TYPE TABLE OF tadir, ls_e071 TYPE e071. TABLES:e071,e070. SELECT-OPTIONS:s_user FOR e070-as4user, s_tr FOR e071-trkorr, s_object FOR e071-object, s_name FOR e071-obj_name. SELECT * INTO TABLE @lt_data FROM yvtr WHERE as4user IN @s_user AND trkorr IN @s_tr AND object IN @s_object AND obj_name IN @s_name . LOOP AT lt_data ASSIGNING FIELD-SYMBOL(<fs>). CLEAR:ls_tadir_key,ls_e071. MOVE-CORRESPONDING <fs> TO ls_e071. CALL FUNCTION 'TR_CHECK_TYPE' EXPORTING wi_e071 = ls_e071 IMPORTING pe_result = <fs>-result we_cli_dep = <fs>-cli_dep we_tadir = ls_tadir_key. IF <fs>-result CA 'L'. CLEAR ls_tadir. READ TABLE lt_tadir INTO ls_tadir WITH KEY pgmid = ls_tadir_key-pgmid object = ls_tadir_key-object obj_name = ls_tadir_key-obj_name BINARY SEARCH. IF sy-subrc <> 0. SELECT SINGLE * FROM tadir INTO ls_tadir WHERE pgmid = ls_tadir_key-pgmid AND object = ls_tadir_key-object AND obj_name = ls_tadir_key-obj_name. INSERT ls_tadir INTO lt_tadir INDEX sy-tabix. ENDIF. IF ls_tadir-obj_name <> space. <fs>-srcsystem = ls_tadir-srcsystem. <fs>-devclass = ls_tadir-devclass. <fs>-author = ls_tadir-author. <fs>-masterlang = ls_tadir-masterlang. <fs>-srcdep = ls_tadir-srcdep. <fs>-delflag = ls_tadir-delflag. ENDIF. ENDIF. ENDLOOP. DATA: ls_layout TYPE slis_layout_alv, lt_fieldcat TYPE slis_t_fieldcat_alv. DATA: lv_repid LIKE sy-repid, lv_include LIKE trdir-name. ls_layout-zebra = 'X'. ls_layout-colwidth_optimize = ' '. lv_repid = sy-repid. lv_include = sy-repid. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = lv_repid i_internal_tabname = 'LT_DATA' i_inclname = lv_include CHANGING ct_fieldcat = lt_fieldcat[] EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. LEAVE. ENDIF. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * i_buffer_active = 'X' i_callback_program = lv_repid * i_callback_pf_status_set = 'LST_SET_STATUS' * i_callback_user_command = 'LST_USER_COMMAND' * i_structure_name = 'GT_OBJECTS' is_layout = ls_layout it_fieldcat = lt_fieldcat * it_events = pt_events i_save = 'A' TABLES t_outtab = lt_data EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. ENDIF.