<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help in this code snippet for split container in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531691#M1656743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try creating g_slav_table object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT g_salv_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    r_container = g_top_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then methods SET_DATA and DIPLAY from this object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2012 15:31:25 GMT</pubDate>
    <dc:creator>former_member591546</dc:creator>
    <dc:date>2012-01-31T15:31:25Z</dc:date>
    <item>
      <title>Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531690#M1656742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to display two tables in report output.&lt;/P&gt;&lt;P&gt;using cl_salv_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=============================================================================================&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;START-OF-SELECTION.
DATA: lo_report TYPE REF TO lcl_test_class.
* create report object
CREATE OBJECT lo_report.
* call methods
lo_report-&amp;gt;get_data( ).
lo_report-&amp;gt;process_data( ).
lo_report-&amp;gt;generate_output( ).

METHOD generate_output.

data: g_custom_container TYPE REF TO cl_gui_custom_container, "custom container
g_splitter_container TYPE REF TO cl_gui_splitter_container, "splitter container
g_top_container TYPE REF TO cl_gui_container, "top container
g_bottom_container TYPE REF TO cl_gui_container, "bottom one
g_display TYPE REF TO cl_salv_display_settings, " set display pattern
g_slav_table TYPE REF TO cl_salv_table,
g_table TYPE REF TO cl_salv_table.

"create custom container placed in CUSTOM AREA defined on screen
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'CUSTOM_AREA'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

"now split the container into two independent containers
CREATE OBJECT g_splitter_container
EXPORTING
parent = g_custom_container
rows = 2
columns = 1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

"get top container
CALL METHOD g_splitter_container-&amp;gt;get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = g_top_container.

TRY.
CALL METHOD cl_salv_table=&amp;gt;factory
EXPORTING
r_container = g_top_container
IMPORTING
r_salv_table = lr_table
CHANGING
t_table = gt_itab_header. "gt_itab_header is populated with required output columns in process_data( ) method
CATCH cx_salv_msg.
ENDTRY.

g_display = g_table-&amp;gt;get_display_settings( ).
g_display-&amp;gt;set_striped_pattern( cl_salv_display_settings=&amp;gt;true ).

g_display-&amp;gt;set_striped_pattern( cl_salv_display_settings=&amp;gt;true ).

*... Display table
g_table-&amp;gt;display( ).

ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;=============================================================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Added code tags&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I Execute the code, it still stay on selection screen does not display output table. If I comment out the lines&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;r_container = g_top_container&lt;/P&gt;&lt;P&gt;from the Method "cl_salv_table=&amp;gt;factory" the output is displayed with table in required format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone help me out identifying what am I doing wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jan 31, 2012 9:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 15:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531690#M1656742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-31T15:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531691#M1656743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try creating g_slav_table object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT g_salv_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    r_container = g_top_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then methods SET_DATA and DIPLAY from this object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 15:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531691#M1656743</guid>
      <dc:creator>former_member591546</dc:creator>
      <dc:date>2012-01-31T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531692#M1656744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;when I Execute the code, it still stay on selection screen does not display output table.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You need to call the screen in which you have defined the custom container 'CUSTOM_AREA'. And you need to call the method &lt;EM&gt;generate_output( )&lt;/EM&gt; in the PBO of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;If I comment out the lines&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;r_container = g_top_container&lt;/P&gt;&lt;P&gt;from the Method "cl_salv_table=&amp;gt;factory" the output is displayed with table in required format.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you're removing the &lt;EM&gt;R_CONTAINER&lt;/EM&gt; parameter, SALV framework displays the data in full-screen grid. Actually it uses REUSE_ALV_GRID_DISPLAY to display the data. Hence you are getting the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be honest i'll be surprised if you are getting the splitter container, can you confirm if you are getting it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 16:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531692#M1656744</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2012-01-31T16:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531693#M1656745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does not allow to create instance for CL_SALV_TABLE with CREATE OBJECT. I got the below syntax error when I tried creating instance as mentioned by you. I have to use CL_SALV_TABLE=&amp;gt;FACTORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"You cannot create an instance of the class "CL_SALV_TABLE" outside the".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 16:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531693#M1656745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-31T16:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531694#M1656746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is displayed in full screen only I am not seeing any split container. Is there any other way I can achieve split container without PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 16:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531694#M1656746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-31T16:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in this code snippet for split container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531695#M1656747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abhiram, insert follow code after "get top container":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"get bottom container
CALL METHOD g_splitter_container-&amp;gt;get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = g_bottom_container.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like Suhas said, you need to create a screen with only object custom container named 'CUSTOM_AREA'. In START-OF-SELECTION from main program, do CALL SCREEN to mentioned screen. In PBO from this screen insert your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 16:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-this-code-snippet-for-split-container/m-p/8531695#M1656747</guid>
      <dc:creator>former_member591546</dc:creator>
      <dc:date>2012-01-31T16:51:59Z</dc:date>
    </item>
  </channel>
</rss>

