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 -grid

Former Member
0 Likes
1,002

Hi,

I am looking help on ALV grid (output).

By default in the output of report i get 5 fields using ALV grid.

After getting this list , i have a option to increase and choose more fields.

Let us say i have added 2 more to already existing 5 fields.

So from the next time, when ever user executes the report he should get the 7 fields as default.

is the possible with out touching the source code of the report.

regards

Satheesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
900

Create a variant , save the layout and make it default.

Regards,

Subramanian V.

Hi,

I am looking help on ALV grid (output).

By default in the output of report i get 5 fields using ALV grid.

After getting this list , i have a option to increase and choose more fields.

Let us say i have added 2 more to already existing 5 fields.

So from the next time, when ever user executes the report he should get the 7 fields as default.

is the possible with out touching the source code of the report.

regards

Satheesh

6 REPLIES 6
Read only

Former Member
0 Likes
901

Create a variant , save the layout and make it default.

Regards,

Subramanian V.

Read only

andreas_mann3
Active Contributor
0 Likes
900

yes,

-> fill parm. is_variant and i_save

CALL METHOD grid1->set_table_for_first_display

EXPORTING i_structure_name = 'ZTAB'

is_layout = lay

it_toolbar_excluding = tb0

is_variant = gs_variant

i_save = x_save

...

regards Andreas

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
900

Yes, you can save the layouts, as global, or as user specific. As well as making a layout a default.

On the ALV toolbar, there should be an icon for changing layouts and saving layouts. Experiment with these functions.

Regards,

Rich Heilman

Read only

0 Likes
900

Thanks rich , i have already checked the option.

It didnt help me.

Any way let me try other options.

satheesh

Read only

0 Likes
900

Is this a standard SAP program or a custom Z program? If Z program, is it that it will not let you save the layout?

Regards,

Rich Heilman

Read only

0 Likes
900

If the program is not allowing you to save, you need to fill the parameters when calling the method.



  data: variant type  disvariant.

  variant-report = sy-repid.
  variant-username = sy-uname.

  call method alv_grid->set_table_for_first_display
      exporting
           is_layout              = layout
<b>        is_variant             = variant
           i_save                 = 'U'</b>
           i_structure_name       = 'I_ALV'
      changing
           it_outtab       = i_alv[]
           it_fieldcatalog = fieldcat[].

Regards,

Rich Heilman