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

save ALV Layout

Former Member
0 Likes
2,552

Hi

I need to save chaged layout in ALV GRID DISPLAY

I am using I_save = 'A' but iam unable to save the layout

wat could be reason

Give me suggestion

Regards

7 REPLIES 7
Read only

Former Member
0 Likes
963

Rasheed,

Actually it should work, do one small change declare a variable called s_save and initialize it with s_save = 'A' under Initialization event and then use s_save in your CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.

Regards,

Amey

Read only

Former Member
0 Likes
963

Hi Rasheed,

Have U tried using I_save = 'X' .

Read only

0 Likes
963

Hi,

You have to use the parameter "IS_VARIANT" to enable save :

DATA: ls_variant TYPE  disvariant.

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

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program = sy-repid
    i_save = 'A'
    it_fieldcat = lt_fieldcat
    is_variant = ls_variant
  TABLES
    t_outtab           = lt_tab
  EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.

Hope that will work.

Regards,

Yann

Read only

0 Likes
963

This solution worked for me. Thanks

Read only

0 Likes
963

thank you Yann

It works like charm.

The point is : i_save = 'A' 

i_save  = 'X'  is not correct.

Read only

Former Member
0 Likes
963

first declare two variables :

it_variant LIKE disvariant,

it_variant_return LIKE it_variant.

then declare parameter for variant on selection screen.

PARAMETER p_vari LIKE disvariant-variant.

and then use this function module which will provide u f4 help for parameter on selection screen.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.

it_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = it_variant

i_save = 'A'

IMPORTING

es_variant = it_variant_return

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

p_vari = it_variant_return-variant.

ENDIF.

and finally pass this variant to REUSE_ALV_GRID_DISPLAY

as.....

is_variant = it_variant_return

after all this when u run ur report then in the tool bar u will see save layout option which will be the last one them save it with that name. next time when ever u run that report then it will give u name of variant in the parameter a sf4 help.

plz reward point if helpful.

with this u will sure use variant.

Read only

Former Member
0 Likes
963

Populate the IS_Variant Parameter (field Report) with your report name,  leaving the variant field blank. The ALV grid needs this field partially filled before it will alow you to save a variant.  Then set your i_Save parameter to either 'A' or 'X'.

Regards,

Rich