<?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: Syntax error in WHERE clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374597#M1040824</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;Take some common key in both the internal tables and then put for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr u got from lfai table and objectid field from cdhdr table, both are having different data elements assigned to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What u wrote is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to find out some common key betwwen those two table, if u don't find u can not use for all entries statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kusuma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2008 06:01:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-26T06:01:35Z</dc:date>
    <item>
      <title>Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374591#M1040818</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;see the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab type cdhdr occurs 0,&lt;/P&gt;&lt;P&gt;        wa type cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;         lifnr like lfa1-lifnr,&lt;/P&gt;&lt;P&gt;          ktokk like lfa1-ktokk,&lt;/P&gt;&lt;P&gt;        end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from cdhdr into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr ktokk from lfa1 into table itab1&lt;/P&gt;&lt;P&gt;    for all entries in itab&lt;/P&gt;&lt;P&gt;      where lifnr = itab-objectid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i go for Syntax check i am getting Error like  " when using the addition for all entries in itab " the fields  LIFNR and ITAB-OBJECTID  must have the same type and lengh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, i have done the following correction in WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr ktokk from lfa1 into table itab1&lt;/P&gt;&lt;P&gt;    for all entries in itab&lt;/P&gt;&lt;P&gt;      where lifnr = itab-objectid(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this time i am geting warning in German language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my correction is correct or not ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls guide me ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Krupali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 05:52:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374591#M1040818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T05:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374592#M1040819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;       The simplest way is to create a itab explicitly . i.e. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types :  BEGIN OF t_cdpos,&lt;/P&gt;&lt;P&gt;        objectclas TYPE cdpos-objectclas,&lt;/P&gt;&lt;P&gt;        objectid(10) TYPE c,&lt;/P&gt;&lt;P&gt;        changenr  TYPE cdpos-changenr,&lt;/P&gt;&lt;P&gt;        fname     TYPE cdpos-fname,&lt;/P&gt;&lt;P&gt;        value_new TYPE cdpos-value_new,&lt;/P&gt;&lt;P&gt;        END OF t_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type table of t_cdpos,&lt;/P&gt;&lt;P&gt;         wa like line of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use this in your select query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 05:55:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374592#M1040819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T05:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374593#M1040820</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 think you better go on and check the content of both of your internal tables. If they are okey, then you may ignore the warning message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 05:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374593#M1040820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T05:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374594#M1040821</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;CDHDR-OBJECTID is of length 90.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can move above value to a char10 field and compare the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anversha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 05:58:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374594#M1040821</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2008-08-26T05:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374595#M1040822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select lifnr ktokk from lfa1 into table itab1
for all entries in itab
where lifnr = itab-objectid(10).

But this time i am geting warning in German language.

my correction is correct or not ?&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answer is your correction is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we cannot use offset with for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do this way first take the itab-objectid(10) in some other field like temp than fire for all entries on temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select lifnr ktokk from lfa1 into table itab1
for all entries in itab
where lifnr = itab-temp."&amp;lt;-- see here&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Amit Gujargoud on Aug 26, 2008 8:00 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 05:58:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374595#M1040822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T05:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374596#M1040823</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;Take some common key in both the internal tables and then put for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr u got from lfai table and objectid field from cdhdr table, both are having different data elements assigned to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What u wrote is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to find out some common key betwwen those two table, if u don't find u can not use for all entries statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kusuma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:00:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374596#M1040823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374597#M1040824</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;Take some common key in both the internal tables and then put for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lifnr u got from lfai table and objectid field from cdhdr table, both are having different data elements assigned to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What u wrote is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to find out some common key betwwen those two table, if u don't find u can not use for all entries statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kusuma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:01:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374597#M1040824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374598#M1040825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare internal table with CDHDR table fields but instead of OBJECTID this declare with char10 as like lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Ignore warining message your query should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374598#M1040825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374599#M1040826</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;for all entries, comparision fields (lifnr and itab-OBJECTID) should be the same type and length. other wise, system will give you syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better to define types (structure (program) with the structure CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of type_CDHDR,&lt;/P&gt;&lt;P&gt;           OBJECTID type LIFNR,&lt;/P&gt;&lt;P&gt;            ....&lt;/P&gt;&lt;P&gt;           end of type_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: table_cdhdr type standard table of type_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should work fine now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had the same problem erlier, and solved with this solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:06:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374599#M1040826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374600#M1040827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: itab type cdhdr occurs 0,
wa type cdhdr.
data: begin of itab2 occurs 0,
objectid like lfa1-lifnr,
end of itab2.

data: begin of itab1 occurs 0,
lifnr like lfa1-lifnr,
ktokk like lfa1-ktokk,
end of itab1.

data: begin of itab2 occurs 0,
objectid like lfa1-lifnr,
end of itab2.

select * from cdhdr into table itab.

loop at itab.
  itab2-objectid = itab-objectid(10).
  append itab2.
endloop.

select lifnr ktokk from lfa1 into table itab1
for all entries in itab2
where lifnr = itab2-objectid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:37:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374600#M1040827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in WHERE clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374601#M1040828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ITAB TYPE CDHDR OCCURS 0,
WA TYPE CDHDR.

DATA: BEGIN OF ITAB1 OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
KTOKK LIKE LFA1-KTOKK,
END OF ITAB1.

SELECT * FROM CDHDR INTO TABLE ITAB.

SELECT LIFNR KTOKK FROM LFA1 INTO TABLE ITAB1
FOR ALL ENTRIES IN ITAB
WHERE LIFNR = ITAB-OBJECTID+0(10).

 IF SY-SUBRC = 0.
   WRITE :  'dATA fOUND'.
 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try above code it's working fine... Change the where condition as above and ignore the warnings...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will solve your problem..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;ilesh 24x7&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 06:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-in-where-clause/m-p/4374601#M1040828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-26T06:56:18Z</dc:date>
    </item>
  </channel>
</rss>

