<?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 Item lines in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126789#M1511911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could separate the IT in TWO IT.. one for the header and one for the details.! and do two loops...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jul 2010 15:51:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-30T15:51:05Z</dc:date>
    <item>
      <title>Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126785#M1511907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an internal table with header and line items for a posting. The header and line items are differntiated with a field called record type and it has values as H or L...now i have to run BDC for the line items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So ihave to send lines for both H and L as one document...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Record type &lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will from two documents: H L L L and H L L....&lt;/P&gt;&lt;P&gt;How should i loop through the internal table to split....i am not sure of the logic to do that.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KIndly help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 10:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126785#M1511907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-30T10:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126786#M1511908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE OF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below code for the DIfference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : BEGIN OF itab OCCURS 0,
bukrs LIKE t001-bukrs,
f1(10) TYPE c,
END OF itab.

itab-bukrs = '1000'.
itab-f1 = '1111111'.
APPEND itab.

itab-bukrs = '1100'.
itab-f1 = '3333333'.
APPEND itab.


itab-bukrs = '1200'.
itab-f1 = '555555'.
APPEND itab.

*at new

LOOP AT itab.
  AT NEW bukrs.
    WRITE :/ itab-bukrs , itab-f1.
  ENDAT.

ENDLOOP.

*onchange

LOOP AT itab.
  ON CHANGE OF itab-bukrs.
    WRITE :/ itab-bukrs , itab-f1.

  ENDON.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1000 **********
1100 **********
1200 **********


1000 1111111
1100 3333333
1200 555555&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Raj on Jul 30, 2010 4:37 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 11:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126786#M1511908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-30T11:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126787#M1511909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use loop control statements to achieve this requirement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab INTO wa.
  
  wa1 = wa. "Trick to remove the * inside the AT ... ENDAT block

  AT NEW record_type.
    IF wa-record_type = 'H'.
      "Code for header data
    ELSEIF wa-record_type = 'L'.
      "Code for line items
    ENDIF.
  ENDAT.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 11:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126787#M1511909</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-30T11:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126788#M1511910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working in this case,if it is header is following with item record it will works,but for the last item records&lt;/P&gt;&lt;P&gt;its not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 15:13:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126788#M1511910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-30T15:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126789#M1511911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could separate the IT in TWO IT.. one for the header and one for the details.! and do two loops...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 15:51:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126789#M1511911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-30T15:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126790#M1511912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It can be done two ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will be having the key fields common for header and item tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can either seperate the item details and header details into seperate internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The loop at header and then a nested loop at item, like this you can process your bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can use control berak statements if you are planning to use a singe internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Aug 2010 15:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126790#M1511912</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-08-01T15:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126791#M1511913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kesav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 07:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126791#M1511913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-02T07:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126792#M1511914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please paste the internal data and your code part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 09:03:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126792#M1511914</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-08-02T09:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126793#M1511915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; Just use this simple code .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;bukrs LIKE t001-bukrs,&lt;/P&gt;&lt;P&gt;f1(1) TYPE c,&lt;/P&gt;&lt;P&gt;END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '1'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'H'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '2'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '3'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '4'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'H'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab-f1 = '5'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '6'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-f1 = '6'.&lt;/P&gt;&lt;P&gt;itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;APPEND itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF itab-bukrs = 'H'.&lt;/P&gt;&lt;P&gt;      "Code for header data&lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; itab-bukrs , itab-f1.&lt;/P&gt;&lt;P&gt;ELSEIF itab-bukrs = 'L'.&lt;/P&gt;&lt;P&gt;      "Code for line items&lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; itab-bukrs , itab-f1.&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;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this code will help you .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 11:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126793#M1511915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-02T11:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table Item lines</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126794#M1511916</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;Please try this if it helps...&lt;/P&gt;&lt;P&gt;Before looping the internal table,  add a tail record at the end (i.e. a dummy record which you won't process, let's say a record with record_type = 'D') then the syntax ON-CHANGE-OF will work till the last required record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if useful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 12:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-item-lines/m-p/7126794#M1511916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-02T12:04:19Z</dc:date>
    </item>
  </channel>
</rss>

