Application Development 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: 

Question about tables LIKP and VBRK

Former Member
0 Kudos

I am looking for a join, view, etc... between the tables LIKP (Sales header data) and VBRK (delivery header data). What we want is information from LIKP and one piece of information from VBRK for the corresponding shipment. From what I can tell, the only way to join these two tables is by going through tables LIPS (Sales items) and VBRP (delivery items). Does anybody know of an easier and quicker way? We will only look at this once or twice a year so creating a program for it is the last resort.

Regards,

Davis

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use joins between LIKP and lips on VBELN and VBRP and LIPS on VBRP-VGBEL = LIPS-VBELN and VBRP_VGPOS = LIPS-POSNR and join VBRK on VBRK-VBELN = VBRP-VBELN

or you can use VBFA to find the related billing doc for a Delivery by passing preceeding doc type = J and document = Delivery doc and subceeding doc type M. you will get the suceeding billing doc for that del document.

reward if useful

regards,

Anji

9 REPLIES 9

Former Member
0 Kudos

Hi,

Vbrp-vgbel = lips-vbeln

vbrp-vgpos = lips-posnr

Hope this helps

Caglar

Former Member
0 Kudos

LIKP-VBELN = VBRP-VGBEL.

LIPS-POSNR = VBRP-VGPOS.

Former Member
0 Kudos

Hi,

Use joins between LIKP and lips on VBELN and VBRP and LIPS on VBRP-VGBEL = LIPS-VBELN and VBRP_VGPOS = LIPS-POSNR and join VBRK on VBRK-VBELN = VBRP-VBELN

or you can use VBFA to find the related billing doc for a Delivery by passing preceeding doc type = J and document = Delivery doc and subceeding doc type M. you will get the suceeding billing doc for that del document.

reward if useful

regards,

Anji

0 Kudos

Caglar and Chandrasekhar, thanks for the input. I know the relationships but I wanted to get away from having to go through those two tables, thanks anyway.

Anji, it sounds like your solution is the best one but I have a hard time understanding it. Is there any way you can simplify it for me?

Regards,

Davis

0 Kudos

Hi

Please check the function 'RV_ORDER_FLOW_INFORMATION'



  CLEAR : gt_vbco6, gt_vbfatab[], gt_vbfatab.

  gt_vbco6-mandt = sy-mandt.
  gt_vbco6-vbeln = p_vbeln.

 CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
    EXPORTING
      comwa    = gt_vbco6
      n_stufen = '50'
      v_stufen = '50'
    TABLES
      vbfa_tab = gt_vbfatab.

LOOP AT gt_vbfatab WHERE vbtyp_n EQ 'J'
                     AND   vbtyp_v EQ 'M'.
ENDLOOP.

Hope this helps

Caglar

0 Kudos

Hi,

Can you please clarify me, because some doubt in your wording:

between the tables LIKP (Sales header data) and VBRK (delivery header data). What we want is information from LIKP and one piece of information from VBRK for the corresponding shipment.

LIKP -is delivery header data not sales Header data

VBRK - Billing header data not delivery header data

Do You need info from billing header(VBRK) or Shipment header table (VTTK)?

regards,

ANji

Message was edited by:

Anji Reddy Vangala

0 Kudos

Anji, I applogize, I did mess up the wording a bit.

You are correct in that I need information from LIKP and one piece of information from VBRK for the corresponding shipment.

Regards,

Davis

0 Kudos

Caglar, thanks for the tip, I'll look into that now.

Regards,

Davis

0 Kudos

Anji, thanks for your first post. I finally had a chance to sit down and read it and it made sense to me. I've never used a join like that before so it has taught me a lot.

Thanks again,

Davis.