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: 

Custom Controls and ALV

Former Member
0 Kudos
285

Hi,

I have created on one Dynpro 3 Custom Controls, which are

responsible for Three ALV Grid Reports.

I have named CC1 for ALV1 CC2 for ALV2 and CC3 for ALV3.

I can put the Data for each ALVs.

So far so good, but if I save the Layout global for one ALV and start the Program again, disappears me some Elements on other ALVs like Columns , Buttons etc...

I have used Method set_for_first_display.

Thanks for your Replies.

Best Regards

Beserithan Malabakan

1 ACCEPTED SOLUTION

Former Member
0 Kudos
130

Wha tis happening is the VARIANT parameter values that you are passing are the same for all the three grids. So, once you alter the layout of one its changing all the grids. What you need to do is to specify a unique name in the field HANDLE of the parameter VARIANT for each grid, say the grid name.

Then this problem will not occur and you will have variants specific to the grid.

It has nothing to do with the global / user defined layouts.

Regards,

Ravi

Note: Please mark the helpful answers

7 REPLIES 7

laxmanakumar_appana
Active Contributor
0 Kudos
130

Hi,

Global layout settings will be applicable for all the ALV's on the screen, try to create user defind layout settings for each ALV.

Laxman

Manohar2u
Active Contributor
0 Kudos
130

You should use control specific methods to assign layouts to your 3 controls.

refer to this link

http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5ecd2fe11d2b467006094192fe3/content.htm

You should use <b>get_variant</b> I guess.

Regds

Manohar

Former Member
0 Kudos
130

Hi,

Try this method after u had called set_for_first_display

REFRESH_TABLE_DISPLAY...

Hope this helps!!!

Seema.

Former Member
0 Kudos
131

Wha tis happening is the VARIANT parameter values that you are passing are the same for all the three grids. So, once you alter the layout of one its changing all the grids. What you need to do is to specify a unique name in the field HANDLE of the parameter VARIANT for each grid, say the grid name.

Then this problem will not occur and you will have variants specific to the grid.

It has nothing to do with the global / user defined layouts.

Regards,

Ravi

Note: Please mark the helpful answers

0 Kudos
130

Hi Ravi

can you please give code sample?

Thanks!

Bye

0 Kudos
130

In your SET_TABLE_FOR_FIRST_DISPLAY method , there is a parameter I_VARIANT. To that pass values like for each of the grid.

WA_VARIANT-REPORT = SY-REPID.

WA_VARIANT-USERNAME = SY-UNAME.

WA_VARIANT-HANDLE = Grid Name.

So, have three different WA_VARIANT (TYPE DISVARIANT) and pass them seprately to each of the calls of set table method of each grid. That should fix the issue.

Regards,

Ravi

Note : Please close the thread if the issue is resolved

0 Kudos
130
Data: variant1 type disvariant.
Data: variant2 type disvariant.
Data: variant3 type disvariant.

variant1-REPORT = sy-repid.
variant1-HANDLE = 'ALV1'.
variant1-USERNAME = sy-uname.

variant2-REPORT = sy-repid.
variant2-HANDLE = 'ALV2'.
variant2-USERNAME = sy-uname.

variant3-REPORT = sy-repid.
variant3-HANDLE = 'ALV3'.
variant3-USERNAME = sy-uname.

Regards,

Rich Heilman