<?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: Issue!!!! Multiple OOPs ALV at same time in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558479#M21445</link>
    <description>&lt;P&gt;I can't give you a solution for the whole requirement, but it's clear that your code is creating all the ALV at once, and is displaying them all in the same custom control (CONT_NAME), so only one is displayed. Instead, if you are using a tabstrip with server paging (each time a tab is selected, it triggers the PAI), you must load only one ALV at a time, the one corresponding to the current tab.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2017 10:40:06 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2017-09-28T10:40:06Z</dc:date>
    <item>
      <title>Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558478#M21444</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I have requirement to display multiple ALVs. I have used OOPS method since I have to display ALV in different TABS. As seen below&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/74254-images.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Number of tabs are dynamic and can be displayed up to 20.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;To achieve the requirement I have called method SET_TABLE_FOR_FIRST_DISPLAY in a loop. below is code snippet.&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_zco_csprot00 INTO ls_zco_csprot00.


 lv_name = sy-tabix.
 CLEAR cont_name.
 CONCATENATE 'CONT' lv_name INTO cont_name.


CREATE OBJECT gref_con
 EXPORTING
 container_name = cont_name
 EXCEPTIONS
 cntl_error = 1
 cntl_system_error = 2
 create_error = 3
 lifetime_error = 4
 lifetime_dynpro_dynpro_link = 5
 OTHERS = 6.
 CREATE OBJECT gref_alv_grid
 EXPORTING
 i_parent = gref_con
 EXCEPTIONS
 error_cntl_create = 1
 error_cntl_init = 2
 error_cntl_link = 3
 error_dp_create = 4
 OTHERS = 5.

 CALL METHOD gref_alv_grid-&amp;gt;set_table_for_first_display
 EXPORTING
 is_layout = ls_layout
 i_save = 'A'
 CHANGING
 it_outtab = gt_final1
 it_fieldcatalog = gt_fcat
 EXCEPTIONS
 invalid_parameter_combination = 1
 program_error = 2
 too_many_lines = 3
 OTHERS = 4.
 ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Every iteration is giving me a new reference yet my ALV is not showing proper data and data from last ALV is being overwritten in all previous ALV.&lt;/P&gt;
  &lt;P&gt;I know I can create difference objects to solve the issue but since it's in dynamic in nature I need a dynamic solution.&lt;/P&gt;
  &lt;P&gt;Help will be appreciated.!!!!&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;REPORT ztest_dna.
INITIALIZATION.
CLASS lcl_class DEFINITION.
 PUBLIC SECTION.
 METHODS display.
 METHODS enter IMPORTING val TYPE i.
 DATA: value TYPE i.
ENDCLASS.
CLASS lcl_class IMPLEMENTATION.
 METHOD display.
 WRITE:/ me-&amp;gt;value.
 ENDMETHOD.
 METHOD enter.
 me-&amp;gt;value = val.
 ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
 DATA: lo_class TYPE REF TO lcl_class.
 DO 20 TIMES.
 CREATE OBJECT lo_class.
 CALL METHOD lo_class-&amp;gt;enter
 EXPORTING
 val = sy-index.
 lo_class-&amp;gt;display( ).
 ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Above program is for testing yet this one works fine. But with ALV it's not working.&lt;/P&gt;
  &lt;P&gt;P.S. : Data is going correct in method set_table_for_first_display.&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Nooruddin Bohra&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 07:31:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558478#M21444</guid>
      <dc:creator>NooruBohra</dc:creator>
      <dc:date>2017-09-28T07:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558479#M21445</link>
      <description>&lt;P&gt;I can't give you a solution for the whole requirement, but it's clear that your code is creating all the ALV at once, and is displaying them all in the same custom control (CONT_NAME), so only one is displayed. Instead, if you are using a tabstrip with server paging (each time a tab is selected, it triggers the PAI), you must load only one ALV at a time, the one corresponding to the current tab.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 10:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558479#M21445</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-09-28T10:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558480#M21446</link>
      <description>&lt;P&gt;Hi Sandra Rossi,&lt;/P&gt;
  &lt;P&gt;Thanks for the suggestion. Apologies I forgot to share that in every iteration I am preparing container Name. For every tab I have different container and I am displaying ALV in different container and not in single container.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;lv_name = sy-tabix.
 CLEAR cont_name.
 CONCATENATE 'CONT' lv_name INTO cont_name.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Sep 2017 11:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558480#M21446</guid>
      <dc:creator>NooruBohra</dc:creator>
      <dc:date>2017-09-28T11:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558481#M21447</link>
      <description>&lt;P&gt;You should store the different ALV references into different global reference variables (for instance an internal table of references), because the references which are not related anymore to a global or static variable are freed.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 12:10:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558481#M21447</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-09-28T12:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558482#M21448</link>
      <description>&lt;P&gt;As already written, create different references/occurences, so internal table records or CREATE DATA statement are suggested. In particular, care to variables that are not passed 'by value' in ALV class methods (so including the internal data table) &lt;/P&gt;
  &lt;P&gt;Also to prevent interraction between the different ALV, don't forget to also use a different HANDLE or LOG_GROUP in your variant/layout management (structure DISVARIANT)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 13:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558482#M21448</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2017-09-28T13:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558483#M21449</link>
      <description>&lt;P&gt;Thanks Sandra.&lt;/P&gt;
  &lt;P&gt;I was not aware that "the references which are not related anymore to a global or static variable are freed".&lt;/P&gt;
  &lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 06:23:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558483#M21449</guid>
      <dc:creator>NooruBohra</dc:creator>
      <dc:date>2017-09-29T06:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issue!!!! Multiple OOPs ALV at same time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558484#M21450</link>
      <description>&lt;P&gt;We've done something alike and used the same container &amp;amp; ALV for all the tabs, and used a globally defined field-symbol as data table for the ALV.&lt;/P&gt;
  &lt;P&gt;Switching tabs resulted in changing the table the global field-symbol refers to, rebuilding the field catalog, and updating the ALV.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 10:01:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-multiple-oops-alv-at-same-time/m-p/558484#M21450</guid>
      <dc:creator>Patrick_vN</dc:creator>
      <dc:date>2017-09-29T10:01:38Z</dc:date>
    </item>
  </channel>
</rss>

