<?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: internal table operation question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662430#M1944409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like the good old grouping issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have NW 7.4 &amp;gt;= SP08 you can use a LOOP AT ... GROUP BY ... There you can also define a sorting order. In your case, I think you need DESCENGING ordering by the "hazardous" flag, so TRUE ('X') entries will come first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 12:35:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-05-12T12:35:21Z</dc:date>
    <item>
      <title>internal table operation question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662428#M1944407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am printing bill of lading with materials, I have some materials marked as hazardous , in that case I need to print all the hazardous materials first and the remaining materials should be printed after the hazardous materials are printed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know a method as get the main internal table contents into a temp table, and delete the non hazardous material from&amp;nbsp; temp table , and move&amp;nbsp; those hazardous materials into a third table&amp;nbsp; which are at the temp table , and after that loop the actual table containing both the hazardous and non hazardous material and if the material is present in the temp table dont append else append into the third table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest if there is other best method as this requires two additional tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;\RG &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 12:08:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662428#M1944407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T12:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: internal table operation question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662429#M1944408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Always logic is dependent on individual developers....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several ways to achieve it...&lt;/P&gt;&lt;P&gt;1. Fire two queries with appending lines( first for hazardous, second for rest)...It will hit two times to DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are on ABAP 7.4 SP 08/7.5 Stack,&lt;/P&gt;&lt;P&gt;You can go with FILTER &lt;A href="https://help.sap.com/abapdocu_740/en/abenfilter_table_abexa.htm" title="https://help.sap.com/abapdocu_740/en/abenfilter_table_abexa.htm"&gt;ABAP Keyword Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Amol S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 12:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662429#M1944408</guid>
      <dc:creator>amol_samte</dc:creator>
      <dc:date>2016-05-12T12:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: internal table operation question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662430#M1944409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like the good old grouping issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have NW 7.4 &amp;gt;= SP08 you can use a LOOP AT ... GROUP BY ... There you can also define a sorting order. In your case, I think you need DESCENGING ordering by the "hazardous" flag, so TRUE ('X') entries will come first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 12:35:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662430#M1944409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: internal table operation question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662431#M1944410</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;In my case how can I use group BY. I think in that case also I have two use two internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;RG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 12:52:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662431#M1944410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T12:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: internal table operation question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662432#M1944411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example you have a table with the fields KEY, FLAG and DATA. Inside the internal table you have some data with set FLAG ('X') and unset FLAG (' '). KEY is simply an ID and DATA some text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT lt_table ASSIGNING FIELD-SYMBOL(&amp;lt;ls_entry&amp;gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY flag DESCENDING INTO DATA(lv_flag).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE: / |Flag is '{ lv_flag }'|. " output = Flag is 'X'&amp;nbsp; or Flag is ' '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOOP AT GROUP lv_flag ASSIGNING FIELD-SYMBOL(&amp;lt;ls_member&amp;gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE: / |{ &amp;lt;ls_member&amp;gt;-key } = { &amp;lt;ls_member&amp;gt;-data }|.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Explanation:&lt;/P&gt;&lt;P&gt;With the GROUP BY you create groups for the field FLAG. In your case only two. One group with set FLAG and one with unset FLAG. With the addition DESCENDING the entries with FLAG = 'X' are handled first. With the LOOP AT GROUP you walk through all member of a group, i.e. first through all entries with FLAG = 'X' and second through all entries with FLAG = ' '.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-operation-question/m-p/11662432#M1944411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T13:45:32Z</dc:date>
    </item>
  </channel>
</rss>

