ALV на экране выбора
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
TABLES: sflight. CLASS lcl_report DEFINITION. PUBLIC SECTION. DATA: mt_data TYPE STANDARD TABLE OF sflight, r_carrid TYPE RANGE OF sflight-carrid. METHODS: get_data, generate_output. ENDCLASS. DATA: lo_report TYPE REF TO lcl_report. SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa. SELECT-OPTIONS: s_carrid FOR sflight-carrid. SELECTION-SCREEN: END OF BLOCK blk1. INITIALIZATION. aaa = 'Критерии выбора'. CREATE OBJECT lo_report. lo_report->generate_output( ). START-OF-SELECTION. lo_report->r_carrid = s_carrid[]. lo_report->get_data( ). CLASS lcl_report IMPLEMENTATION. METHOD get_data. SELECT * FROM sflight INTO TABLE me->mt_data WHERE carrid IN s_carrid. IF sy-dbcnt IS INITIAL. MESSAGE s398(00) WITH 'По заданным критериям данных нет'. ENDIF. EXPORT data = me->mt_data TO MEMORY ID sy-cprog. ENDMETHOD. METHOD generate_output. IMPORT data = me->mt_data FROM MEMORY ID sy-cprog. FREE MEMORY ID sy-cprog. CHECK me->mt_data IS NOT INITIAL. DATA(lo_dock) = NEW cl_gui_docking_container( repid = sy-cprog dynnr = sy-dynnr ratio = 80 side = cl_gui_docking_container=>dock_at_bottom name = 'DOCK_CONT' ). cl_salv_table=>factory( EXPORTING list_display = if_salv_c_bool_sap=>false r_container = CAST #( lo_dock ) container_name = 'DOCK_CONT' IMPORTING r_salv_table = DATA(lo_alv) CHANGING t_table = me->mt_data ). lo_alv->get_functions( )->set_all( abap_true ). lo_alv->display( ). ENDMETHOD. ENDCLASS. |
Альтернативным вариантом может быть использование подэкранов.