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: 

Oops ALV.

Former Member
0 Kudos

Hi Gurus,

I need to diaply two alv grid on the ouput screen,

For that i have searched the forum and come to know thats how i can develop the same In module pool screen

But i am not able to find that how i can do the same in the a SIMPLE report. (which is not a module pool report.)

Kindly explain me the prrocess of the same.

many thanks

Anuj.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

1) You need to define a screen in the report program.

2) call screen <screen no>

3) In PBO of the screen you need to add code to call a container and display an ALV output in the container.

4) In PAI of the screen, you can add the code to BACK./EXIT based on OK_CODE

Note: Create a custom screen in SE51 and define a container(In your case two containers)

Create/instantiate a container object from your report program using the below class-method

* Declare reference variables to the ALV grid and the container
   DATA:
     go_grid             TYPE REF TO cl_gui_alv_grid,
     go_custom_container TYPE REF TO cl_gui_custom_container.

* Create objects
     IF go_custom_container IS INITIAL.
       CREATE OBJECT go_custom_container
         EXPORTING container_name = 'ALV_CONTAINER'.

       CREATE OBJECT go_grid
         EXPORTING
           i_parent = go_custom_container.

* Load data into the grid and display them
     CALL METHOD go_grid->set_table_for_first_display
       EXPORTING i_structure_name = '<Tablename>'
       CHANGING  it_outtab        = <Output internal table>.

Hope this helps

Regards

Shiva

4 REPLIES 4

Former Member
0 Kudos

Look at the examples in SAP: search with ALV or GRID

Former Member
0 Kudos

Read the Weblog by Uwe [Against All Odds - Programming of Communicating (S)ALV Grid Controls|/people/uwe.schieferstein/blog/2010/10/12/against-all-odds--programming-of-communicating-salv-grid-controls].

0 Kudos

Hi

simple report not for Module pool.

kindly help me how to go for two alv in SIMPLE REPORT.

many thanks,

anuj.

Former Member
0 Kudos

Hi,

1) You need to define a screen in the report program.

2) call screen <screen no>

3) In PBO of the screen you need to add code to call a container and display an ALV output in the container.

4) In PAI of the screen, you can add the code to BACK./EXIT based on OK_CODE

Note: Create a custom screen in SE51 and define a container(In your case two containers)

Create/instantiate a container object from your report program using the below class-method

* Declare reference variables to the ALV grid and the container
   DATA:
     go_grid             TYPE REF TO cl_gui_alv_grid,
     go_custom_container TYPE REF TO cl_gui_custom_container.

* Create objects
     IF go_custom_container IS INITIAL.
       CREATE OBJECT go_custom_container
         EXPORTING container_name = 'ALV_CONTAINER'.

       CREATE OBJECT go_grid
         EXPORTING
           i_parent = go_custom_container.

* Load data into the grid and display them
     CALL METHOD go_grid->set_table_for_first_display
       EXPORTING i_structure_name = '<Tablename>'
       CHANGING  it_outtab        = <Output internal table>.

Hope this helps

Regards

Shiva