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

Link Between VBRK and VBFA

Former Member
0 Likes
4,727

Dear Gurus,

Here I got some Requirement where I am getting all the Deliveries but the User wants only Invoiced Deliveries. For achieving the same what should I do?

Suggest Me if I am analyzing correct r wrong.

Get the INVOICE DETAILS from VBRK, for the corresponding Values get the PRECEDING DOC NO from VBFA Table with VBTYP_N = "m".

Am I doing correct????

Ur Inputs are Valued....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,998

No, read SAP Note 185530 for correct document index table to read for invoice documents (these include VRKPA, VRPMA...read the Note!). Once you have the list of invoices, get the preceding document from VBRP, probably in AUBEL....Look at content of VBRP fields:

VBELV

POSNV

VGBEL

VGPOS

VGTYP

AUBEL

AUPOS

AUREF

Nobody should write reporting for SD/LE without first reading the referenced SAP Note. And, we never read VBFA backward, only forward. The preceding document(s) are stored in VBRP, LIPS and VBAP.

Dear Gurus,

Here I got some Requirement where I am getting all the Deliveries but the User wants only Invoiced Deliveries. For achieving the same what should I do?

Suggest Me if I am analyzing correct r wrong.

Get the INVOICE DETAILS from VBRK, for the corresponding Values get the PRECEDING DOC NO from VBFA Table with VBTYP_N = "m".

Am I doing correct????

Ur Inputs are Valued....

12 REPLIES 12
Read only

Former Member
0 Likes
2,999

No, read SAP Note 185530 for correct document index table to read for invoice documents (these include VRKPA, VRPMA...read the Note!). Once you have the list of invoices, get the preceding document from VBRP, probably in AUBEL....Look at content of VBRP fields:

VBELV

POSNV

VGBEL

VGPOS

VGTYP

AUBEL

AUPOS

AUREF

Nobody should write reporting for SD/LE without first reading the referenced SAP Note. And, we never read VBFA backward, only forward. The preceding document(s) are stored in VBRP, LIPS and VBAP.

Read only

0 Likes
2,998

Break Point,

Thanks for Quick Reply....

can i make a View for the above scenario, as itz going to be input for SAP BI.

Plz help Me.

Read only

0 Likes
2,998

View? We can make views are needed....my installation doesn't run SD, so not sure what is there but look at where VBRP / VBRK is used...you may find an existing view. And, one could join to VRKPA or VRPMA but note the differences in documents....one has only billing docs, other refers to billing doc and item, as I recall....

Do you where used on your tables, selecting only Views....you'll find several views already existing, and I'd check those to see if there's something already created that I could use, if I were writing SD/LE reporting/extracts, etc.

Read only

0 Likes
2,998

Hello

As Juan mentioned already the fm which delivers this information is RV_ORDER_FLOW_INFORMATION.

Since this fm allows to read the document flow backwards and forwards I do not think that the statement

>

And, we never read VBFA backward, only forward. ...

is correct. However, if you start with an invoice and read forwards the fm still returns the corresponding delivery.

Regards

Uwe

Read only

Former Member
0 Likes
2,998

If you simply do a where used in views for both tables, you'll have your answer.

Rob

Read only

Former Member
0 Likes
2,998

Hi Harsha,

Since per your requirements you only need to show the invoiced deliveries, you can also check table VBUK using the delivery number and check the billing status field (FKSTK) to find out if an invoice was created for the delivery or not.

KInd regards,

Robert

Read only

Former Member
0 Likes
2,998

Why you dont use the fm RV_ORDER_FLOW_INFORMATION to get that information

Read only

Former Member
0 Likes
2,998

This message was moderated.

Read only

0 Likes
2,998

Hi Harsha,

As per your requirement and my as per my understanding you do not need the details from VBFA.

As you are getting all the deliveries, check the status of the delivery in VBUK whether it has been invoiced.

If Invoiced, then display the Delivery,

For a better understanding you can view the delivery in VL03n Transaction and see the status of the delivery at the header level.

You will need the VBFA details only if you need the corresponding Invoice for a delivery which I think is not part of your requirement.

Thanks,

Rohan

Read only

0 Likes
2,998

For BI you can create database view

Read only

Former Member
0 Likes
2,998

Hi Harsha,

As Rohan mentioned use VBUK table for invoice status.

First get all sales order from seelction crietaria as per user requirements from VBAK then get all deleiveries for the sales orders from LIKP and then check in VBUK for invloce status .I think that is best way to improve performace.

If you get the invoices first , query will get all invoices which are unneccesary and need to elimate based on your sales orders or deliveries.

Hope it is usful.

Thanks,

Srikanth.A

Read only

0 Likes
2,998

Hi Srikanth,

Please read all the replies and then decide if your reply is adding any new information.

Thanks,

Robert