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

innerjoin ON eina and eine

Former Member
0 Likes
3,847

Hi all ,

i need to do a inner join on eina and eine table to pull lifnr,matnr,infnr,ekorg and werks.

how to write a innerjoin for this.

thanks,

deepthi.n

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,981

SELECT

a~infrn

a~matnr

a~lifnr

b~ekorg

b~werks

INTO TABLE ITAB1

FROM

eina AS a

INNER JOIN

eine AS b

on ainfnr = binfnr " This is Inner Join condition

WHERE " Some where conditions ifyou wish to add.

hope this helps

regards,

2 REPLIES 2
Read only

former_member214288
Participant
0 Likes
1,981

Say you have an internal table as below -

DATA: BEGIN of tb_purinfo OCCURS 0,
         infnr type eina-infnr,
         matnr type eina-matnr,
         lifnr type eina-lifnr,
         ekorg type eine-ekorg,
	 werks type eine-werks,
      END of tb_purinfo.

Then your query would be -

SELECT a~infrn a~matnr a~lifnr b~ekorg b~werks
INTO TABLE tb_purinfo
FROM eina AS a
INNER JOIN eine AS b on a~infnr = b~infnr
WHERE a~infnr = some restricting condition

In the above query, eina is represented as 'a' and eine is represented as 'b' and then both of them are joined.

Let me know if I can be of further assistance & reward points if this is helpful.

Regards,

Ram

Read only

Former Member
0 Likes
1,982

SELECT

a~infrn

a~matnr

a~lifnr

b~ekorg

b~werks

INTO TABLE ITAB1

FROM

eina AS a

INNER JOIN

eine AS b

on ainfnr = binfnr " This is Inner Join condition

WHERE " Some where conditions ifyou wish to add.

hope this helps

regards,