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

Inner Join

Former Member
0 Likes
394

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

2 REPLIES 2
Read only

Former Member
0 Likes
362

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

Read only

mohammed_moqeeth
Active Participant
0 Likes
362

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>