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: 

Link Between VBRK and VBFA

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

12 REPLIES 12

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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

Rob

Former Member
0 Kudos

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

Former Member
0 Kudos

Why you dont use the fm RV_ORDER_FLOW_INFORMATION to get that information

Former Member
0 Kudos

This message was moderated.

0 Kudos

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

0 Kudos

For BI you can create database view

Former Member
0 Kudos

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

0 Kudos

Hi Srikanth,

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

Thanks,

Robert