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

Container Scroll - Grid Scroll

Former Member
0 Likes
3,542

Hi. I have questions concerning container

I created a container in which there is grid inside. How to determine container to fit it's Height&Width to grid's Height&Width?

Here the problem is container is giving its own scorll bar and Grid is giving its own scroll bar. It becoming comples to handle two scroller in the screen.

Helpful answers are surely rewarded.

8 REPLIES 8
Read only

Former Member
0 Likes
1,431

see my post in this thread

Read only

Former Member
0 Likes
1,431

Hi Priyanka,

If ur Grid is going to occupy the full screen, then it is not

necessary to create a custom_control in the screen.

Instead u can use the screen as the parent container while

create the ALV grid object.

Hence no two scroll bars..

Check the sample code below...

DATA : go_grid TYPE REF TO cl_gui_alv_grid,
       gt_disp TYPE TABLE OF vbak.

CALL SCREEN 100.

*&---------------------------------------------------------------------*
*&      Module  PBO  OUTPUT                                            *
*&---------------------------------------------------------------------*
MODULE pbo OUTPUT.
  SET PF-STATUS 'BASIC'.
  SET TITLEBAR  '001'.

  SELECT * FROM vbak INTO TABLE gt_disp UP TO 30 ROWS.
  CREATE OBJECT go_grid
    EXPORTING
      i_parent = cl_gui_container=>default_screen.
  go_grid->set_table_for_first_display( EXPORTING i_structure_name = 'VBAK'
                                        CHANGING  it_outtab        = gt_disp ).

ENDMODULE.                 " PBO  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  PAI  INPUT                                             *
*&---------------------------------------------------------------------*
MODULE pai INPUT.
  SET SCREEN 0. LEAVE SCREEN.
ENDMODULE.                 " PAI  INPUT

Screen flow logic:

PROCESS BEFORE OUTPUT.
  MODULE PBO.

PROCESS AFTER INPUT.
  MODULE PAI AT EXIT-command.

Cheers,

Jose.

Read only

Former Member
0 Likes
1,431

hi,

alv grid fit in container. container won't give scroll bar.i think you used sub screen. there is more than a container in sap. check which one you used.

Read only

Former Member
0 Likes
1,431

Hi Priyanka,

Check Txcode DWDM.

you will get various examples on the containers which will solve your issue.

Cheers!!

Read only

Former Member
0 Likes
1,431

hi,

you can see 5 type of container in DWDM. you use first type container for alv report, it won't give scroll bar. others gives scroll bar.

Read only

Former Member
0 Likes
1,431

Issue is resolved.

The in Screen Painter the Container Resizing options are not set. If I make them 'Horzontal: 1' and 'Vertical: 1' the container size is automatically resizing to the screens resolutions.

Earlier they are not set. so its taking the entire container co-ordinates(no resizing) so it giving scrolls.

Thanks for all your replies.

Read only

0 Likes
1,431

Thanks Priyanka 🐵

That was exactly what I was looking for 🐵

Read only

0 Likes
1,431

This helped me too, thank you so much!