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

variant-layout problem

Former Member
0 Likes
1,251

I ve an option on 1st screen to choose the variant for layout.

my 1st display with any selected layout is executing fine and displaying the list.

from this screen, if i come back and change the variant and execute... then its not displaying accordingly.

i am doing this by OO ABAP.

Any help plz

9 REPLIES 9
Read only

Former Member
0 Likes
1,159

Hello,

Use the function modules

<b>REUSE_ALV_VARIANT_EXISTENCE' and

REUSE_ALV_VARIANT_F4</b>

Reward if helpful

Regards,

LIJO

Read only

Former Member
0 Likes
1,159

i already used. my problem is not with existence.

i ve those variants.

but if i come back n choose a diff variant, my list is not displayed with the new variant..

Read only

Former Member
0 Likes
1,159

Not even a clue...

can some one give some hint atleast pl

Read only

Former Member
0 Likes
1,159

guyz

pl shed some light on this.

Regds

Kiran

Read only

Former Member
0 Likes
1,159

still no replies.

I need some help on this plz

Kiran

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,159

may be ur just deleting and typing the new variant....after coming back select the variant using f4 help....

Read only

0 Likes
1,159

I have tried that way also.

Any more clues plz

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,159

check whether any default variant is set

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,159

check this, i guess this might help u.......

*Variables for variant

data:

wk_variant like disvariant,

wx_variant like disvariant,

wk_variant_save(1) type c,

wk_repid like sy-repid,

wk_exit(1) type c.

selection-screen begin of block b3 with frame title text-027.

parameters:p_vari like disvariant-variant. "Variant

selection-screen end of block b3.

initialization.

perform f_init_variant.

perform f_variant_default using p_vari.

*This event is used for Layout Variant

at selection-screen on value-request for p_vari.

perform f_variant_f4 using p_vari.

form f_init_variant.

clear: wk_variant.

wk_repid = sy-repid.

wk_variant-report = wk_repid.

wk_variant-username = sy-uname.

wk_variant_save = 'A'. "All types

endform. "F_INIT_VARIANT

form f_variant_default using p_variant type disvariant-variant.

wx_variant = wk_variant.

if ( not p_variant is initial ).

wx_variant-variant = p_variant.

endif.

call function 'LVC_VARIANT_DEFAULT_GET'

exporting

i_save = wk_variant_save

changing

cs_variant = wx_variant

exceptions

wrong_input = 1

not_found = 2

program_error = 3

others = 4.

case sy-subrc.

when 0.

p_variant = wx_variant-variant.

when 2.

clear: p_variant.

endcase.

endform. "f_variant_default

form f_variant_f4 using p_variant type disvariant-variant.

call function 'LVC_VARIANT_F4'

exporting

is_variant = wk_variant

i_save = wk_variant_save

importing

e_exit = wk_exit

es_variant = wx_variant

exceptions

not_found = 1

program_error = 2

others = 3.

if sy-subrc <> 0.

message i122(zpp).

endif.

if wk_exit is initial.

wk_variant-variant = wx_variant-variant.

p_variant = wx_variant-variant.

endif.

endform. "F_VARIANT_F4

*************************

pass wk_variant to alv FM

*************************

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = sy-repid

i_background_id = 'ALV_BACKGROUND'

it_fieldcat = fieldcat[]

is_layout = wk_layout

it_events = v_events[]

i_default = 'X'

i_save = 'A'

is_variant = wk_variant

tables

t_outtab = it_final_list.