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: 

"Select Layout" Option for ALV Report

Former Member
0 Kudos

Hi All,

I have developed a ALV report.

In the output, on clicking the "Select Layout" button, a small window opens with some layout option/variant say "ZSLEB".

When i choose this layout, the output changes and takes the form of the chosen layout i.e. ZSLEB.

Now, on refresh, the alv output doesnt display this new layout, but goes back to the default layout/variant.

Actually, i am not passing anythin to the IS_Variant parameter in the ALV_GRID_Display FM.

I suppose i need to somehow manage to fetch the "ZSLEB" layout value during refresh and pass it to Is_Variant. Please help me in doing this.

Thanks & Regards,

Tejas Savla

2 REPLIES 2

Former Member
0 Kudos

Hi

On refresh ,

Call ths below code.

s_variant-report = sy-repid.( Your report name ).

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = s_variant

  • I_TABNAME_HEADER =

  • I_TABNAME_ITEM =

  • IT_DEFAULT_FIELDCAT =

  • I_SAVE = ' '

  • I_DISPLAY_VIA_GRID = ' '

IMPORTING

  • E_EXIT =

es_variant = s_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3

Can pass this to IS_VARIANT while calling for REUSE_ALV_ DISPLAY

Please reward if useful.

Former Member
0 Kudos

Hi

u can use this FM REUSE_ALV_VARIANT_F4

Regards

Gregory