Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Syntax error in where condition.

Former Member
0 Likes
378

hi all,

I amd upgrading SAP from 3.1I to ECC 5.0.

I am getting syntax error in ECC 5.0 for the statement---

SELECT * FROM CDPOS

INTO CORRESPONDING FIELDS OF TABLE ITAB_CDPOS

FOR ALL ENTRIES IN ITAB_CHANGES

WHERE OBJECTCLAS EQ ITAB_CHANGES-CDOBJCL AND

OBJECTID EQ ITAB_CHANGES-CDOBJID AND

CHANGENR EQ ITAB_CHANGES-CDCHGNO AND

TABNAME EQ ITAB_CHANGES-TABNAME AND

TABKEY EQ ITAB_CHANGES-TABKEY AND

FNAME EQ ITAB_CHANGES-FLDNAME AND

CHNGIND EQ ITAB_CHANGES-CDCHGID.

In the above statement(in ECC 5.0)

CDPOS-TABKEY is 70 char and ITAB_CHANGES-TABKEY is 254 char(ITAB_CHANGES is of type BDCPV) .

but in 3.1I BDCPV-TABKEY is 70 char.

It is giving syntax error that, both TABKEYs must have same type and same length.

can anyone suggest how to correct the statement?

thanks

Rakesh

2 REPLIES 2
Read only

Former Member
0 Likes
324

Hi,

If you are using FOR ALL ENTRIES the column you are using should be of the same data type as the database column..

In this case the TABKEY in the internal table should be of the data type CDPOS-TABKEY..

Change the data type..It will work..

Thanks,

Naren

Message was edited by: Narendran Muthukumaran

Read only

rahulkavuri
Active Contributor
0 Likes
324

I have worked on a similar kind of upgradation, they have to be of equal length if u need to compare them