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

alv save layout problem

Former Member
0 Likes
722

Hey Guru's,

I am using an OO ALV and i want to get a save button as we get in BCALV_GRID_09 program

my code is as follows please suggest.

*---Set Table for Fisrt Display

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

it_toolbar_excluding = LT_EXCLUDE -


> excluding some toolbar functions

is_layout = GS_LAYOUT -


> Program name passing

i_save = C_SAVE -


> passing A here

i_default = 'X'

CHANGING

it_fieldcatalog = IT_FCAT

it_outtab = TB_OUTTAB[].

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
635

Hi Suresh,

Use the following code to achive that.

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

it_toolbar_excluding = LT_EXCLUDE ---your code

is_layout = GS_LAYOUT

is_variant = GS_VARIANT -added a point here--


>Pass the Program name as mentioned below

i_save = C_SAVE

i_default = 'X' ---this is not necessary any how you can put this no problem

CHANGING

it_fieldcatalog = IT_FCAT

it_outtab = TB_OUTTAB[].

Data : gs_variant type disvariant.

gs_variant-report = sy-repid (make sure you are submitting the correct program i mean method set table for first displat is called that program names. not current program like submitting something)

i_default = 'X' is for getting the default layout...since you are excluding some functions no need to do this.

Hope this works,

Regards,

bhargav

4 REPLIES 4
Read only

Former Member
0 Likes
635

Hi Suresh,

You code is right but you need to pass IS_VARIANT parameter to the method set_table_for_first_display.

pass is_variant-report = sy-repid.

Thanks,

Ravi Aswani

Read only

Former Member
0 Likes
635

Hi,

Yes you should pass the IS_VARIANT parameter to the method set_table_for_first_display.

gs_layout-report = sy-repid."parameter should have the program name.

IS_VARIANT = gs_layout " pass to set_table_for_first_display.

regards,

Dhina..

Edited by: Dhina DMD on Jun 23, 2011 11:02 AM

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
636

Hi Suresh,

Use the following code to achive that.

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

it_toolbar_excluding = LT_EXCLUDE ---your code

is_layout = GS_LAYOUT

is_variant = GS_VARIANT -added a point here--


>Pass the Program name as mentioned below

i_save = C_SAVE

i_default = 'X' ---this is not necessary any how you can put this no problem

CHANGING

it_fieldcatalog = IT_FCAT

it_outtab = TB_OUTTAB[].

Data : gs_variant type disvariant.

gs_variant-report = sy-repid (make sure you are submitting the correct program i mean method set table for first displat is called that program names. not current program like submitting something)

i_default = 'X' is for getting the default layout...since you are excluding some functions no need to do this.

Hope this works,

Regards,

bhargav

Read only

0 Likes
635

Thanks all,

problem solved