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: 

Regarding layouts in ALV Grid Display

Former Member
0 Kudos

Dear all,

I am working on alv reports using Function modules. In grid display we will get CHANGE LAYOUT icon.Here i want to change that CHANGE LAYOUT to LAYOUT SETTINGS which allow us to select layout, save layout,change layout and manage layout. My intension is to save a layout. So, can anybody suggest me how can i do this.

Thanks,

Vineel

8 REPLIES 8

Former Member
0 Kudos

Hi Vineel,

Just pass the 'A/U' to the I_SAVE parameter to your REUSE_ALV_GRID_DISPLAY Function module. Then you problem will be solved.

<b> A=all, U = user-specific</b>

Warm Regards,

Vijay

Message was edited by:

Vijaya Bhaskarudu Gangisetty

Former Member
0 Kudos
try this

 data: variant type disvariant.     
  variant-report = sy-repid.           
  variant-username  = sy-uname.   
 
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            it_fieldcat = fieldcat
            is_variant  = variant     
            i_save      = 'A'            
       tables
            t_outtab    = itab.

0 Kudos

Hi chndrashekar,

Thanks for ur valuble reply. Now i got what exactly i want. Can u plz explain me how that logic got worked out.

Thnks,

Vineel

0 Kudos

hi vineel,

This variant structure is only relevant if display variants are to be saved

and/or read.

Variant information including the name of the list variant that is use

to output the list.

If you also want to allow display variants to be saved, you must

additionally fill parameter I_SAVE accordingly.

<b>

Reward points for helpful answers</b>

Former Member
0 Kudos

hi

good

as per your requirement you have to create a button similar to change layout in menu painter and you have to use that as per your requirement.

thanks

mrutyun^

Former Member
0 Kudos

Hi,

data: v_variant type disvariant.

v_variant-report = 'YPMR4100_OIMS'.

V_VARIANT-USERNAME = SY-UNAME.

CALL METHOD details_grid->set_table_for_first_display

EXPORTING i_structure_name = 'YWO_OIMS_DETAIL'

is_layout = layout

is_variant = v_variant

i_save = 'U'

the above code will help you.

regards,

LKK

Former Member
0 Kudos

Hi,

U can do this by selectiong what all u want in the display and then clicking on the <b>save layout</b> button.

for that, the menu painter must contain all required fields. U can do it by copying the standard sap menu from se41.

Thanks,

Shreya

0 Kudos

And yes, for saving a particular layout,

try this

FORM Z_DEFAULT_VARIANT .

I_VARIANT-REPORT = V_PROGNAME.

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

I_SAVE = 'A'

CHANGING

CS_VARIANT = I_VARIANT

EXCEPTIONS

WRONG_INPUT = 1

NOT_FOUND = 2

PROGRAM_ERROR = 3

OTHERS = 4.

IF SY-SUBRC = 0.

P_VARI = I_VARIANT-VARIANT.

ENDIF.