<?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 required for a Internal table  issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858860#M1475398</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;SORT ITAB BY STLNR STPRS DESCENDING. &lt;/P&gt;&lt;P&gt;READ TABLE ITAB INDEX 1. &lt;/P&gt;&lt;P&gt;WRITE:/ ITAB-STPRS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Apr 2010 07:08:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-23T07:08:42Z</dc:date>
    <item>
      <title>Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858855#M1475393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to take the maximum amount(stprs) according to my stlnr value. That means in my internal table having lots of entries. its contain stlnr and stprs. i want to pick only the maximum stprs value for each and every stlnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my internal table like below, for example from the internal table i required 17238 and its 0.32 , 17210 and its 0.21, 162178 and its 6.21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

STLNR	MATNR	STPRS
17238	1021208	0.01
17238	1339526	0.32
15028	1330026	5
17210	7376973	0.21
17210	7379263	0.01
162178	1574231	3.21
162178	814661	6.21

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gowri sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 06:31:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858855#M1475393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T06:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858856#M1475394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT ITAB BY STLNR STPRS DESCENDING.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING STLNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resulting ITAB has the required records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 06:35:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858856#M1475394</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-23T06:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858857#M1475395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Data:
  flag type i.
sort t_tab by stlnr STPRS descending.
Loop at t_tab into fs_tab.

at new of stlnr.
flag = 1.
endat.

if flag = 0.
delete t_tab index sy-tabix.
endif.
flag = 0.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If stlnr is first field in the table use as above at new or replace that with&lt;/P&gt;&lt;P&gt;on cgange ....endon statement.&lt;/P&gt;&lt;P&gt;Regards and Best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 06:40:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858857#M1475395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T06:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858858#M1475396</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;SORT ITAB BY STLNR ASCENDING STPRS DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read itab for first STLNR in each STLNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Moon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 06:46:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858858#M1475396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T06:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858859#M1475397</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;if you want to fetch max amount records from a database table&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select STLNR MATNR STPRS from (table name) into corresponding fields of table (internal table) order by  STPRS descending.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 06:48:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858859#M1475397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T06:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858860#M1475398</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;SORT ITAB BY STLNR STPRS DESCENDING. &lt;/P&gt;&lt;P&gt;READ TABLE ITAB INDEX 1. &lt;/P&gt;&lt;P&gt;WRITE:/ ITAB-STPRS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 07:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6858860#M1475398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T07:08:42Z</dc:date>
    </item>
  </channel>
</rss>

