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: 

Container class method set_visible not working as I thougt it works

Former Member
0 Kudos

Hello,

I have 2 custom containers ( c1 & c2 ) on the screen each of them containing an ALV Grid, one for lines and the other for summary, at times I want to hide the container ( c1) for line items and only display the summary container (c2). I'm using the container method set_visible and passing '0' to the methods visible parameter.



    CALL METHOD g_custom_container_items->set_visible
      EXPORTING
        visible = cl_gui_control=>visible_false.

The container then disappears , which is the way it should work.

However, it is still occupying the space allocated for the custom container and therefore I see the summary ( c2 ) container after a gap of the lines allocated for the first container i.e. c1.

Is there a way to suppress this gap ? Is there anything extra that needs to be done besides hiding the container? Please advise.

I know I could achieve this with subscreens or having 2 different screen for different outputs, but I want to avoid that.

Example :

Without hiding c1. output is ok

-


c1

c2

-


After hiding c1.

-


-


> Here it keeps the gap

c2

-


Expected output should be.

-


c2

---

-


regards,

Advait

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Hi,

For your requirement it is better to use CL_GUI_EASY_SPLITTER_CONTAINER or CL_GUI_SPLITTER_CONTAINER. Inside you have two containers where you place your alv and summary in the respective one.

Now when you want to hide one of them, just use method SET_SASH_POSITION method to avoid this gap.

Regards

Marcin

3 REPLIES 3

MarcinPciak
Active Contributor
0 Kudos

Hi,

For your requirement it is better to use CL_GUI_EASY_SPLITTER_CONTAINER or CL_GUI_SPLITTER_CONTAINER. Inside you have two containers where you place your alv and summary in the respective one.

Now when you want to hide one of them, just use method SET_SASH_POSITION method to avoid this gap.

Regards

Marcin

0 Kudos

Hi Marcin,

It helped to some extent .i .e setting the sash_postion to 0 , hid the items list and I can only see the summary list as expected, however, I'm still able to pull down the item list visible again, and I don't want the users to do that. Any way to counter that ?

regards,

Advait

0 Kudos

I guess you are using easy_splitter right? This one doesn't provide the functionality of disabling splitter bar.

Nevetherless it works with the latter ( splitter_container ). Use the method [SET_ROW_SASH|http://help.sap.com/saphelp_nw04/helpdata/en/6d/1d28f3a3af11d295cf00a0c930660b/frameset.htm]

Regards

Marcin