<?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 different data with another structure in ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583264#M1434707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble with my ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my functiongroup i have a screen, in the PAI of that screen i have 3 flagvariables to display 3 different types of data.&lt;/P&gt;&lt;P&gt;In my PBO i check those flags and display the desired data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in each if statement i have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF container IS INITIAL.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT container&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          container_name = 'CONTROL_AREA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CREATE OBJECT grid&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_parent          = container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM create_workitem_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL METHOD grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_default                     = 'X'&lt;/P&gt;&lt;P&gt;        CHANGING&lt;/P&gt;&lt;P&gt;          it_outtab                     = lt_wrkitm&lt;/P&gt;&lt;P&gt;          it_fieldcatalog               = lt_fieldcat&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;          program_error                 = 2&lt;/P&gt;&lt;P&gt;          too_many_lines                = 3&lt;/P&gt;&lt;P&gt;          OTHERS                        = 4.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CALL METHOD grid-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, my question is: is it possible to change the data and fieldcatalog in the alv during runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have twice the same structure, so that ain't the problem. But the third one has another structure and another fieldcatalog.&lt;/P&gt;&lt;P&gt;When i run the program, all the code works fine, but the output is still the initial one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to FREE container and grid and create a new alv to display the third option, still no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give another overview of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation A: (1 and 2 has the same structure)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1&lt;/P&gt;&lt;P&gt;option 2&lt;/P&gt;&lt;P&gt;option 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chosing 1: display correct data&lt;/P&gt;&lt;P&gt;chosing 2: display correct data&lt;/P&gt;&lt;P&gt;chosing 3: display data of option 2&lt;/P&gt;&lt;P&gt;chosing 1:display correct data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation B: : (1 and 2 has the same structure)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1&lt;/P&gt;&lt;P&gt;option 2&lt;/P&gt;&lt;P&gt;option 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chosing 3: display correct data&lt;/P&gt;&lt;P&gt;chosing 2: display data of option 3&lt;/P&gt;&lt;P&gt;chosing 1: display data of option 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand my problem and you're able to help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Merijn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Feb 2010 09:49:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-19T09:49:52Z</dc:date>
    <item>
      <title>different data with another structure in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583264#M1434707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble with my ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my functiongroup i have a screen, in the PAI of that screen i have 3 flagvariables to display 3 different types of data.&lt;/P&gt;&lt;P&gt;In my PBO i check those flags and display the desired data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in each if statement i have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF container IS INITIAL.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT container&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          container_name = 'CONTROL_AREA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CREATE OBJECT grid&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_parent          = container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM create_workitem_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL METHOD grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_default                     = 'X'&lt;/P&gt;&lt;P&gt;        CHANGING&lt;/P&gt;&lt;P&gt;          it_outtab                     = lt_wrkitm&lt;/P&gt;&lt;P&gt;          it_fieldcatalog               = lt_fieldcat&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;          program_error                 = 2&lt;/P&gt;&lt;P&gt;          too_many_lines                = 3&lt;/P&gt;&lt;P&gt;          OTHERS                        = 4.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CALL METHOD grid-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, my question is: is it possible to change the data and fieldcatalog in the alv during runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have twice the same structure, so that ain't the problem. But the third one has another structure and another fieldcatalog.&lt;/P&gt;&lt;P&gt;When i run the program, all the code works fine, but the output is still the initial one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to FREE container and grid and create a new alv to display the third option, still no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give another overview of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation A: (1 and 2 has the same structure)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1&lt;/P&gt;&lt;P&gt;option 2&lt;/P&gt;&lt;P&gt;option 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chosing 1: display correct data&lt;/P&gt;&lt;P&gt;chosing 2: display correct data&lt;/P&gt;&lt;P&gt;chosing 3: display data of option 2&lt;/P&gt;&lt;P&gt;chosing 1:display correct data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation B: : (1 and 2 has the same structure)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1&lt;/P&gt;&lt;P&gt;option 2&lt;/P&gt;&lt;P&gt;option 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chosing 3: display correct data&lt;/P&gt;&lt;P&gt;chosing 2: display data of option 3&lt;/P&gt;&lt;P&gt;chosing 1: display data of option 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand my problem and you're able to help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Merijn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 09:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583264#M1434707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T09:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: different data with another structure in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583265#M1434708</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 think we need ot create the field catalog also dynamically depending on the selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;teja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 10:30:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583265#M1434708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T10:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: different data with another structure in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583266#M1434709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I found the solution... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just didn't use the grid-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i created the container and the grid object once and just used the set_table_for_first_display whenever i wanted to display the alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully my solution can help others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway Teja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 10:37:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/different-data-with-another-structure-in-alv/m-p/6583266#M1434709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-19T10:37:50Z</dc:date>
    </item>
  </channel>
</rss>

