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

select statement

Former Member
0 Likes
621

HI,

While executing the select statement is showing syntax error,

anybody let me know the correct synatx.

SELECT exidv vpobjkey

FROM vekp

INTO TABLE lt_hu

FOR ALL ENTRIES IN lt_vbeln

WHERE vpobjkey+0(10) = lt_vbeln-vbeln.

thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
598

what sytax error u are getting ?

u cannt use Offset lengths in where clause.

Regards

Prabhu

Read only

Former Member
0 Likes
598

WHERE vpobjkey+0(10) = lt_vbeln-vbeln.

there´s the error.

you cannot check against a whole table.

you probably intended to code

WHERE vpobjkey+0(10) = wa_vbeln-vbeln.

where wa_vbeln-vbeln is a workarea of your table lt_vbeln-vbeln.

Read only

Former Member
0 Likes
598

SELECT exidv vpobjkey

FROM vekp

INTO TABLE lt_hu

FOR ALL ENTRIES IN lt_vbeln

WHERE <b>vpobjkey+0(10)</b> = lt_vbeln-vbeln.

U cant use <b>vpobjkey+0(10)</b> in where condition u have to use the cpmlete field name

Read only

Former Member
0 Likes
598

Which is the error...?

Read only

Former Member
0 Likes
598

Hi,

You should not use offset when using for all entries in where condition.

join VEKP and VEPO tables and use this VBELN in where condition.

if not lt_vbeln[] is initial.

SELECT aexidv bvbeln

FROM vekp as a join vepo as b

on aexidv = bexidv

INTO TABLE lt_hu

FOR ALL ENTRIES IN lt_vbeln

WHERE b~vbeln = lt_vbeln-vbeln.

endif.

reward points if useful

regards,

Anji