<?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 in the select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774067#M1118810</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 like this..&lt;/P&gt;&lt;P&gt;Please check if the table used in FOR ALL ENTRIES is initial or not....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF T_plpo[] IS NOT INITIAL.
  SELECT
  WERKS ARBPL KTSCH VERWE OBJTY OBJID
  FROM CRHD
  INTO TABLE T_CRHD
  FOR ALL ENTRIES IN T_plpo
  WHERE
  OBJID = T_plpo-ARBID.
ENDIF.

IF T_CRHD[] IS NOT INITIAL.
  SELECT
  KTEXT_UP OBJID
  FROM CRTX
  INTO TABLE T_CRTX
  FOR ALL ENTRIES IN T_CRHD
  WHERE
  OBJID = T_CRHD-OBJID.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sukriti Saha on Nov 4, 2008 10:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 04:28:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-04T04:28:53Z</dc:date>
    <item>
      <title>Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774066#M1118809</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 am working on a code in which the duplicate values are getting repeated where there is no field and i came to know that it is bcoz of  FOR ALL ENTIRES in the select statement. When i want to change the code it is not allowing me to change by giving error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here's d code;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;    WERKS ARBPL KTSCH VERWE OBJTY OBJID&lt;/P&gt;&lt;P&gt;    FROM CRHD&lt;/P&gt;&lt;P&gt;    INTO TABLE T_CRHD&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN T_plpo&lt;/P&gt;&lt;P&gt;    WHERE&lt;/P&gt;&lt;P&gt;    OBJID = T_plpo-ARBID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;     KTEXT_UP OBJID&lt;/P&gt;&lt;P&gt;     FROM CRTX&lt;/P&gt;&lt;P&gt;     INTO TABLE T_CRTX&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN T_CRHD&lt;/P&gt;&lt;P&gt;     WHERE&lt;/P&gt;&lt;P&gt;     OBJID = T_CRHD-OBJID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of for all entires i want to write the statement.&lt;/P&gt;&lt;P&gt;plzz  provide me guidelines for solving the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774066#M1118809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T04:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774067#M1118810</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 like this..&lt;/P&gt;&lt;P&gt;Please check if the table used in FOR ALL ENTRIES is initial or not....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF T_plpo[] IS NOT INITIAL.
  SELECT
  WERKS ARBPL KTSCH VERWE OBJTY OBJID
  FROM CRHD
  INTO TABLE T_CRHD
  FOR ALL ENTRIES IN T_plpo
  WHERE
  OBJID = T_plpo-ARBID.
ENDIF.

IF T_CRHD[] IS NOT INITIAL.
  SELECT
  KTEXT_UP OBJID
  FROM CRTX
  INTO TABLE T_CRTX
  FOR ALL ENTRIES IN T_CRHD
  WHERE
  OBJID = T_CRHD-OBJID.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sukriti Saha on Nov 4, 2008 10:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774067#M1118810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T04:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774068#M1118811</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;try like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if T_plpo[] is not initial. " it will check if t_plpo has any values or not...
SELECT
WERKS ARBPL KTSCH VERWE OBJTY OBJID
FROM CRHD
INTO TABLE T_CRHD
FOR ALL ENTRIES IN T_plpo
WHERE
OBJID = T_plpo-ARBID.
endif.

IF T_CRHD[] IS NOT INITIAL.
SELECT
KTEXT_UP OBJID
FROM CRTX
INTO TABLE T_CRTX
FOR ALL ENTRIES IN T_CRHD
WHERE
OBJID = T_CRHD-OBJID.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Debarshi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:28:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774068#M1118811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T04:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774069#M1118812</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;First check your internal table is initial or not....&lt;/P&gt;&lt;P&gt;if your using FOR ALL ENTIRES in your select query.. then  you have to check this condition..... is internal table is initial only your select will work.... or else you will get error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774069#M1118812</guid>
      <dc:creator>raja_narayanan2</dc:creator>
      <dc:date>2008-11-04T04:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774070#M1118813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If u do not want to use FOR ALL ENTRIES write the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT WERKS ARBPL KTSCH VERWE OBJTY OBJID&lt;/P&gt;&lt;P&gt;FROM CRHD&lt;/P&gt;&lt;P&gt;INTO TABLE T_CRHD&lt;/P&gt;&lt;P&gt;WHERE OBJID = T_plpo-ARBID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KTEXT_UP OBJID&lt;/P&gt;&lt;P&gt;FROM CRTX&lt;/P&gt;&lt;P&gt;INTO TABLE T_CRTX&lt;/P&gt;&lt;P&gt;WHERE OBJID = T_CRHD-OBJID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case u still get any error please give the error details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774070#M1118813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T04:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in the select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774071#M1118814</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;U can use like this:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;WERKS ARBPL KTSCH VERWE OBJTY OBJID&lt;/P&gt;&lt;P&gt;FROM CRHD&lt;/P&gt;&lt;P&gt;INTO TABLE T_CRHD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at T_plpo&lt;/P&gt;&lt;P&gt;l_index = sy-tabix.&lt;/P&gt;&lt;P&gt;Read table  T_CRHD with key OBJID = T_plpo-ARBID.&lt;/P&gt;&lt;P&gt;If sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;DELETE  T_plpo index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same for the second one...............&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Ruchi Tiwari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 04:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-the-select-query/m-p/4774071#M1118814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T04:39:35Z</dc:date>
    </item>
  </channel>
</rss>

