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

Modify ALV custom container size at runtime

Former Member
0 Likes
1,248

Hi all,

Imagine a specific screen with three blocks of info, the last one being a custom container that displays an ALV. Now I have a requirement where I should be able to hide the second block by using a checkbox and expand the ALV to display more lines.

It seems I can't do that with the "resize" option in the attributes fields in Screen Painter as it has to do with screen resolution. I tried to use methods of CL_GUI_CUSTOM_CONTAINER (like SET_HEIGHT), but again without success.

Does anyone has an idea ?

Thanks

Hi all,

Imagine a specific screen with three blocks of info, the last one being a custom container that displays an ALV. Now I have a requirement where I should be able to hide the second block by using a checkbox and expand the ALV to display more lines.

It seems I can't do that with the "resize" option in the attributes fields in Screen Painter as it has to do with screen resolution. I tried to use methods of CL_GUI_CUSTOM_CONTAINER (like SET_HEIGHT), but again without success.

Does anyone has an idea ?

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
1,046

Within your one custom container, you can create multiple splitters to hold your different ALVs.

Rob

Read only

Former Member
0 Likes
1,046

Hi Rob,

Thanks for answering, but the problem is not to create several splitters in the same container (I have only one ALV), but to enlarge the current container. I have other static blocks on the screen (texts, checkboxes...), some of which I should hide, some of which I should still display, and these can't be included in the container.

At the moment I think my only option is to create another screen and call the right one depending on the layout I want to use...

S

Read only

0 Likes
1,046

I am thinking of two options here:

-


1) The one you suggested (two screens) but with small change that will ease your life.

Create two main screens say 100 and 200. On 100 create two subscreen areas and a container (for ALV). On 200 create one subscreen area and the enlarged container. Create two subscreens i.e 101, 102. When screen 100 is called load 101, 102 and ALV. When you request to hide second block (102), switch to screen 200. Load here 101 and same ALV.

Note!

You don't need recreate ALV + custom container each time. you can switch b/w containers by relinking ( LINK method).

For this refer [this thread|] or Uwe's blog [Against All Odds - Programming of Communicating (S)ALV Grid Controls|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21504] [original link is broken] [original link is broken] [original link is broken];

This way you reuse same controls in different screens. Please also note that hidding technique for subscreens is much easier than for each control individually.

-


2) This one will require docking container.

Create a screen with two subscreen areas where you will load your subscreens and docking container (docked at right). During "hide" unload subscreen 102, and extend docking container with embeded ALV to the left side.

The downside of this option is that you are able to literally cover your classic controls with docking container (container on top of them) if user drag and drop it to much to the left. Don't remeber now if you can't fix that extension, so he could not move it. This "bug" however doesn't apply when you dock your container on the left. Then you are able to change the extension and all the other controlls will follow it.

Regards

Marcin

Read only

0 Likes
1,046

Hi Marcin,

Thanks a lot for the tips. I'll try that as soon as I have a go for the dev.

Cheers

S