<?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: set_table_for_first_display in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111818#M1509824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;as per your code you need to check if your alv is initial before creating object for your container&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;if cust_container is initial , then write your code&lt;/P&gt;&lt;P&gt;create object cust_container and &lt;/P&gt;&lt;P&gt;in else condition call method.&lt;/P&gt;&lt;P&gt;    CALL METHOD MY_ALV1-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will refresh your alv.&lt;/P&gt;&lt;P&gt;see below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF CUST_CONTAINER1 IS INITIAL .&lt;/P&gt;&lt;P&gt;CREATE OBJECT CUST_CONTAINER1&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      CONTAINER_NAME              = 'CONTAINER2'  .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT MY_ALV1&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_PARENT          = CUST_CONTAINER1 .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM FIELD_CATLOG1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD MY_ALV1-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_STRUCTURE_NAME              = 'STR1'&lt;/P&gt;&lt;P&gt;      I_SAVE                        = 'A'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      IT_OUTTAB                     = ITAB1[]&lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG                = I_FCAT1[]&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE .&lt;/P&gt;&lt;P&gt;    CALL METHOD MY_ALV1-&amp;gt;REFRESH_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF .&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0101  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;lalit gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jul 2010 05:45:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-07T05:45:18Z</dc:date>
    <item>
      <title>set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111815#M1509821</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 have used method "set_table_for_first_display" in ALV programming like below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   create object r_container
      exporting
        container_name              = 'CCONTAINER'
      exceptions
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        others                      = 6.


  create object r_alv_grid
    exporting
      i_parent          = r_container
    exceptions
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      others            = 5.

  call method r_alv_grid-&amp;gt;set_table_for_first_display
    exporting
      i_structure_name              = 'ZCCPC_REPORT'
    changing
      it_outtab                     = it_zcrm_r3
    exceptions
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      others                        = 4.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, everytime when i re-execute the program, the internal table "it_zcrm_r3" is not getting refreshed.  It still contains the old data.  I think after using "set_table_for_first_display" method, data is not getting refreshed and internal table still holds the data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please let me know how to refresh the contents after using method "set_table_for_first_display" ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 05:32:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111815#M1509821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T05:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111816#M1509822</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;When you come out of the screen, free the container, grid and also the internal table from where you are&lt;/P&gt;&lt;P&gt;displaying the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards and Best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 05:35:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111816#M1509822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T05:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111817#M1509823</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;Use the method REFRESH_TABLE_DISPLAY , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With parameter i_soft_refresh = 'X', which specifies that only data contents are passed again , which keeps current filter and sort criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also retain the scroll position by passing 'X' to  ROW or COL fields of a structure using the global type LVC_S_STBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are changing the row structure , you cannot use this method , in this case again you need to call the SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Kiruba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 05:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111817#M1509823</guid>
      <dc:creator>I066686</dc:creator>
      <dc:date>2010-07-07T05:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111818#M1509824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;as per your code you need to check if your alv is initial before creating object for your container&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;if cust_container is initial , then write your code&lt;/P&gt;&lt;P&gt;create object cust_container and &lt;/P&gt;&lt;P&gt;in else condition call method.&lt;/P&gt;&lt;P&gt;    CALL METHOD MY_ALV1-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will refresh your alv.&lt;/P&gt;&lt;P&gt;see below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF CUST_CONTAINER1 IS INITIAL .&lt;/P&gt;&lt;P&gt;CREATE OBJECT CUST_CONTAINER1&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      CONTAINER_NAME              = 'CONTAINER2'  .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT MY_ALV1&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_PARENT          = CUST_CONTAINER1 .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM FIELD_CATLOG1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD MY_ALV1-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_STRUCTURE_NAME              = 'STR1'&lt;/P&gt;&lt;P&gt;      I_SAVE                        = 'A'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      IT_OUTTAB                     = ITAB1[]&lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG                = I_FCAT1[]&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE .&lt;/P&gt;&lt;P&gt;    CALL METHOD MY_ALV1-&amp;gt;REFRESH_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF .&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0101  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;lalit gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 05:45:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111818#M1509824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T05:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111819#M1509825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Santosh B  ,&lt;/P&gt;&lt;P&gt;Probably you must have created the Grid and container objects in the PBO of your screen ....and they should be Ideally created only once through out the program just check  if container is initial then create the container and same for the grid object ie. if grid is initial then create the grid and use method set_table_for_first_display(the method should be used only for first time display&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Condition's apply ) and for rest use refresh for rest all... .....May be this is causing the old data to be displayed....&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope it helps...&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Anup Deshmukh on Jul 7, 2010 8:05 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Anup Deshmukh on Jul 7, 2010 8:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 06:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111819#M1509825</guid>
      <dc:creator>anup_deshmukh4</dc:creator>
      <dc:date>2010-07-07T06:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111820#M1509826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right , I have created the Grid and container objects in the PBO of  screen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 06:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111820#M1509826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T06:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111821#M1509827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please check my previous reply again ...i have edited&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 06:19:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111821#M1509827</guid>
      <dc:creator>anup_deshmukh4</dc:creator>
      <dc:date>2010-07-07T06:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: set_table_for_first_display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111822#M1509828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Santosh ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at this Thread my reply it contain xact code need to refresh grid with container&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="9114549"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 06:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-table-for-first-display/m-p/7111822#M1509828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T06:24:00Z</dc:date>
    </item>
  </channel>
</rss>

