02-04-2011 12:30 PM
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....
02-04-2011 12:41 PM
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.
02-04-2011 12:41 PM
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.
02-04-2011 12:44 PM
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.
02-04-2011 12:52 PM
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.
02-05-2011 10:19 AM
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
02-04-2011 2:30 PM
If you simply do a where used in views for both tables, you'll have your answer.
Rob
02-04-2011 4:39 PM
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
02-04-2011 9:23 PM
Why you dont use the fm RV_ORDER_FLOW_INFORMATION to get that information
02-05-2011 6:08 AM
02-05-2011 6:29 AM
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
02-05-2011 8:13 AM
02-05-2011 12:00 PM
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
02-07-2011 4:36 PM
Hi Srikanth,
Please read all the replies and then decide if your reply is adding any new information.
Thanks,
Robert