<?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: Logic help.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213828#M766265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab  by name ascending  numbering descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now contents of itab will be&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt; name number&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;arenas 1&lt;/P&gt;&lt;P&gt;gilbert 3&lt;/P&gt;&lt;P&gt;gilbert 2&lt;/P&gt;&lt;P&gt;gilbert 1&lt;/P&gt;&lt;P&gt;mary 2&lt;/P&gt;&lt;P&gt;mary 1&lt;/P&gt;&lt;P&gt;shine 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare wa_itab as work area&lt;/P&gt;&lt;P&gt;and itab2 as another inernal table just like itab with header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt; if wa_itab-name &amp;lt;&amp;gt; itab2-name.&lt;/P&gt;&lt;P&gt; append wa into itab2.&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;now itab2 contains the desired result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2007 04:28:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-14T04:28:39Z</dc:date>
    <item>
      <title>Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213822#M766259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts help me to construct my logic regarding this scenario.&lt;/P&gt;&lt;P&gt;It would be much unclear if I would explain it so I just made a visual example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is one my itab.&lt;/P&gt;&lt;P&gt;Name: itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab has two fields:&lt;/P&gt;&lt;P&gt;name    number&lt;/P&gt;&lt;P&gt;shine      1&lt;/P&gt;&lt;P&gt;mary      1&lt;/P&gt;&lt;P&gt;mary      2&lt;/P&gt;&lt;P&gt;arenas    1&lt;/P&gt;&lt;P&gt;gilbert     1&lt;/P&gt;&lt;P&gt;gilbert     2&lt;/P&gt;&lt;P&gt;gilbert    3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you notice my numbering depends upon if the name change if not my numbering will just be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to have an internal table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my reference is my above itab.&lt;/P&gt;&lt;P&gt;I want to have an internal table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name   numbering&lt;/P&gt;&lt;P&gt;shine       1&lt;/P&gt;&lt;P&gt;mary         2&lt;/P&gt;&lt;P&gt;arenas      1&lt;/P&gt;&lt;P&gt;gilbert      3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you noticed  in my second(expected) Itab my numbering would be the maximum number that a name gets. since shine has only one number in my previous itab then the number would be 1. but since mary has a maximum number of two the numbering of mary will be number 2.so on and so fort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could help me on my logic.I have used on change of itab-name my problem is in numbering on how to get the max number per name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:03:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213822#M766259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213823#M766260</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;You can sort your internal table itab like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort itab by name number descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would give you the maximum number for a name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then loop your Itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : w_name like itab-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if w_name NE itab-name.&lt;/P&gt;&lt;P&gt;move itab to itab1.  **itab1 is the 2nd internal table.&lt;/P&gt;&lt;P&gt;clear w_name.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;w_name = itab-name.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would meet your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:11:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213823#M766260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213824#M766261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi salma,&lt;/P&gt;&lt;P&gt;                you can code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab2 like itab occurs 0 wit h header line.&lt;/P&gt;&lt;P&gt;data : itab_temp like itab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : p_tabix like sy-tabix.&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;p_tabix = sy-tabix + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab index p_tabix into itab_temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab_temp-name &amp;lt;&amp;gt; itab-name.&lt;/P&gt;&lt;P&gt;  itab2-name = itab-name.&lt;/P&gt;&lt;P&gt;  itab2-number = itab-number.&lt;/P&gt;&lt;P&gt;  append itab2.&lt;/P&gt;&lt;P&gt;  clear itab_temp.&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;itab2 will have the required data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:12:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213824#M766261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213825#M766262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Salma,&lt;/P&gt;&lt;P&gt;Try somethin like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*consider itab has name and number as field and jtab has name and numbering as field.&lt;/P&gt;&lt;P&gt;*Sort your internal table by name and number in descending order as below.. &lt;/P&gt;&lt;P&gt;Sort itab by name number descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;on change of itab-name.&lt;/P&gt;&lt;P&gt;jtab-name = itab-name.&lt;/P&gt;&lt;P&gt;jtab-numbering = itab-number.&lt;/P&gt;&lt;P&gt;append jtab.&lt;/P&gt;&lt;P&gt;end on.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;*finally sort jtab by ascending order as below.&lt;/P&gt;&lt;P&gt;sort jtab by name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will fullfill ur logic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213825#M766262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213826#M766263</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;First sort your itab in the Descending order on the base of name and number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then for displaying only max number use this logic....&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;on change of itab-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ itab-name,&lt;/P&gt;&lt;P&gt;          itab-number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endon.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;paras&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213826#M766263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213827#M766264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Try this code,.&lt;/P&gt;&lt;P&gt;  data: fs_temp like fs_itab.&lt;/P&gt;&lt;P&gt;   sort itab.&lt;/P&gt;&lt;P&gt;   loop at itab into fs_tab.&lt;/P&gt;&lt;P&gt;     w_tabix = sy-tabix + 1. &lt;/P&gt;&lt;P&gt;    read table itab into fs_temp with index w_tabix.&lt;/P&gt;&lt;P&gt;     if fs_itab-name = fs_temp-name and &lt;/P&gt;&lt;P&gt;                            fs_itab-number gt fs_temp-number.&lt;/P&gt;&lt;P&gt;    write : fs_itab-name,&lt;/P&gt;&lt;P&gt;             fs_itab-number.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;   plzz reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        manjari kotta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:23:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213827#M766264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Logic help..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213828#M766265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab  by name ascending  numbering descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now contents of itab will be&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt; name number&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;arenas 1&lt;/P&gt;&lt;P&gt;gilbert 3&lt;/P&gt;&lt;P&gt;gilbert 2&lt;/P&gt;&lt;P&gt;gilbert 1&lt;/P&gt;&lt;P&gt;mary 2&lt;/P&gt;&lt;P&gt;mary 1&lt;/P&gt;&lt;P&gt;shine 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare wa_itab as work area&lt;/P&gt;&lt;P&gt;and itab2 as another inernal table just like itab with header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt; if wa_itab-name &amp;lt;&amp;gt; itab2-name.&lt;/P&gt;&lt;P&gt; append wa into itab2.&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;now itab2 contains the desired result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:28:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-help/m-p/3213828#M766265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:28:39Z</dc:date>
    </item>
  </channel>
</rss>

