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

Help

Former Member
0 Likes
1,120

Hi all,

i had fetched data into an internal table from VBRK, with this vbeln how can i link with the tables LIKP and VBAK and get the corresponding delivery and sales document number???

Points will be rewarded!!!

Regards,

Priya.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,086

Hi

U should find the link in VBRP table:

- VBRP-VGBEL = Delivery number

- VBRP-VGPOS = Delivery Item number

- VBRP-AUBEL = Sales order number

- VBRP-AUPOS = Sales order item

U can use VBFA table but I believe to read VBRP (VBRP-VBELN = VBRK-VBELN) is faster than to read VBFA.

Max

7 REPLIES 7
Read only

Former Member
0 Likes
1,086

Hi Priya,

Query on VBFA(Document flow) table to get the Sales document and Delivery number for the Invoice.

Give the Invoice no(VBRK_VBELN) to VBFA-VBELN then it will give the Sales order and Delivery no to VBFA-VBELV field.

To get the Sales Order Specify VBFA-VBTYP_V = 'C'

To get the Delivery no Specify VBFA-VBTYP_V = 'J'

Thanks,

Vinay

Read only

0 Likes
1,086

hi vinay,

i knew the same 2...but my doubt is.. in VBFA for a billing document number u will get atleast 2 vbelv's so on what condition do i decide that one is Delivery no. and the other sales order i.e programmatically

Read only

0 Likes
1,086

Hi Priya,

Give the Invoice no(VBRK_VBELN) to VBFA-VBELN then it will give the Sales order and Delivery no to VBFA-VBELV field.

To get the Sales Order Specify VBFA-VBTYP_V = 'C'

To get the Delivery no Specify VBFA-VBTYP_V = 'J'

Thanks,

Vinay

Read only

Former Member
0 Likes
1,087

Hi

U should find the link in VBRP table:

- VBRP-VGBEL = Delivery number

- VBRP-VGPOS = Delivery Item number

- VBRP-AUBEL = Sales order number

- VBRP-AUPOS = Sales order item

U can use VBFA table but I believe to read VBRP (VBRP-VBELN = VBRK-VBELN) is faster than to read VBFA.

Max

Read only

Former Member
0 Likes
1,086

Hi,

1) SALES ORDER

VBRP-AUBEL = VBAK-VBELN

VBRP-AUPOS = VBAP-POSNR

2) DELIVERY NUMBER

VBRP-VGBEL = LIKP-VBELN

VBRP-VGPOS = LIPS-POSNR.

Thanks,

Naren

Read only

Former Member
0 Likes
1,086

Hi Priya,

You can also use this FM to get subsequence document flow.

RV_FLOW

RV_ORDER_FLOW_INFORMATION

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,086

Hi,

Billing document can be linked to Sales Document through VBRP - Billing Item table.

<b>Step1</b> Get the Billing Item details from VBRP for all the billing documents from VBRK.

<b>Step2</b> Get the Sales document details from VBAP/VBAK by linking

<b>AUBEL - Sales Document

AUPOS</b> - Sales item

from VBRP to VBAP. Thus you can get Sales Document.

<b>Step3</b> Delivery details can be obtained from LIKP by relating LIPS-VGBEL to VBAP-VBELN and LIPS-VGPOS to VBAP_POSNR.

<b>Step4</b> Once you get the Delivery details, delivery document can be read either from LIKP or LIPS.

I hope this solves your problem.

Regards,

Vara