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

Multiple OO ALV in same screen in module-pool.

Former Member
0 Likes
1,743

Hi Friends,

Requirement: First screen in Table control user inters values, according to that values i need to display multiple ALVs in second screen but one at a time. Like for material-1 first alv , when user clicks on "Next" button then second ALV for material-2 like wise.

Issue: For the first time i am getting proper data in ALV, when clicking on "Next" button or "Back" button again same data is displaying, but the internal table containing values to be displayed for next material holding correct data.

My Approach : in PAI of second screen Freeing the container and grid object as well with flush method.

                      FREE OBJ_CONTAINER.
                      FREE OBJ_GRID.
                      CALL METHOD CL_GUI_CFW=>FLUSH.


in PBO again creating Container and Grid object.


Also tried with grid_obj=>REFRESH_TABLE_DISPLAY in PAI. but no success.



Please suggest where i am going wrong and what is to be done.

5 REPLIES 5
Read only

pranay570708
Active Contributor
0 Likes
1,174

Try flushing the ALV in PBO of second ALV using the method  CALL METHOD cl_gui_cfw=>flush.

Or you can Free both ALV gird object and Container and recreate them all the time you call the 2nd ALV.

Read only

Former Member
0 Likes
1,174

Hello, Firstly while creating the custom container object, Check If obj_container is initial, then create the OBJECT obj_container and inside that if check, create the object grid and display the table. Do in the same way for the next screen display. I hope you have set the custom PF-STATUS in both of the screen for BACK, EXIT and CANCEL. Now, once you are navigated to the next screen, and by clicking the BACK BUTTON in next screen, IN PAI of the next screen do the followings, Check IF sy-ucomm = 'BACK' OR sy-ucomm EQ 'ÇANCEL' .. here free the container object, grid object by checking If OBJ_CONTAINER is BOUND / not initial, then free the object, same for the grid also. Leave screen. So once you are back to screen1, again you selected the next material, it will goto the next screen and will create the container object and grid object and will finally display the table. Once you click the BACK button , it will free the objects and will come to the previous screen. Regards, Syed

Read only

Former Member
0 Likes
1,174

Thanks guys for reply.

I must tell you one thing that all ALV reports is in single screen.

Read only

0 Likes
1,174

Hello,

You can try free the container by using method free OBJ_CONTAINER.->FREE() and also grid and then again call method set_table_for_first_display.

But I prefer to use REFRESH_TABLE_DISPLAY like that:

PBO:

     if OBJ_CONTAINER IS INITAL.

          CREATE OBJ_CONTAINER.

          CREATE OBJ_ GRID.

          CALL METHOD OBJ_ GRID->SET_TABLE_FOR_FIRST_DISPLAY

     ELSE.

          CALL METHOD OBJ_ GRID->REFRESH_TABLE_DISPLAY.

     ENDIF.

PAI:

      PERFORM CHANGE_DATA.

Regards,

Thanh.

Read only

0 Likes
1,174

Hi Omkar,

Use modal way calling the ALV