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 Scroll - Grid Scroll

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

see my post in this thread

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Priyanka,

Check Txcode DWDM.

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

Cheers!!

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

Thanks Priyanka 🐵

That was exactly what I was looking for 🐵

0 Kudos

This helped me too, thank you so much!