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!

Former Member
0 Likes
621

hi,

i got the synatx error for the following code!

select

vbak~vbeln

vbak~submi

vbak~bstdk

vbak~bstnk

vbap~vgpos

from vbak inner join vbap on vbakvbeln = vbapvbeln

into table lt_vbak

for all entries in lt_lips

where vbeln = lt_lips-vgbel

and vgpos = lt_lips-vgpos.

and i had declared internal table lt_vbak with the five fields as i had mentioned!

whats wrong with this code?

Raj

3 REPLIES 3
Read only

matt
Active Contributor
0 Likes
588

What did the syntax error message say?

matt

Read only

Former Member
0 Likes
588

When u use inner joins u need to specify the table in the where condition if the field exists in the both the tables. So put like this:

select

vbak~vbeln

vbak~submi

vbak~bstdk

vbak~bstnk

vbap~vgpos

from vbak inner join vbap on vbakvbeln = vbapvbeln

into table lt_vbak

for all entries in lt_lips

where vbak~vbeln = lt_lips-vgbel

and vbap~vgpos = lt_lips-vgpos.

Thanks,

Anon

Read only

Former Member
0 Likes
588

when you use inner join betweeen 2 tables, then in the where condition you need to specify from which table you want to retrieve the fields..