<?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: Split internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282609#M1988855</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;kdarunday&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Suggest you to do following steps:&lt;/P&gt;&lt;P&gt;1) Try fetching the entire data from respective tables with unique SELECTs.&lt;/P&gt;&lt;P&gt;2) Later you can use GROUP BY functionalities. You can refer below blogs for better understanding!&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2016/06/23/group-by-for-internal-tables-step-by-stepc/" target="_blank"&gt;BLOG1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2017/11/30/5-use-cases-of-group-by-for-internal-tables/" target="_blank"&gt;BLOG2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jul 2020 14:35:33 GMT</pubDate>
    <dc:creator>former_member1716</dc:creator>
    <dc:date>2020-07-08T14:35:33Z</dc:date>
    <item>
      <title>Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282607#M1988853</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I have a requirement where I have a select-options for plant input that can handle ranges.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;With plant input, I need to select from multiple tables.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;From these tables, I have created internal tables e.g gt_ekpo, gt_eban, gt_marc.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;My question is how do I print the output in such a way that it is separated by plant? For example, my input in selection screen is 1110 and 1112.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I want to print it like the below:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Plant 1110&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_ekpo&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_eban&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_marc.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Plant 1112&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_ekpo&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_eban&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Details from gt_marc.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thank you.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Kath&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 14:15:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282607#M1988853</guid>
      <dc:creator>former_member602116</dc:creator>
      <dc:date>2020-07-08T14:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282608#M1988854</link>
      <description>&lt;P&gt;Hi Katherine,&lt;/P&gt;&lt;P&gt;For this you probably best use the &lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abaploop_at_itab_group_by.htm" target="_blank"&gt;LOOP AT ... GROUP BY&lt;/A&gt; statement&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Yor&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 14:19:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282608#M1988854</guid>
      <dc:creator>YorRombaut</dc:creator>
      <dc:date>2020-07-08T14:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282609#M1988855</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;kdarunday&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Suggest you to do following steps:&lt;/P&gt;&lt;P&gt;1) Try fetching the entire data from respective tables with unique SELECTs.&lt;/P&gt;&lt;P&gt;2) Later you can use GROUP BY functionalities. You can refer below blogs for better understanding!&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2016/06/23/group-by-for-internal-tables-step-by-stepc/" target="_blank"&gt;BLOG1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2017/11/30/5-use-cases-of-group-by-for-internal-tables/" target="_blank"&gt;BLOG2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 14:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282609#M1988855</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2020-07-08T14:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282610#M1988856</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Along with &lt;SPAN class="mention-scrubbed"&gt;satishkumarbalasubramanian&lt;/SPAN&gt;'s answer which is right way approach, try by sort based on Plant and loop at ..  AT NEW append to tab1 also can help. &lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 15:20:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282610#M1988856</guid>
      <dc:creator>Abinathsiva</dc:creator>
      <dc:date>2020-07-08T15:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282611#M1988857</link>
      <description>&lt;P&gt;Since you already collected all the data in your three tables, gt_ekpo, gt_eban and gt_marc, you could do the following in a loop for your plants, to print out the information:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_plants ASSIGNING &amp;lt;plant&amp;gt;. " e.g. select from T001W based on input
  
  WRITE: / &amp;lt;plant&amp;gt;-werks, ' ', &amp;lt;plant&amp;gt;-name1.

  LOOP AT gt_ekpo ASSIGNING &amp;lt;ekpo&amp;gt; WHERE werks = &amp;lt;plant&amp;gt;-werks.
    " Write details from gt_ekpo
  ENDLOOP.

  LOOP AT gt_eban ASSIGNING &amp;lt;eban&amp;gt; WHERE werks = &amp;lt;plant&amp;gt;-werks.
    " Write details from gt_eban
  ENDLOOP.

  LOOP AT gt_marc ASSIGNING &amp;lt;marc&amp;gt; WHERE werks = &amp;lt;plant&amp;gt;-werks.
    " Write details from gt_ekpo
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Depending on the amount of selected data, it could be useful to define primary or secondary sorted keys for gt_ekpo, gt_eban and gt_marc, in order to improve the performance when accessing those tables.&lt;/P&gt;&lt;P&gt;If you want to rewrite your select, you could also fetch all the data at once using several joins to combine data from T001W, EKPO, EBAN and MARC, and use the GROUP BY function on the resulting internal table.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_table INTO DATA(wa).
                  GROUP BY wa-werks
                  INTO DATA(key).
   
  LOOP AT GROUP key ASSIGNING FIELD-SYMBOL(&amp;lt;members&amp;gt;).
    " collect data based on plant
  ENDLOOP.

  WRITE: / &amp;lt;members&amp;gt;-werks, ' ', &amp;lt;members&amp;gt;-name1.
  " write data collected for plant
ENDLOOP.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282611#M1988857</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-07-10T15:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282612#M1988858</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;kdarunday&lt;/SPAN&gt;, do you continue to have issues or were you able to solve your problem?&lt;/P&gt;&lt;P&gt;Please add comments to your question that further describe your problem or add an answer that describes how you solved your problem.&lt;BR /&gt;If your problem is solved, accept an answer if it helped you and please close the question.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 03:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table/m-p/12282612#M1988858</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-10-09T03:44:13Z</dc:date>
    </item>
  </channel>
</rss>

