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

Changing Custom Control / ALV size in program

Former Member
0 Likes
3,395

Hello,

Everytime I need a screen with more than 1 ALV, I do as follows:

1 - I define one custom container for each ALV;

2 - In my program, I create one object of class CL_GUI_CUSTOM_CONTAINER for each ALV;

3 - For each ALV, I create one object of class CL_GUI_ALV_GRID. For each of these objects, I assign one of the parents created in 2;

So far so good - with this technique I can easily have multiple ALV screens, make ALV's dependent on each other, etc.

My problem is as follows:

- I need to change the screen appearence in my program (typically size and position of the ALV's);

- I tried to use the methods of class CL_GUI_CUSTOM_CONTAINER that seem to be appropriate (SET_HEIGHT, SET_LEFT, etc), but nothing seems to happen:

Example:

CALL METHOD gr_ccontainer1->set_height EXPORTING height = 200.

I would appreciate any help,

Regards,

Joao

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
2,109

You can use the Splitter Container of type CL_GUI_SPLITTER_CONTAINER to put your ALVs on the screen. This Splitter container has some methods which can be used to set the height / width of the container.

Regards,

Naimesh Patel

6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,109

Doesn't work for me too. I guess they don't work. I never saw sap using that too. The sap library only talks about get_height and get_width.

Anyway, even if you could change it, as the containers have fixed positions in the dynpro, you could only change the position of the inner controls there would be some blanks all around, the effect would not be much better than what it is currently.

A better solution is to use splitter containers, you can define the size of the panels (set_column_width, set_row_height).

Read only

uwe_schieferstein
Active Contributor
0 Likes
2,109

Hello Joao

If the ALV grids are the only elements on your screen (i.e. you do not need any additional input / ouput fields) then I never use a custom container. Instead, I always use a docking container which fills the entire screen. The docking container becomes the parent for a splitter container whose cells (= CL_GUI_CONTAINER) are eventually filled with ALV grid instances.

Regards

Uwe

Read only

naimesh_patel
Active Contributor
0 Likes
2,110

You can use the Splitter Container of type CL_GUI_SPLITTER_CONTAINER to put your ALVs on the screen. This Splitter container has some methods which can be used to set the height / width of the container.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
2,109

Thank you all for your quick replies, they've all been very helpful. Unfortunately I can only award points to one person.

Regards,

Joao

Read only

0 Likes
2,109

Hi Joao, could you give a feedback (how you solved, advices for other people who will have the same question...)

By the way, why can't you give points to other people, this is allowed !

Read only

0 Likes
2,109

Hi Sandra,

Thank you for the tip about the poins, I'll try to correct that, if it is still possible. About the question, I confess that I didn't test the solution with the splitter. Nevertheless, I decided to close the question - I believe that following the tips I'll get somewhere:-)

In fact, trying to resize the ALVs was just a first step towards the final result that I want: to resize the objects in a (ABAP) screen according to the screen resolution. Because time is short I decided not to continue for now, and I used my normal approach:

- Defining a screen for the worst resolution in the project;

- Designing custom containers (that now I know cannot change in size in runtime);

- Attacching my ALVs to these custom containers;

Regards,

Joã