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: 

ALV Grid display on SAP Module Pool

Former Member
0 Kudos
1,019

Hi All,

I need to create a module pool screen, which would have 2 different ALV's. The format of screen would be something like:

-


Some I/Ofields

-


ALV 1

-


ALV 2

-


How can I restrict the display of ALV data to the areas predefined on the screen?

What type of component is required to be defined on module pool for restricting ALV to that particular area?

or , while displaying ALV (i am using ALV FM's) is there any addition that is required?

Regards-

Harmeet.

Edited by: Harmeet Singh on Jun 5, 2009 4:56 PM

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos
122

Hi,

There are number of examples in net, SCN and wherever you look for.

Basically what you need is:

- a screen

- your screen fields placed on top of this screen

- custom control on this screen underneath your screen fields

- in PBO module of that screen you need to create splitter container

- by means of this splitter container you get two containers

- in both you place your ALVs

For details how to implement this please refer [Displaying two ALVs on the screen|http://sample-code-abap.blogspot.com/2008/06/displaying-two-alv-grid-on-screen.html].

Note!

In above example you have such coding:


   CREATE OBJECT ob_custom
      EXPORTING
        container_name = 'CONTAINER' .   "CONTAINER is the name of CUSTOM CONTROL placed on screen (as exlapained above)

Alternatively you can use two custom controls for each ALV separately. This will ensure that they have fixed position on screen (size too). Using splitter container as in the example it is, however, more flexible as you hold two alvs in one container and have nice splitter, which you can drag and rezise ALVs vertically. Custom container remains unchanged and is fixed on screen. It also defines boundaries of your ALVs (we can call it an area)

I don't think you can achieve this using standard FMs, so you must use this OO aproach.

Regards

Marcin

3 REPLIES 3

Former Member
0 Kudos
122

You can create 2 custom controls on your screen i.e Container1 and Container2 to restrict the ALV areas

and then create 2 grids objects i.e grid1 with parent as container1 and grid2 with parent as container2 for displaying the corresponding output values..

Call FM grid1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

Internal table1

and 2nd one as

CALL FM grid2->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

Internal table2.

Is that you are looking for?

0 Kudos
122

yes, I need more information on the usage of containers and grid.

MarcinPciak
Active Contributor
0 Kudos
123

Hi,

There are number of examples in net, SCN and wherever you look for.

Basically what you need is:

- a screen

- your screen fields placed on top of this screen

- custom control on this screen underneath your screen fields

- in PBO module of that screen you need to create splitter container

- by means of this splitter container you get two containers

- in both you place your ALVs

For details how to implement this please refer [Displaying two ALVs on the screen|http://sample-code-abap.blogspot.com/2008/06/displaying-two-alv-grid-on-screen.html].

Note!

In above example you have such coding:


   CREATE OBJECT ob_custom
      EXPORTING
        container_name = 'CONTAINER' .   "CONTAINER is the name of CUSTOM CONTROL placed on screen (as exlapained above)

Alternatively you can use two custom controls for each ALV separately. This will ensure that they have fixed position on screen (size too). Using splitter container as in the example it is, however, more flexible as you hold two alvs in one container and have nice splitter, which you can drag and rezise ALVs vertically. Custom container remains unchanged and is fixed on screen. It also defines boundaries of your ALVs (we can call it an area)

I don't think you can achieve this using standard FMs, so you must use this OO aproach.

Regards

Marcin