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: 

About OO ALV Layout Variant

Former Member
0 Kudos

hi, all

How can i save the layout variant for oo alv?

Thanks for your help!

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Just pass the appropriate parameters to turn this functionality on in the ALV output.



  DATA: VARIANT TYPE  DISVARIANT.

  VARIANT-REPORT = SY-REPID.
  VARIANT-USERNAME = SY-UNAME.

  CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
           IS_VARIANT             = VARIANT
           I_SAVE                 = 'A'
      CHANGING
           IT_OUTTAB       = IALV[]
           IT_FIELDCATALOG = FIELDCAT[].

Regards,

Rich Heilman

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Just pass the appropriate parameters to turn this functionality on in the ALV output.



  DATA: VARIANT TYPE  DISVARIANT.

  VARIANT-REPORT = SY-REPID.
  VARIANT-USERNAME = SY-UNAME.

  CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
           IS_VARIANT             = VARIANT
           I_SAVE                 = 'A'
      CHANGING
           IT_OUTTAB       = IALV[]
           IT_FIELDCATALOG = FIELDCAT[].

Regards,

Rich Heilman

Former Member
0 Kudos

Pass

IS_VARIANT = VARIANT

I_SAVE = 'A'

in the FM, this will make the change layout/save layout icon available in the toolbar. Change your layout as needed and then save it.