<?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: Need Logic for this Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539422#M1427754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i solved this problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2010 12:12:26 GMT</pubDate>
    <dc:creator>digvijay_rai</dc:creator>
    <dc:date>2010-01-29T12:12:26Z</dc:date>
    <item>
      <title>Need Logic for this Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539419#M1427751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need logic for this problem ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem is like i have a internal table in which i am having some fields i need to format it and to get a new table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.,   This is the table with  F1 , F2 , F3 , F4 ,F5   table is sorted on the base of F2 &amp;amp; F3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based upon the Field  F4 i need to format this given internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F1      F2      F3      F4   F5  &lt;/P&gt;&lt;P&gt;11     X        112    A     -&lt;/P&gt;&lt;P&gt;12     X        112    A     -&lt;/P&gt;&lt;P&gt;13     X        112    A     -&lt;/P&gt;&lt;P&gt;14     Y        112    A     -&lt;/P&gt;&lt;P&gt;15     Y        112    B     - &lt;/P&gt;&lt;P&gt;16     Y        112    B    -&lt;/P&gt;&lt;P&gt;17     Y        112    C    - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Desired output .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F1    F2      F3      F4    F5 &lt;/P&gt;&lt;P&gt;11    x        112    A     11/12/13&lt;/P&gt;&lt;P&gt;14    Y       112    A      14&lt;/P&gt;&lt;P&gt;15    Y       112    B      15/16&lt;/P&gt;&lt;P&gt;17    Y       112    C      17 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Digvijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 03:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539419#M1427751</guid>
      <dc:creator>digvijay_rai</dc:creator>
      <dc:date>2010-01-22T03:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need Logic for this Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539420#M1427752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello digvijay...!&lt;/P&gt;&lt;P&gt;you can sort the interanl table according to the fields and &lt;/P&gt;&lt;P&gt;use control break statment&lt;/P&gt;&lt;P&gt; Like &lt;/P&gt;&lt;P&gt;LOOP AT ITAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   AT NEW &amp;lt;your field&amp;gt;.&lt;/P&gt;&lt;P&gt;your code&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;your code logic&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;&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;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 03:24:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539420#M1427752</guid>
      <dc:creator>anup_deshmukh4</dc:creator>
      <dc:date>2010-01-22T03:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need Logic for this Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539421#M1427753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Digvijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can refer below logic and by modifying it a little bit you will be able to achieve your output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;itab[] = i_itab[]. "your internal table.
Loop at itab into wa_itab.

if sy-tabix &amp;gt; 1.
 v_f1 = wa_itab-f1.
 v_index = sy-tabix - 1.
 read table itab into wa_itab_new with index v_index.
  if sy-subrc eq 0.
    v_f2 = wa_itab_new-f2.
    v_f4 = wa_itab_new-f4.
  endif.
  if wa_itab-f2 eq v_f2 and wa_itab-f4 eq v_f4. 
    v_f5 = wa_itab_new-f1.
    v_index = sy-tabix + 1.
    delete itab with index v_index.
    concatenate v_f5 / v_f1 to wa_itab_new-f5.
    *modify new_itab from wa_itab transporting f5.
   else.
    continue.
   endif.
endif.
clear: wa_itab, v_f5, wa_itab_new, v_f1, v_f2, v_f4.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thansk,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Archana Pawar on Jan 22, 2010 5:34 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 04:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539421#M1427753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-22T04:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need Logic for this Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539422#M1427754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i solved this problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 12:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-logic-for-this-problem/m-p/6539422#M1427754</guid>
      <dc:creator>digvijay_rai</dc:creator>
      <dc:date>2010-01-29T12:12:26Z</dc:date>
    </item>
  </channel>
</rss>

