cancel
Showing results for 
Search instead for 
Did you mean: 

Find keys to link table

hassimkhan
Explorer
0 Kudos

I need to link three table:

VBAK (order) -> VBFA (to take delivery)->LIPS (delivery item)

Can anyone write 2 SELECT statement to link these three table. I can't figure out the keys to link them in the WHEREstatement.

Help please!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Select VBELV, POSNV, VBELN, POSNN from VBFA into it_vbfa for all entries in IT_VBAK where VBELV = IT_VBAK-VBELN.

Select VBELN, POSNR from LIPS into it_LIPS for all entries in IT_VBFA where VBELN = IT_VBFA-VBELN.

Thanks,

Lalit

andrea_brusarestelletti
Active Contributor
0 Kudos

Hello,

read VBFA with:

VBELV = VBAK-VBELN

POSNV = VBAP-POSNR

VBTYP_V = 'C' (--> Order)

VBTYP_N = 'J' (--> Delivery)

obtain VBELN and POSNN (delivery number and item), and read with this data table LIPS.

Best regards,

Andrea