‎2007 Jul 03 4:20 AM
Hi,
I need to join two tables VBEP and LIPS using fields VBELN , POSNR in VBEP and
VGBEL and VGPOS from LIPS
Help me to sort out the problem.
Regards,
Vimal
‎2007 Jul 03 5:17 AM
Hi,
Select <fldfrom_vbep_and_lips>
into table itab
from vbep
inner join vbap on vbep-vbeln = vbap-vbeln and vbepposnr = vbap-posnr
inner join lips on vbap-vbeln = lips-vgbel and vbap-posnr = lips-vgpos
where <condition>.For this create a itab with same as filed list and type.
Jogdand M B
‎2007 Jul 03 5:24 AM
Hello Vimal,
<b><u>Please find the below code to join VBEP & LIPS:</u></b>
Hi Vimal,
Please find the below code for joining VBEP & LIPS:
<b>TABLES: vbep, lips.</b>
DATA: BEGIN OF itab OCCURS 0,
vbeln TYPE vbeln,
posnr TYPE posnr,
vgbel TYPE vgbel,
vgpos TYPE vgpos,
END OF itab.
SELECT-OPTIONS: s_vbeln FOR vbep-vbeln.
SELECT vbep~vbeln
vbep~posnr
lips~vgbel
lips~vgpos
INTO CORRESPONDING FIELDS OF TABLE itab
<b>FROM vbep INNER JOIN lips</b>
ON vbepvbeln = lipsvbeln AND
vbepposnr = lipsposnr
WHERE vbep~vbeln IN s_vbeln.
LOOP AT itab.
WRITE:/ itab-vbeln,
itab-posnr,
itab-vgbel,
itab-vgpos.
ENDLOOP.
<b>
Reward Points..for all helpful answers.
Moqeeth.</b>