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

Layout variant parameter

Former Member
0 Likes
1,109

Hi All,

I need to know whether we can pass a layout as a paramter to a program in which the layout is saved in the output not in the

selection criteria.I want to pass this paramter through SUBMIT statement.

Thanks and Regards

Basu

7 REPLIES 7
Read only

lijisusan_mathews
Active Contributor
0 Likes
1,074

You can pass layout as a parameter.

Use the IS_VARIANT parameter in reuse to pass the layout structure details.

Suzie

Read only

Former Member
0 Likes
1,074

Hi

Use this following code.

TYPE-POOLS : slis.

PARAMETERS : p_layout TYPE slis_vari,

-


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_layout.

lx_variant-report = sy-cprog.

lv_save = 'A'.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = lx_variant

  • I_TABNAME_HEADER =

  • I_TABNAME_ITEM =

  • IT_DEFAULT_FIELDCAT =

i_save = lv_save

  • I_DISPLAY_VIA_GRID = ' '

IMPORTING

  • E_EXIT =

es_variant = lx_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

ENDIF.

p_layout = lx_variant-variant.

lv_layout1 = lx_variant-variant.

-


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

is_layout = v_layout1

it_fieldcat = lt_field_catalog

i_save = lv_save

is_variant = lx_variant

it_events = lt_event

TABLES

t_outtab = t_cinfo

EXCEPTIONS

program_error = 1

OTHERS = 2 .

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

ENDIF.

This will surely help you.

Enjoy!!

With regards,

Aahbha.

Read only

Former Member
0 Likes
1,074

Hi,

Pass the IS_VARIANT parameter just before calling the grid.

Thanks,

Guru.

Read only

Former Member
0 Likes
1,074

Sorry

Read only

Former Member
0 Likes
1,074

Sorry

Read only

0 Likes
1,074

df

Read only

0 Likes
1,074

OK