Application Development and Automation 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: 
Read only

Dynamically changing Grid title in alv using class

Former Member
0 Likes
1,178

Hi all,

I need to get grid title dynamically for single screen for user actions through buttons.What is the option available in cl_gui_alv_grid.

in reuse_alv_grid_display one field grid_title is available .but here i could not able to find anything like this .how to solve this issue.

thanks in advance,

raja

1 REPLY 1
Read only

Shivaji16
Active Participant
0 Likes
514

When user presses a button on the application toolbar....with function code ( say TITL ) then the grid_title field can be changed manually and can be reflected in the display by refreshing the table using the method below..

please try this....

flag = 1.

FORM user_command USING u_ucomm LIKE sy-ucomm

us_selfield TYPE slis_selfield.

CASE u_ucomm.

WHEN 'TITL'.

IF flag EQ 1.

flag = 2.

grid_title = 'ALV_DISPLAY_1'.

CALL METHOD grid->refresh_table_display

EXPORTING

IS_STABLE =

  • I_SOFT_REFRESH =

EXCEPTIONS

FINISHED = 1

others = 2.

elseif flag eq 2.

flag = 1.

grid_title = 'ALV_DISPLAY_2'.

CALL METHOD grid->refresh_table_display

EXPORTING

IS_STABLE =

  • I_SOFT_REFRESH =

EXCEPTIONS

FINISHED = 1

others = 2.

endif.

ENDCASE.

ENDFORM.