<?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 on KEKO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300428#M158243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you can do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.


data: xkeko type keko .

parameters: p_matnr type mara-matnr,
            p_werks type marc-werks.

select * from keko up to 1 rows into  xkeko
            where matnr = p_matnr
              and werks = p_werks
                  order by kadky descending.

endselect.

write:/ xkeko-kadky, xkeko-matnr, xkeko-werks, xkeko-losgr.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2006 19:44:20 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-05-11T19:44:20Z</dc:date>
    <item>
      <title>Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300425#M158240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the material number and the plant.  What is the most efficient select to get the latest kalnr(costing estimate) based on date. Doing a select-endselect to find the last record is a performance problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current code:&lt;/P&gt;&lt;P&gt; select kalnr kadky&lt;/P&gt;&lt;P&gt;        from keko&lt;/P&gt;&lt;P&gt;        where matnr = mbew-matnr&lt;/P&gt;&lt;P&gt;              werks = werks-low.&lt;/P&gt;&lt;P&gt; endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?  Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:26:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300425#M158240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T19:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300426#M158241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;report zrich_0001.


data: ikeko type table of keko with header line..

parameters: p_matnr type mara-matnr,
            p_werks type marc-werks.


select * from keko into table ikeko
            where matnr = p_matnr
              and werks = p_werks.


sort ikeko descending by kadky.

read table ikeko index 1.


write:/ ikeko-kadky, ikeko-matnr, ikeko-werks, ikeko-LOSGR.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300426#M158241</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-05-11T19:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300427#M158242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Janet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than using  Select-EndSelect, you can used Select into internal table....which wll be much faster while processing data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So query will be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Kalnr kadky&lt;/P&gt;&lt;P&gt;into   itab1&lt;/P&gt;&lt;P&gt;from keko&lt;/P&gt;&lt;P&gt;where matnr = mbew-matnr&lt;/P&gt;&lt;P&gt;werks = werks-low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you can loop into itab1 if you want to process data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:42:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300427#M158242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T19:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300428#M158243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you can do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.


data: xkeko type keko .

parameters: p_matnr type mara-matnr,
            p_werks type marc-werks.

select * from keko up to 1 rows into  xkeko
            where matnr = p_matnr
              and werks = p_werks
                  order by kadky descending.

endselect.

write:/ xkeko-kadky, xkeko-matnr, xkeko-werks, xkeko-losgr.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:44:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300428#M158243</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-05-11T19:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300429#M158244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SELECT... ENDSELECT is a slower method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have no keys fields here so your DB engine will be using the INDEX on MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select Kalnr kadky&lt;/P&gt;&lt;P&gt;into table The_Table&lt;/P&gt;&lt;P&gt;from keko&lt;/P&gt;&lt;P&gt;where matnr = mbew-matnr&lt;/P&gt;&lt;P&gt;werks = werks-low&lt;/P&gt;&lt;P&gt;descending by kadky.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;read table The_table index 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300429#M158244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T19:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select on KEKO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300430#M158245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single Kalnr kadky into (keko-kalnr, keko-kadky)&lt;/P&gt;&lt;P&gt;from keko&lt;/P&gt;&lt;P&gt;where matnr = mbew-matnr&lt;/P&gt;&lt;P&gt;werks = werks-low&lt;/P&gt;&lt;P&gt;descending by kadky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 19:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-on-keko/m-p/1300430#M158245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T19:46:22Z</dc:date>
    </item>
  </channel>
</rss>

