2014 Nov 20 1:24 PM
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.
2014 Nov 20 1:40 PM
2014 Nov 21 5:00 AM
Hi,
That's entire printing logic which I have pasted..
Regards,
Paavan
2014 Nov 21 5:52 AM
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
2014 Nov 25 5:17 AM
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