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

Background Execution Problem with 2 ALV Grids in one screen using Docking Container

Former Member
0 Likes
1,035

Hi,

I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER.

I am getting the foreground output as expected with 2 ALV Grids. While executing in background,

I am getting only output of first ALV grid. Second ALV is not getting displayed in BACKGROUND mode.

*  CREATE A CUSTOM CONTAINER CONTROL FOR OUR ALV CONTROL

   IF g_custom_container1 IS INITIAL.

     " To ensure that object is created only once

* Check whether the program is run in batch or foreground

     IF cl_gui_alv_grid=>offline( ) IS INITIAL.

* Run in foreground

       CREATE OBJECT g_custom_container1

         EXPORTING

           container_name = 'G_CONTAINER1'.

       CREATE OBJECT g_grid1

         EXPORTING

           i_parent = g_custom_container1.

     ELSE.

* Run in background

       CREATE OBJECT g_grid1

         EXPORTING

           i_parent = g_dock1.

     ENDIF.

*    PERFORM f_fieldcat1.

     CALL METHOD g_grid1->set_table_for_first_display

       EXPORTING

         is_layout                     = wa_layout

       CHANGING

         it_outtab                     = it_final3

         it_fieldcatalog               = it_fcat

       EXCEPTIONS

         invalid_parameter_combination = 1

         program_error                 = 2

         too_many_lines                = 3

         OTHERS                        = 4.

     IF sy-subrc <> 0.

*       MESSAGE S000 WITH 'TABLE CANNOT BE DISPLAYED'.

     ENDIF.

   ENDIF.



IF g_custom_container2 IS INITIAL.

     " To ensure that object is created only once

* Check whether the program is run in batch or foreground

     IF cl_gui_alv_grid=>offline( ) IS INITIAL.

* Run in foreground

       CREATE OBJECT g_custom_container2

         EXPORTING

           container_name = 'G_CONTAINER2'.

       CREATE OBJECT g_grid2

         EXPORTING

           i_parent = g_custom_container2.

     ELSE.

* Run in background

       CREATE OBJECT g_grid2

         EXPORTING

           i_parent = g_dock2.

     ENDIF.

*    PERFORM f_fieldcat2.

     CALL METHOD g_grid2->set_table_for_first_display

       EXPORTING

         is_layout                     = wa_layout2

       CHANGING

         it_outtab                     = it_final17

         it_fieldcatalog               = it_fcat7

       EXCEPTIONS

         invalid_parameter_combination = 1

         program_error                 = 2

         too_many_lines                = 3

         OTHERS                        = 4.

     IF sy-subrc <> 0.

*     MESSAGE S000 WITH 'TABLE CANNOT BE DISPLAYED'.

     ENDIF.

   ENDIF.

4 REPLIES 4
Read only

kinnarivakta
Explorer
0 Likes
886

Hi Paaavn

Can you please paste the whole code?

Regards

K

Read only

0 Likes
886

Hi,

That's entire printing logic which I have pasted..

Regards,

Paavan

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
886

Hi,

How about using splitter container inside docking container?

Check this below link in which I am explaining TOP of page using splitter container.

Check and modify it as required for background.

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=37564

Read only

0 Likes
886

It gives a dump with splitter..

I have read several documents on SCN and it says that it is a system behavior and can't display 2 containers in the background... It's quite wired behavior as only 1 ALV is being displayed