<?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: Problem with select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974100#M949213</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;IF NOT i_dfkkko[] IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT opbel&lt;/P&gt;&lt;P&gt;belnr&lt;/P&gt;&lt;P&gt;FROM erchc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INTO CORRESPONDING FIELDS OF TABLE&lt;/STRONG&gt; i_erchc1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_dfkkko&lt;/P&gt;&lt;P&gt;WHERE opbel EQ i_dfkkko-xblnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vallamuthu.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2008 08:22:00 GMT</pubDate>
    <dc:creator>vallamuthu_madheswaran2</dc:creator>
    <dc:date>2008-06-10T08:22:00Z</dc:date>
    <item>
      <title>Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974099#M949212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_dfkkko-xblnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT i_dfkkko[] IS INITIAL       .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT opbel&lt;/P&gt;&lt;P&gt;           belnr&lt;/P&gt;&lt;P&gt;           FROM erchc&lt;/P&gt;&lt;P&gt;           INTO TABLE i_erchc1&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN i_dfkkko&lt;/P&gt;&lt;P&gt;           WHERE opbel EQ i_dfkkko-xblnr.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the above select query.problem is when i put the value&lt;/P&gt;&lt;P&gt;of i_dfkkko-xblnr by going to the table erchc i am getting the record.But this qury is not resulting any value.&lt;/P&gt;&lt;P&gt;i have checked in debug mode copied the value of xblnr of i_dfkkko&lt;/P&gt;&lt;P&gt;and went to erchc table and passed to opbel of erchc i got the reords.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody pls help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:18:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974099#M949212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974100#M949213</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;IF NOT i_dfkkko[] IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT opbel&lt;/P&gt;&lt;P&gt;belnr&lt;/P&gt;&lt;P&gt;FROM erchc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INTO CORRESPONDING FIELDS OF TABLE&lt;/STRONG&gt; i_erchc1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_dfkkko&lt;/P&gt;&lt;P&gt;WHERE opbel EQ i_dfkkko-xblnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vallamuthu.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974100#M949213</guid>
      <dc:creator>vallamuthu_madheswaran2</dc:creator>
      <dc:date>2008-06-10T08:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974101#M949214</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;PRE&gt;&lt;CODE&gt;IF NOT i_dfkkko[] IS INITIAL .

SELECT opbel
              belnr
   FROM erchc
     INTO *CORRESPONDING FIELDS OF* TABLE i_erchc1
FOR ALL ENTRIES IN i_dfkkko
*WHERE opbel = i_dfkkko-xblnr.*

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please reward points if it helps&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:23:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974101#M949214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974102#M949215</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;OPBEL and XBLNR both have different lengths. So FOR ALL ENRIES will fail .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974102#M949215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974103#M949216</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;I tried using 'corresponding fields of' ,that is also not working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974103#M949216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974104#M949217</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;I have defined i_dfkkko like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF ty_dfkkko,&lt;/P&gt;&lt;P&gt;        opbel LIKE dfkkko-opbel,&lt;/P&gt;&lt;P&gt;        xblnr(12),&lt;/P&gt;&lt;P&gt;        herkf LIKE dfkkko-herkf,&lt;/P&gt;&lt;P&gt;        budat LIKE dfkkko-budat,&lt;/P&gt;&lt;P&gt;        END OF ty_dfkkko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974104#M949217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974105#M949218</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;  The fields XBLNR and OPBEL or not having same length, please check once. Try to change the field declaration in temp internal table for field XBLNR and move i_dfkkko values to temparary table then use for all entries addition on temp table and also check the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT belnr&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LFDNR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OPBEL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FROM erchc&lt;/P&gt;&lt;P&gt;INTO TABLE i_erchc1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_dfkkko&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE opbel = i_dfkkko-xblnr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ever you want to use for all entries addition then try to retrieve all primary keys, because the for all entries addition would work like select and delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:39:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974105#M949218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974106#M949219</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;The database would be having the value with leading zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM "CONVERSION_EXIT_ALPHA_INPUT" to conver the values &amp;amp; then pass to select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;_dfkkko-xblnr

IF NOT i_dfkkko[] IS INITIAL .

loop at i_dfkkko.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
VALUE(INPUT) = i_dfkkko-xblnr
IMPORITNG
VALUE(OUTPUT) = i_dfkkko-xblnr.
modify i_dfkkko.
endloop.


SELECT opbel
belnr
FROM erchc
INTO TABLE i_erchc1
FOR ALL ENTRIES IN i_dfkkko
WHERE opbel EQ i_dfkkko-xblnr.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:40:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974106#M949219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974107#M949220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have deleted the leading zeroes,but still the same problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 08:58:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query/m-p/3974107#M949220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T08:58:14Z</dc:date>
    </item>
  </channel>
</rss>

