‎2007 May 16 1:59 AM
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
‎2007 May 16 5:17 AM
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,
‎2007 May 16 2:12 AM
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 conditionIn 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
‎2007 May 16 5:17 AM
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,