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: 

Problem of Double Scrolling in ALV

Former Member
0 Kudos
2,781

Dear,

I am creating alv by oops method. I have created Container in screen. My problem is on some laptop due to less screen size of laptop compare to desktop PC i am getting double scroll. Is there any way or object by which my container can automatically fit into user screen.

Thanx

Anuj Modi

1 ACCEPTED SOLUTION

former_member205763
Active Contributor
0 Kudos
700

Hi Anuj,

use the below code:

CREATE OBJECT alv_grid
      EXPORTING
        i_parent = CL_GUI_CONTAINER=>DEFAULT_SCREEN.     "<--- use this instead of your custom container

you'll get your alv in full screen regardless of resolution

6 REPLIES 6

former_member205763
Active Contributor
0 Kudos
701

Hi Anuj,

use the below code:

CREATE OBJECT alv_grid
      EXPORTING
        i_parent = CL_GUI_CONTAINER=>DEFAULT_SCREEN.     "<--- use this instead of your custom container

you'll get your alv in full screen regardless of resolution

0 Kudos
700

Dear,

I am using below code:

CREATE OBJECT c_ccont

EXPORTING

container_name = 'CONT'.

CREATE OBJECT o_dyndoc_id

EXPORTING

style = 'ALV_GRID'.

CREATE OBJECT o_splitter

EXPORTING

parent = c_ccont

rows = 2

columns = 1.

CALL METHOD o_splitter->get_container

EXPORTING

row = 1

column = 1

RECEIVING

container = o_parent_top.

CALL METHOD o_splitter->get_container

EXPORTING

row = 2

column = 1

RECEIVING

container = o_parent_grid.

  • Set height for g_parent_html

CALL METHOD o_splitter->set_row_height

EXPORTING

id = 1

height = 14.

  • create object for alv grid

CREATE OBJECT c_alvgd

EXPORTING

i_parent = o_parent_grid.

CREATE OBJECT g_handler.

SET HANDLER g_handler->top_of_page FOR c_alvgd.

SET HANDLER g_handler->print_top_of_page FOR c_alvgd.

My some Issue are

1. Now i need to call screen or not?

2. How will split my container for top of page?

Thanx.

0 Kudos
700

Hi Anuj,

Yes you need to create a screen, but dont use a container in that:

can you try changing this call :

CREATE OBJECT o_splitter
EXPORTING
parent = c_ccont
rows = 2
columns = 1.

to

CREATE OBJECT o_splitter
EXPORTING
parent = CL_GUI_CONTAINER=>SCREEN0
rows = 2
columns = 1.

Let me know how it goes.

0 Kudos
700

Dear,

I applied same code given by you but i am not getting top of page area and some fields which i have made on screen.

I want first top-of-page , Then Some fields , Then ALV without double scroll.

Thanx.

0 Kudos
700

Dear,

Still waiting for your help.

Thanx.

0 Kudos
700

Hi Anuj,

Check this code:

DATA: o_splitter type ref to cl_gui_easy_splitter_container,"Splitter
      o_grid TYPE REF TO cl_gui_alv_grid,
      o_parent_top TYPE REF TO cl_gui_container,
      o_docking type ref to cl_gui_docking_container.

  DATA: i_mara TYPE STANDARD TABLE OF mara,
        i_cat TYPE STANDARD TABLE OF lvc_s_fcat.

  SELECT * FROM mara INTO TABLE i_mara
    UP TO 500 ROWS
    .

 CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
       I_STRUCTURE_NAME             = 'MARA'
    CHANGING
       ct_fieldcat                  =  i_cat
    EXCEPTIONS
          INCONSISTENT_INTERFACE       = 1
          PROGRAM_ERROR                = 2
          OTHERS                       = 3.

 CREATE OBJECT o_docking
         EXPORTING
           parent = CL_GUI_EASY_SPLITTER_CONTAINER=>default_screen
           RATIO = 95
           SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_top.
CREATE OBJECT o_splitter
EXPORTING
parent = o_docking
orientation   = 0
sash_position     = 10 "Position of Splitter Bar (in Percent)
       with_border       = 1.

Data : o_top_container type ref to cl_gui_container,   "Top Container
         o_bottom_container type ref to cl_gui_container,"Bottom Container
         o_document type ref to cl_dd_document.          "Document
*   Placing the containers in the splitter
    o_top_container = o_splitter->top_left_container .
    o_bottom_container = o_splitter->bottom_right_container .

   CREATE OBJECT o_grid
      EXPORTING
        i_parent          =  o_bottom_container.
*   Creating the document
    CREATE OBJECT o_document
    EXPORTING
        style  = 'ALV_GRID'.

   CALL METHOD o_grid->set_table_for_first_display
     CHANGING
       it_outtab                     = i_mara
       it_fieldcatalog               = i_cat.