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

F4 for Layout ?

Former Member
0 Likes
921

hi,

How to create F4 for layout .I have used it in selection screen . Perform statement is being executed but nothing gets displayed .

FORM alv_variant_f4 CHANGING pa_vari.

data: rs_variant like disvariant.

data nof4 type c.

clear nof4.

loop at screen.

if screen-name = 'PA_VARI'.

if screen-input = 0.

nof4 = 'X'.

endif.

endif.

endloop.

rs_variant-report = g_repid.

rs_variant-username = sy-uname.

call function 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = rs_variant

i_save = 'A'

IMPORTING

es_variant = rs_variant

EXCEPTIONS

others = 1.

if sy-subrc = 0 and nof4 eq space.

pa_vari = rs_variant-variant.

endif.

6 REPLIES 6
Read only

Former Member
0 Likes
745

code it like below,

&----


*& Form GET_VARIANT

&----


  • F4 helps for the different layouts

----


form get_variant using p_variant type slis_vari.

data: l_disvariant type disvariant. " For layout variant

l_disvariant-report = sy-repid.

l_disvariant-variant = p_variant.

call function 'LVC_VARIANT_SAVE_LOAD'

exporting

i_save_load = 'F'

i_tabname = '1'

changing

cs_variant = l_disvariant

exceptions

others = 1.

if sy-subrc = 0.

p_variant = l_disvariant-variant.

endif.

endform. " GET_VARIANT

Hope it helps!!

Regards,

Pavan

Read only

0 Likes
745

hi,

Yes i could see something when i used the above code .But how to get values in it.

Thanks & Regards

Pradeep Akula .

Read only

0 Likes
745

Hi,

u save some layout variant in output screen...then the values will come in F4 help of this parameter..

Hope its clear!!

Regards,

Pavan

Read only

0 Likes
745

Hi,

In the output i have no such option also and the client needs this as well as select layout option .

For fbl1n these options of save layout and select layout exist .Kindly suggest !

Read only

0 Likes
745

Hi,

u pass I_SAVE as 'A' in FM reuse_alv_grid_display or reuse_alv_list_display.

then u ill see a button to save the layout in the output.

Hope it helps!!

Regards,

Pavan

Read only

0 Likes
745

the code used is as follows . where to pass the parameter that u have told

MODULE create_alv OUTPUT.

set titlebar 'ZPOTITLE'.

set pf-status 'ZPO1'.

IF r_container IS INITIAL.

CREATE OBJECT r_container

EXPORTING container_name ='CONTAINER_1'.

CREATE OBJECT r_grid

EXPORTING i_parent = r_container.

CALL METHOD r_grid->set_table_for_first_display

EXPORTING

i_structure_name = 'ZPO_INV_ALV'

CHANGING

it_outtab = t_alv_data.

ELSE.

CALL METHOD r_grid->refresh_table_display

EXPORTING

i_soft_refresh = 'X'.

ENDIF.

ENDMODULE. " create_alv OUTPUT