Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Change ALV Layout not from Menu, but from pushbutton

Former Member
0 Kudos

Hi. Old ABAP report has pushbutton to change display od a report. I updated report and created layouts similar to old one. Users want to change layout by pressing button. Do not want to use menu Settings/Layout/Choose ... I added pushbuttons but cannot make the selected layout appear. Any hints? Thanks a lot!

1 REPLY 1

Former Member
0 Kudos

Are you using a Function Module or Object? If you are using the FM REUSE_ALV_LIST_DISPLAY, you can use the parameters I_CALLBACK_PF_STATUS_SET and I_CALLBACK_USER_COMMAND. Set them to the names of their corresponding subroutines that you create. First, you will need to define your own ALV GUI Status. You may copy GUI Status 'STANDARD' of function group SALV and add your buttons. The following is an example of how to use the parameters:

i_callback_pf_status_set = 'SET_ALV_GUI_STATUS'

i_callback_user_command = 'GET_ALV_UCOMM'

FORM set_alv_gui_status USING rt_extab

TYPE slis_t_extab.

SET PF-STATUS 'ZGUIALV' EXCLUDING excluding.

ENDFORM. " set_alv_gui_status

FORM get_alv_ucomm USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

ok_code = r_ucomm.

CASE ok_code.

WHEN 'CUSTOM_BUTTON1'.

  • Move your layout name to the function mod

parameter is_layout here based on the button

selected.

WHEN 'CUSTOM_BUTTON2.

  • Move your layout name to the function mod

parameter is_layout here based on the button

selected.

.

.

.

ENDCASE.

ENDFORM. " get_alv_ucomm