<?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 Minimum value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360366#M1400320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 small requirements for my object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)I have to select the Minimum value of field AUFNR from table AUFK. Is there any command for that instead of using a select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Also i have to extract the common values from 2 internal tables and then I have to select the minimum value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone let me know about the solution for the above 2 issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Natasha SS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Nov 2009 11:31:13 GMT</pubDate>
    <dc:creator>former_member423024</dc:creator>
    <dc:date>2009-11-17T11:31:13Z</dc:date>
    <item>
      <title>Minimum value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360366#M1400320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 small requirements for my object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)I have to select the Minimum value of field AUFNR from table AUFK. Is there any command for that instead of using a select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Also i have to extract the common values from 2 internal tables and then I have to select the minimum value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone let me know about the solution for the above 2 issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Natasha SS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 11:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360366#M1400320</guid>
      <dc:creator>former_member423024</dc:creator>
      <dc:date>2009-11-17T11:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360367#M1400321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Natasha, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press F1 on these : SELECT , MIN , INNER JOIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select with min , will help you to get minimum value from the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you will make a combination of Inner join also , you can get value from two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Harsh Bhalla on Nov 17, 2009 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 11:39:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360367#M1400321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360368#M1400322</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;1) As far as I know, you can do it using two ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write a select query using aggregate function MIN and select the data. &lt;/P&gt;&lt;P&gt;Alternatively, you can select all the data from the table into an internal table and sort it ascending based on the required field and get the value from the first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) For your second query, try something like this. Its just a skeleton.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort itab1 by field1 field2.
sort itab2 by field1 field2.
loop at itab1 into wtab1.
at new wtab1-field1. "This will happen only for every new value of field1. 
  read table itab2 into wtab2 with key = wtab1-field1.
  lv_tabix = sy-tabix.
  loop at itab2 into wtab2 from lv_tabix. 
   append wtab2 to it_temp. "Or append the required fields
  endloop.
endat.
append wtab1 to it_temp.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 11:42:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360368#M1400322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T11:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360369#M1400323</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;&lt;/P&gt;&lt;P&gt;Using select query we can get the minimum value as ahown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_aufnr(12) type c.&lt;/P&gt;&lt;P&gt;select min( AUFNR ) into l_aufnr from aufk.&lt;/P&gt;&lt;P&gt;write: l_aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any specific reason of not using select query ?&lt;/P&gt;&lt;P&gt;Orelse you can use sort keyword to sort the records according to ascending or decending by which you can get&lt;/P&gt;&lt;P&gt;the minimum value. Use the below link for more info&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/EN/66/bc7ad243c211d182b30000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/EN/66/bc7ad243c211d182b30000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Venkat Reddy on Nov 17, 2009 5:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/minimum-value/m-p/6360369#M1400323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:02:49Z</dc:date>
    </item>
  </channel>
</rss>

