Use of ALV LAYOUT- Displaying detailed information in a pop up screen
The previous post REUSE_ALV_LIST_DISPLAY- 9 shows how to display check box and traffic light together in list alv. This post shows how to display the detailed information in a new popup window.
Code Snippet: The detailed information appears in a new screen.
———-data declarations——–
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_flight.
INCLUDE STRUCTURE spfli.
TYPES: END OF ty_flight.
DATA: lt_spfli TYPE TABLE OF ty_flight.
DATA: ls_spfli TYPE ty_flight.
DATA: ls_layout TYPE slis_layout_alv.
———————————–
START-OF-SELECTION.
PERFORM build_data.
PERFORM build_layout.
PERFORM display_list_alv.
&————————————————-
& Form BUILD_DATA
&————————————————-
FORM build_data.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE lt_spfli.
ENDFORM. ” BUILD_DATA
&————————————————–
& Form BUILD_LAYOUT
&————————————————–
FORM build_layout.
ls_layout-zebra = ‘X’.
ENDFORM. ” BUILD_LAYOUT
&—————————————————
& Form DISPLAY_LIST_ALV
&—————————————————-*
FORM display_list_alv.
CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’
EXPORTING
i_callback_program = sy-cprog
i_structure_name = ‘SPFLI’
is_layout = ls_layout
TABLES
t_outtab = lt_spfli
EXCEPTIONS
program_error = 1
OTHERS = 2.
CASE sy-subrc.
WHEN 1.
MESSAGE ‘Program Error’ TYPE ‘I’.
WHEN OTHERS.
ENDCASE.
ENDFORM. ” DISPLAY_LIST_ALV
Program Output: Select a row and click on the details button.
The detailed information appears in a new screen and to go back to the first screen click back button or the overview button.
It is quite possible in list alv to display the detailed information not in a different screen but in a pop up screen by setting the layout property.
Code Snippet: The detailed information appears in a new popup window.
———-data declarations——–
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_flight.
INCLUDE STRUCTURE spfli.
TYPES: END OF ty_flight.
DATA: lt_spfli TYPE TABLE OF ty_flight.
DATA: ls_spfli TYPE ty_flight.
DATA: ls_layout TYPE slis_layout_alv.
———————————–
START-OF-SELECTION.
PERFORM build_data.
PERFORM build_layout.
PERFORM display_list_alv.
&————————————————-
& Form BUILD_DATA
&————————————————-
FORM build_data.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE lt_spfli.
ENDFORM. ” BUILD_DATA
&————————————————–
& Form BUILD_LAYOUT
&————————————————–
FORM build_layout.
ls_layout-zebra = ‘X’.
ls_layout-detail_popup = ‘X’. ” To make the detailed information appear in a pop up window
ENDFORM. ” BUILD_LAYOUT
&—————————————————
& Form DISPLAY_LIST_ALV
&—————————————————-*
FORM display_list_alv.
CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’
EXPORTING
i_callback_program = sy-cprog
i_structure_name = ‘SPFLI’
is_layout = ls_layout
TABLES
t_outtab = lt_spfli
EXCEPTIONS
program_error = 1
OTHERS = 2.
CASE sy-subrc.
WHEN 1.
MESSAGE ‘Program Error’ TYPE ‘I’.
WHEN OTHERS.
ENDCASE.
ENDFORM. ” DISPLAY_LIST_ALV
Program Output: Select a line and click on the details button.
The detailed information screen appears in a new popup window rather than in a new screen.
One comment