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 SAP Standard ALV Layout

Former Member
0 Kudos

Hi,

How can i change the SAP standard ALV layout of for a transaction.

If i create a new variant in the DEV will it be automatically be transported.

Regards

Arun

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

No, the layouts will not be transportable.

Regards,

Rich Heilman

0 Kudos

Hi ,

My exact requirement is that as per the specification i was asked to add a new field into a standard structure which holds data to be displayed by the transcation. I have added the field and populated data into it.

But the program on execution takes the SAP default layout variant and this layout does not contain the new field added by me.

What do i do in this case.

Regards

Arun

0 Kudos

Hi Arun,

Make that new layout the defalut one. This you can do it after displaying the list, when you go in to the menu options you will find the path to make that layout default.

The better program logic to use incase of ALV is to have one parameter in your selection-screen for the ALV Display Variant. And populate this with the default variant on loading. also give F4 help to that parameter. This gives the flexibility to the user to change the variants.

search for FMs REUSE_ALV_VARIANT* and you will find the FMs that would help you here.

Deepak

Former Member
0 Kudos

Hello,

I don't know if you have already resolved the issue, but ALV layouts are transportable.

You can do this with program BCALV_LAYOUT_IMPORT. For the selection screen the difficulty is to determine the actual layout handle. THis can be BLANK, '0001', or any other combination.

Regards,

Andreas

0 Kudos

You can identify the selection criteria for BCALV_LAYOUT_IMPORT by using SE16 on the view V_LTDX. Enter the report name and the variant name and you will get the other data that you need.

Former Member
0 Kudos

Hi, Dion Ellison's reply is right.

If you want to load a layout to ALV when display it, you must maintenance a disvariant on the ALV, and it will be stored in the table V_LTDX.

When you want to achieve your target, read the ALV variant from the table, fill it into the structure DISVARIANT.

call method like following:

CALL METHOD GO_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING I_STRUCTURE_NAME = 'XXXX'

IS_VARIANT = DISVARIANT

I_SAVE = 'U'

CHANGING IT_OUTTAB = XXX

IT_FIELDCATALOG = XXX.

aware that if I_SAVE = 'U', the disvariant is user-specific(you save it as this type.)

then it will directly show the ALV using the disvariant you set.

But as you want to using it in a Standard ALV, is it possible to change the parameter in SAP code?