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

ALV toolbar layout selection

Former Member
0 Likes
1,082

Hallo,

on a ALV grid toolbar you have a standard button to select a Layout or to change a layout.

But i want to have all of the 4 possibilities in it. you will get a menu with selection.

for example i did this:

<lfs_toolbar>-function = '&MB_VARIANT'.

<lfs_toolbar>-icon = icon_alv_variant_choose.

<lfs_toolbar>-quickinfo = 'Layout selecteren...'.

<lfs_toolbar>-butn_type = 1.

but you only get 1 possibility and that is to select a layout.

I want :

- Select layout

- Change layout

- Save layout

- Manage layout

how can I do that? is this standaard? I can't find it

please help me

Akin

2 REPLIES 2
Read only

Former Member
0 Likes
828

Some ideas that can help you :

1. If you have seen this in any transaction or report . just try to find out how is it implemented.

2. You can create your own PF status and then make these as menu option or them as buttons. In this you need to handle these by sy-ucomm . This will also require study of how these functions

- Select layout

- Change layout

- Save layout

- Manage layout

are implemented in standard. Debug and try.

Hope this helps you.

Read only

Former Member
0 Likes
828

Hallo,

I already have it.

You only have to do is add a variant to it. that's it!

this is it:

make a variable:

Data: gs_variant TYPE disvariant.

give it youre reportname to it: gs_variant-report = sy-repid.

use it with youre Call Method!! -> then it will come automatically!!

CALL METHOD gr_grid->set_table_for_first_display

EXPORTING

i_buffer_active = abap_false

i_bypassing_buffer = abap_true

is_layout = gs_layout

is_variant = gs_variant

  • it_toolbar_excluding = lt_excluded

i_save = 'A'

CHANGING

it_outtab = gt_outtab

it_fieldcatalog = ut_fieldcat

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.