<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169075#M996704</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;&lt;/P&gt;&lt;P&gt;check if the it_vbak and it_eset tables are not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to use the for all entires for those tables or try to loop it_vbak and read the it_estat to get the Objnr value aand stat values respctively into other variables then apply these avariables in select statemt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbak&lt;/P&gt;&lt;P&gt; loop at t_estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare the variable w_chgnr.&lt;/P&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;loop at it_vbak&lt;/P&gt;&lt;P&gt;read table it_estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max(chgnr)  from jscds  into w_chgnr where&lt;/P&gt;&lt;P&gt;objnr = it_vbak-objnr and stat = it_estat-stat.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;This SELECT statement will return only one record that has maximum value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to read the tables with those values with key fields into some other vairbles then use these variables in your SELECT statemnet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;Chandralekha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 16:43:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-23T16:43:21Z</dc:date>
    <item>
      <title>select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169073#M996702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  MAX( chgnr )   from jcds into corresponding fields of table it_chgnr&lt;/P&gt;&lt;P&gt;where objnr = it_vbak-objnr&lt;/P&gt;&lt;P&gt;and   stat  = it_estat-estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOW in WHERE clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both fields which i am not selecting from JCDS can i go like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select objnr  stat MAX( chgnr )   from jcds into corresponding fields of table it_chgnr&lt;/P&gt;&lt;P&gt;where objnr = it_vbak-objnr&lt;/P&gt;&lt;P&gt;and   stat  = it_estat-estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if not please provide me the correct code for above&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;my requirement is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  MAX( chgnr )   from jcds into corresponding fields of table it_chgnr&lt;/P&gt;&lt;P&gt;where objnr = it_vbak-objnr&lt;/P&gt;&lt;P&gt;and   stat  = it_estat-estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 16:29:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169073#M996702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T16:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169074#M996703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Check below code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA: L-maxchgnr TYPE jcds-chgnr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select MAX( chgnr ) from jcds into l_maxchgnr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;where objnr = it_vbak-objnr&lt;/P&gt;&lt;P&gt;and stat = it_estat-estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that the fields it_vbak-objnr, it_estat-estat. have values.&lt;/P&gt;&lt;P&gt;I think u r using this select inside loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to avoid select in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 16:41:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169074#M996703</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-07-23T16:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169075#M996704</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;&lt;/P&gt;&lt;P&gt;check if the it_vbak and it_eset tables are not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to use the for all entires for those tables or try to loop it_vbak and read the it_estat to get the Objnr value aand stat values respctively into other variables then apply these avariables in select statemt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbak&lt;/P&gt;&lt;P&gt; loop at t_estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare the variable w_chgnr.&lt;/P&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;loop at it_vbak&lt;/P&gt;&lt;P&gt;read table it_estat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max(chgnr)  from jscds  into w_chgnr where&lt;/P&gt;&lt;P&gt;objnr = it_vbak-objnr and stat = it_estat-stat.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;This SELECT statement will return only one record that has maximum value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to read the tables with those values with key fields into some other vairbles then use these variables in your SELECT statemnet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;Chandralekha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 16:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/4169075#M996704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T16:43:21Z</dc:date>
    </item>
  </channel>
</rss>

