<?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: Select single from EKEK in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093332#M435508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cant use aggregate funtion in FOR ALL ENTRY statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2007 14:35:00 GMT</pubDate>
    <dc:creator>alex_m</dc:creator>
    <dc:date>2007-04-17T14:35:00Z</dc:date>
    <item>
      <title>Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093325#M435501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         I have EBELN and EBELP with me.&lt;/P&gt;&lt;P&gt;WIth this I want to select only one record from EKEK where the field ABRUF has the max. value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to select all the records and then sort it and the n delete the records with index gt 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead I want to Select from the EKEK Table only one record at once using Select single .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm not able to get an Idea of how-to ?&lt;/P&gt;&lt;P&gt;Can any one tell me how to fetch this single record ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 13:46:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093325#M435501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T13:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093326#M435502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use select max( ABRUF ) from EKEK into table itab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 13:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093326#M435502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T13:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093327#M435503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT ebeln ebelp max( abruf ) from EKEK&lt;/P&gt;&lt;P&gt;into itab &lt;/P&gt;&lt;P&gt;where .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sudha Mohan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 13:52:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093327#M435503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T13:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093328#M435504</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;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: V_ABRUF LIKE EKEK-ABRUF.

SELECT MAX( ABRUF )
INTO V_ABRUF
FROM EKEK
WHERE EBELN = P_EBELN
  AND EBELP = P_EBELP.

WRITE: / V_ABRUF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 13:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093328#M435504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T13:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093329#M435505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  MAX( [DISTINCT] col ) Determines the maximum value of the value in the column col in the resulting set or in the current group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select MAX( ABRUF )&lt;/P&gt;&lt;P&gt;  from EKEK&lt;/P&gt;&lt;P&gt;  into Itab&lt;/P&gt;&lt;P&gt;  where EBELN eq ______         &lt;/P&gt;&lt;P&gt;     and EBELP eq ______ .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;       jay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 14:00:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093329#M435505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T14:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093330#M435506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt; Thanks for ur reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  But I was getting an error when I used ur Statements as it is. &lt;/P&gt;&lt;P&gt;SO I used like this:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    LOOP AT gt_temp_data INTO gwa_temp_data.
      SELECT ebeln ebelp MAX( abruf ) FROM ekek
      INTO CORRESPONDING FIELDS OF TABLE gt_ekek
      WHERE ebeln  = gwa_temp_data-ebeln
      AND   ebelp = gwa_temp_data-ebelp
      GROUP BY ebeln ebelp abruf.
    ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solved my problem .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to use for-all-entries.&lt;/P&gt;&lt;P&gt;Can u guys tell me how to use this bcoz I'm getting an error once again saying :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"The addition for-all-entries excludes all aggregate functions with the exceptionof count(*) as the single element of the select clause ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 14:09:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093330#M435506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T14:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093331#M435507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use FOR ALL ENTRIES,  you can not have aggregate functions other than COUNT(*).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 14:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093331#M435507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T14:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select single from EKEK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093332#M435508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cant use aggregate funtion in FOR ALL ENTRY statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 14:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-from-ekek/m-p/2093332#M435508</guid>
      <dc:creator>alex_m</dc:creator>
      <dc:date>2007-04-17T14:35:00Z</dc:date>
    </item>
  </channel>
</rss>

