10-23-2006 7:57 PM
I am trying to answer the following business questions by running sql against the base tables of SAP.
1) What is the total dollar value of all orders entered for a given month, i.e. the month of September?
2) What is the total dollar value of all orders cancelled for a given month, i.e. the month of September.
I was looking in the VBAK and VBAP tables and saw some date fields such as aedat (date record entered) and erdat (date record last changed) but these do not seem to correlate to the date an order was entered and only sometimes to when an order was cancelled.
Is it possible to answer the 2 business questions from any tables in SAP? If so, what is the sql query I would need to use?
10-23-2006 8:42 PM
Hi,
Every sales document contains the document date. (VBAK-AUDAT). select records from VBAK based on AUDAT.
If you want the total amount per sales document check NETWR from VBAK. If you want Items then check NETER from VBAP.
Regards,
Vamsi
10-23-2006 8:42 PM
Hi,
Every sales document contains the document date. (VBAK-AUDAT). select records from VBAK based on AUDAT.
If you want the total amount per sales document check NETWR from VBAK. If you want Items then check NETER from VBAP.
Regards,
Vamsi
10-23-2006 8:50 PM
HI,
It is a not a straight forward soltion for your requirement.
But you can get all the data from tables VBAK, VBAP, CDHDR & CDPOS.
Tables CDHDR & CDPOS contain the create/change history of the sales documents.
Thanks,
Ramakrishna
10-23-2006 10:48 PM
Hi there,
So based on your response are you saying that the document date in the VBAK table is date I should use to determine when an order is booked. But you also refer to the create/change history tables. Does this imply that an order can be booked on a certain day and then changed or "rebooked" on another day? Or does it mean instead the document date field is reflective of any number of changes made to the order header field , not just when the order was booked and I need the create/change history tables to determine exactly what was changed?
10-24-2006 5:08 PM
Hi Ramakrishna,
I have another question regarding the status of orders. Users of the SAP application make a distinction between when an order was entered in SAP and when it was confirmed. If the document date (AUDAT) field in the order header (VBAK) table indicates when the order was entered, where and how can I find the date the order was confirmed?
Regards,
Geraldine