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

VBFA Access

Former Member
0 Likes
703

Hi all,

Can someone please let me know how to read the values from VBFA table, say for example if I have Sales Order Number and I want to know how to get Delivery and Billing number or say if I have Billing number I need to get the Delivery and Sales Order Number.

Thanks

Reshma

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
645

Hi Reshma

In VBFA you've the fields VBELV (preceding doc number) POSNV (preceding item number) and VBELN (subsequent doc) and POSNN (subsequent item).

Now Delivery comes right after the Sales Order.

So


SELECT VBELN POSNN FROM vbfa
WHERE VBELV EQ <your sales doc>
AND VBTYP_N EQ 'J'           " J is for delivery document type
INTO ....

Pushpraj

4 REPLIES 4
Read only

Former Member
0 Likes
646

Hi Reshma

In VBFA you've the fields VBELV (preceding doc number) POSNV (preceding item number) and VBELN (subsequent doc) and POSNN (subsequent item).

Now Delivery comes right after the Sales Order.

So


SELECT VBELN POSNN FROM vbfa
WHERE VBELV EQ <your sales doc>
AND VBTYP_N EQ 'J'           " J is for delivery document type
INTO ....

Pushpraj

Read only

Former Member
0 Likes
645

Hi...

From VBAK got o VBAP.

To get delivery data using LIPS-VGBEL = VBAP-VBELN and LIPS-VGPOS = VBAP-POSNR

To get billing data LIPS-VBELN =VBRP-VGBEL and LIPS-POSNR= VBRP-VGPOS

From VBRP get data from VBRK.

and to get divivery and saled data using billing navigate bottom to top of above steps.

Regards,

KP.

Read only

Former Member
0 Likes
645

hi,

for ur requirement ucan use 2 methods by joing vbap,likp and vbrp tables join conditions should be LIPS-VGBEL = VBAP-VBELN and LIPS-VGPOS = VBAP-POSNR & LIPS-VBELN =VBRP-VGBEL and LIPS-POSNR= VBRP-VGPOS

other wise u can use flow document table vbfa it store all document flows.

regds:

rajesh.k

Read only

Former Member
0 Likes
645

>

> Hi all,

>

> 1.if I have Sales Order Number and I want to know how to get Delivery and Billing number.

>2. say if I have Billing number I need to get the Delivery and Sales Order Number.

> Thanks

> Reshma

For Point 1:Prefer VBFA ie U have preceeding number (say SO ,delivery) & u want subsequent number (delivery r bill no) .Press F4 on these fields on vbtyp_v (for preceeding doc type) & vbtyp_n (succeeding)

For Point 2:Prefer VBRP or LIPS If u have subsequent number & u want preceeding number

Cheers