cancel
Showing results for 
Search instead for 
Did you mean: 

Change Layout after set_table_for_first_display

Former Member
0 Kudos

Folks,

I have a requirement where I need to create new button in ALV toolbar and if user clicked on that button Layout2 is to be set and display in the ALV.

So I have created new Button in ALV toolbar,

      Created new layout as well.

Please guide me how I can set this new layout on user action. i.e. after SET_TABLE_FOR_FIRST_DISPLAY.

Thanks,

Anmol.

Accepted Solutions (0)

Answers (2)

Answers (2)

kesavadas_thekkillath
Active Contributor
0 Kudos

Make use of the parameter IS_VARIANT in SET_TABLE_FOR_FIRST_DISPLAY to toggle between the layouts.

phillip_manning2
Explorer
0 Kudos

Try method SET_TOOLBAR_INTERACTIVE

That will trigger the toolbar event again.

Cheers,

Phil

Former Member
0 Kudos

Hi Phil,

Thanks for your replay.

My button is getting triggered, the real question is how to change the layout( Variant ) after pressing this button.

Please help.

Thanks,

Anmol.

Former Member
0 Kudos

Hi Anmol,

After your button is triggered, please try using the method SET_FRONTEND_LAYOUT in the class CL_GUI_ALV_GRID. I guess you can set the ALV layout using this method. It has a parameter which is the layout name you have created.

Hope this helps you.

Regards,

Sindhu Pulluru.

Private_Member_49934
Contributor
0 Kudos

Are you interested in variant or layout?

If layout use the method SET_FRONTEND_LAYOUT

if variant then use the method SET_VARIANT

And don't forget to call the method REFRESH_TABLE_DISPLAY after calling the above methods