<?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: SUBQUERY ( points will be rewarded ) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002381#M956187</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;    Use the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt; ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt; BEGIN OF t_ekpo OCCURS 0,&lt;/P&gt;&lt;P&gt; ebeln TYPE ebeln,&lt;/P&gt;&lt;P&gt; ebelp TYPE ebelp,&lt;/P&gt;&lt;P&gt;END OF t_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_ebeln FOR ekpo-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln&lt;/P&gt;&lt;P&gt;       ebelp&lt;/P&gt;&lt;P&gt; FROM  ekpo&lt;/P&gt;&lt;P&gt; INTO  TABLE t_ekpo&lt;/P&gt;&lt;P&gt;WHERE  ebeln IN s_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;  SORT t_ekpo BY ebeln ebelp DESCENDING .&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM t_ekpo COMPARING ebeln.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaya Vani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2008 06:56:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-24T06:56:25Z</dc:date>
    <item>
      <title>SUBQUERY ( points will be rewarded )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002380#M956186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can someone help me to write a query to select all the records from the table ekpo...where the EBELP should be the max for the corresponding PO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex. if the ekpo table has the following data ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EBELN        EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4500000003   00010&lt;/P&gt;&lt;P&gt;4500000842   00010&lt;/P&gt;&lt;P&gt;4500000842   00020&lt;/P&gt;&lt;P&gt;4500010022   00010&lt;/P&gt;&lt;P&gt;4500010022   00020&lt;/P&gt;&lt;P&gt;4500010022   00030&lt;/P&gt;&lt;P&gt;4500010022   00040&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then my output should be as follows....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EBELN        EBELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4500000003   00010&lt;/P&gt;&lt;P&gt;4500000842   00020&lt;/P&gt;&lt;P&gt;4500010022   00040&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thnx in advance ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 06:46:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002380#M956186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T06:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: SUBQUERY ( points will be rewarded )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002381#M956187</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;    Use the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt; ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt; BEGIN OF t_ekpo OCCURS 0,&lt;/P&gt;&lt;P&gt; ebeln TYPE ebeln,&lt;/P&gt;&lt;P&gt; ebelp TYPE ebelp,&lt;/P&gt;&lt;P&gt;END OF t_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_ebeln FOR ekpo-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln&lt;/P&gt;&lt;P&gt;       ebelp&lt;/P&gt;&lt;P&gt; FROM  ekpo&lt;/P&gt;&lt;P&gt; INTO  TABLE t_ekpo&lt;/P&gt;&lt;P&gt;WHERE  ebeln IN s_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;  SORT t_ekpo BY ebeln ebelp DESCENDING .&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM t_ekpo COMPARING ebeln.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaya Vani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 06:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002381#M956187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T06:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: SUBQUERY ( points will be rewarded )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002382#M956188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Poonam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do like this also for e.g.&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt;data:itab type table of ekpo.&lt;/P&gt;&lt;P&gt;data:v_ebeln type ekpo-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ebelp int table itab where ebeln =  v_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by ebeln ebelp descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates comparing ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So inthis way your internal table will have PO no. and their highest corresponding line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help children of U.N World Food Program by rewarding  points and encourage others to answer your queries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 07:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002382#M956188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T07:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: SUBQUERY ( points will be rewarded )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002383#M956189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could be achieved ny using aggregate functions with SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln&lt;/P&gt;&lt;P&gt;       max( DISTINCT ebelp )&lt;/P&gt;&lt;P&gt;       from ekpo&lt;/P&gt;&lt;P&gt;       into table iekpo&lt;/P&gt;&lt;P&gt;       where ebeln = '3000000004' (or specify the entire rangle of EBELN)&lt;/P&gt;&lt;P&gt;       group by ebeln .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 07:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002383#M956189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T07:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: SUBQUERY ( points will be rewarded )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002384#M956190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnx guys.. it was very helpful...i have awarded points as well..thnx again..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 07:35:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquery-points-will-be-rewarded/m-p/4002384#M956190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T07:35:54Z</dc:date>
    </item>
  </channel>
</rss>

