<?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: multiple records into single record in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973939#M399325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Feb 2007 17:24:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-09T17:24:55Z</dc:date>
    <item>
      <title>multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973927#M399313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam getting multiple record in an internal table .i want validate material number and country if both are same i want make it as single record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now iam getting multiple records in itab1 like this .&lt;/P&gt;&lt;P&gt;matnr,country,event,stdt,eddt&lt;/P&gt;&lt;P&gt;a1 , us , ga, 01/01/2006,01,01/01/2006&lt;/P&gt;&lt;P&gt;a1,us,pa,02/02/2006,02/02/2006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want make it as in itab2 i want compare material number and country code  &lt;/P&gt;&lt;P&gt;and i have to send some other events aslo &lt;/P&gt;&lt;P&gt;a1,us,ga,01/01/2006,01/01/2006,pa,02/02/2006,02/02/2006,ga,         ,     , es,       ,      ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any guide me how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 16:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973927#M399313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T16:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973928#M399314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SORT itab1 BY matnr land1 ASCENDING..&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM itab1 COMPARING matnr land1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 16:58:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973928#M399314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T16:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973929#M399315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont want to delte multiple records . I want to make it as single record with material number and country code validation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:00:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973929#M399315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973930#M399316</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;Do you want the internal table itab2 to be a structured internal table...OR it can be just a string internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973930#M399316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973931#M399317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort the itab by material....loop over the itab...then keep appening the values you want into a string and do the append to the 2nd table when the material changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the control statement AT END of &amp;lt;field&amp;gt; to achieve this...&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, 09 Feb 2007 17:04:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973931#M399317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973932#M399318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My requirement is i am getting data in itab1 in multiple records (with 10 fields).&lt;/P&gt;&lt;P&gt;iam sending this data to iab2 with some manipulation ( with 20 fields ) here also i have multiple records . Finally i have compare material number and country from itab2  and need to send as single record into file .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:05:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973932#M399318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973933#M399319</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;Which means..In the internal table itab1 you will always have only 2 records for the same material and country..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning in the internal table itab1 you will not have a third record..Lets say&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a1 , us , ga, 01/01/2006,01,01/01/2006&lt;/P&gt;&lt;P&gt;a1,us,pa,02/02/2006,02/02/2006&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;a1,us,pa,02/03/2006,02/03/2006&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:11:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973933#M399319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973934#M399320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What u have to do is first u&lt;/P&gt;&lt;P&gt;Sort itab by material number and country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab INTO W_ITAB.&lt;/P&gt;&lt;P&gt;  count = 0.&lt;/P&gt;&lt;P&gt;  itab_dup[] = itab[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at itab_dup INTO W_ITAB_DUP where BANFN eq W_itab-BANFN.&lt;/P&gt;&lt;P&gt;    count = count + 1.&lt;/P&gt;&lt;P&gt;    append W_itab_dup to itab_result.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  if count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    loop at itab_result INTO W_ITAB_RESULT where matnr = itab-matnr &lt;/P&gt;&lt;P&gt;                                                              and country = itab-country.&lt;/P&gt;&lt;P&gt;      concatenate W_ITAB W_ITAB_RESULT into some headerline or Workarea.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  CLEAR W_ITAB_RESULT.&lt;/P&gt;&lt;P&gt;  refresh itab_result.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above logic collects all duplicate entries in one duplicate table. And the first internal table compares with duplicate internal table, if it exists duplicate records it concatenates.&lt;/P&gt;&lt;P&gt;I think this helps u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u get any doubts let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it helps award points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973934#M399320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973935#M399321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends some times i will have 2 records and some times i will have single record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:15:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973935#M399321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973936#M399322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I dont understand what problem you are facing:&lt;/P&gt;&lt;P&gt;matnr,country,event,stdt,eddt&lt;/P&gt;&lt;P&gt;a1 , us , ga, 01/01/2006,01,01/01/2006&lt;/P&gt;&lt;P&gt;a1,us,pa,02/02/2006,02/02/2006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First sort the internal table.&lt;/P&gt;&lt;P&gt;Sort itab1 by matnr ascending country ascending.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab1 comparing matnr country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:18:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973936#M399322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973937#M399323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, what u said is correct some times i will have 2 records and some times i will have single record.&lt;/P&gt;&lt;P&gt;That is the reason we checking count.&lt;/P&gt;&lt;P&gt;if it has multiple records it goes into the loop and concatenates.&lt;/P&gt;&lt;P&gt;if it has single record it remains simply like that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973937#M399323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973938#M399324</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;So maximum of two records..Correct??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973938#M399324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973939#M399325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973939#M399325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: multiple records into single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973940#M399326</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;Okay try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the internal table ITAB2 have the same set of fields twice in your internal table ending with 1(marked in bold)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB2 OCCURS 0,&lt;/P&gt;&lt;P&gt;              MATNR TYPE MATNR,&lt;/P&gt;&lt;P&gt;              COUNTRY TYPE LAND1,&lt;/P&gt;&lt;P&gt;              EVENT,&lt;/P&gt;&lt;P&gt;              STDT  TYPE SYDATUM,&lt;/P&gt;&lt;P&gt;              EDDT TYPE SYDATUM,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;              EVENT1,&lt;/P&gt;&lt;P&gt;              STDT1  TYPE SYDATUM,&lt;/P&gt;&lt;P&gt;              EDDT1 TYPE SYDATUM,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;          END OF ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: LV_FOUND TYPE XFELD.&lt;/P&gt;&lt;P&gt;DATA: WA LIKE ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB1 BY MATNR COUNTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Make sure in the internal table ITAB1 declaration..The first field is MATNR and&lt;/P&gt;&lt;P&gt;**the second field is country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WA = ITAB1.&lt;/P&gt;&lt;P&gt;  AT NEW COUNTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Populate the internal table ITAB2.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;    ITAB2-MATNR = WA-MATNR.&lt;/P&gt;&lt;P&gt;    ITAB2-COUNTRY = WA-COUNTRY.&lt;/P&gt;&lt;P&gt;    ITAB2-EVENT = ITAB1-EVENT.&lt;/P&gt;&lt;P&gt;    ITAB2-STDT = ITAB1-STDT.&lt;/P&gt;&lt;P&gt;    ITAB2-ETDT = ITAB1-ETDT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LV_FOUND = 'X'.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  AT END OF COUNTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF LV_FOUND IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**This means the second time.&lt;/P&gt;&lt;P&gt;      ITAB2-EVENT1 = ITAB1-EVENT.&lt;/P&gt;&lt;P&gt;      ITAB2-STDT1 = ITAB1-STDT.&lt;/P&gt;&lt;P&gt;      ITAB2-ETDT1 = ITAB1-ETDT. &lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   APPEND ITAB2.&lt;/P&gt;&lt;P&gt;   CLEAR ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: LV_COUNTRY.&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 works..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 17:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-records-into-single-record/m-p/1973940#M399326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T17:34:48Z</dc:date>
    </item>
  </channel>
</rss>

