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 stmt error

Former Member
0 Likes
531

hi

plz rectify the error,

there is some prob with my inner join select stmt which i am unable to identify

here is the code.

tables: lfa1, ekko,

select-options: vend for lfa1-lifnr.

data: begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

ebeln like ekko-ebeln,

end of itab.

select lfa1lifnr lfa1name1 lfa1land1 ekkoebeln into table itab from lfa1 inner join ekko on lfa1lifnr = ekkoebeln where lfa1~lifnr in vend.

loop at itab.

write: itab.

endloop.

4 REPLIES 4
Read only

Former Member
0 Likes
497

Hi!

Try like this:


select lfa1~lifnr lfa1~name1 lfa1~land1 ekko~ebeln 
  into table itab 
  from lfa1 inner join ekko on lfa1~lifnr = ekko~lifnr   "ekko~lifnr
  where lfa1~lifnr in vend.

Regards

Tamá

Read only

0 Likes
497

hi tamas,

thanx for the response.

actually it was type mistake , i am having prob with the one which had provided

Read only

Former Member
0 Likes
497

Hi,

you need match lifnr in your select query not PO number (lfa1lifnr = ekkolifnr ), it should be like this

tables: lfa1, ekko,

select-options: vend for lfa1-lifnr.

data: begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

ebeln like ekko-ebeln,

end of itab.

select lfa1lifnr lfa1name1 lfa1land1 ekkoebeln into table itab from lfa1 inner join ekko on lfa1lifnr = ekkolifnr where lfa1~lifnr in vend.

loop at itab.

write: itab.

endloop.

Regards

MM

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
497

Hi

Whenever you are writing the select query on joins are tables first note down that

fields order in the select query must match with the Internal table fields declarations otherwise simply use the <b>corresponding fields of table</b> in your query.

Your query is going wrong because of these reason only.

Regards,

Sreeram