Application Development 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: 

can we use for all entries along with case statement in new open sql 7.4

sriram_korlepara
Participant
0 Kudos

Hello Everyone,

When I tried to use case ..endcase and for all entries it throws an error saying " The addition or variable with ID "xxx" is not allowed in conjunction with FOR ALL ENTRIES." i want to develop this using new open sql 7.4 syntax.

sample code :

select counter,

case when raufnr = ' ' then

case when rnplnr = ' ' then ' ' else rnplnr end

else

raufnr
END AS proj_number

FROM catsdb
INTO TABLE @lt_cats
FOR ALL ENTRIES IN @lt_refcounters
WHERE counter = @lt_refcounters-refcounter.

can some body let me know what the issue is.Thanks...

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

I don't understand why the error message is about "xxx" as it does not appear in your Open SQL statement

horst_keller
Product and Topic Expert
Product and Topic Expert

0 Kudos

Hi All,

Looks like when for all entries used you can't perform any operations on fields of select query. I got same error " The addition or variable with ID "%_#D711" is not allowed in conjunction with FOR ALL ENTRIES."

sample code

select ( netwr * -1) as neg_netwr

from vbap

into corresponding fields of table lt_vbap

for all entries in @lt_vbak

where vbeln = @lt_vbak-vbeln

Precisely, when for all entries used, we can't perform any operations on fields of query. Is my statement valid?

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

See the documentation for ALL ENTRIES mentioned above. There is a list with all restrictions.