Sub topic 2
Where Sales Links Are Stored: Table VBFA
Assume basic SAP GUI navigation, SD/MM/FI concepts, document headers and items, and simple ABAP SELECT syntax. A document flow is a chain of references between related business documents.
Sales Links in VBFA
For sales processes, SAP stores many predecessor and successor relationships in VBFA, the sales document flow table. Each row links one document item to another document item.
| Field | Meaning |
|---|---|
| `VBELV` / `POSNV` | Preceding document and item |
| `VBELN` / `POSNN` | Subsequent document and item |
| `VBTYP_N` | Category of the subsequent document |
The document category helps distinguish orders, deliveries, billing documents, and other follow-on documents. Always inspect both document numbers and item numbers. One order item can have several deliveries or invoices.
DATA lv_order TYPE vbeln_va VALUE '0000004711'.
SELECT vbelv, posnv, vbeln, posnn, vbtyp_n
FROM vbfa
WHERE vbelv = @lv_order
INTO TABLE @DATA(lt_followers).Following Order to Cash
In the SAP GUI, display the sales order and choose the document-flow function. A typical order-to-cash chain is:
VBFA normally covers the SD links through delivery and billing. The billing document points to the FI accounting document through accounting references. The incoming payment is an FI document and may be related through clearing data rather than another VBFA row. Missing payment in the sales flow does not necessarily mean the invoice is unpaid or the flow is broken.
Purchase Order History and EKBE
For purchasing, the main item history is in EKBE. It records events related to a purchase order item, including goods receipts, invoice receipts, and subsequent debits or credits. The VGABE value identifies the event category.
DATA lv_po TYPE ebeln VALUE '4500000123'.
SELECT ebeln, ebelp, vgabe, gjahr, belnr, buzei, menge
FROM ekbe
WHERE ebeln = @lv_po
ORDER BY ebelp, vgabe, gjahr, belnr, buzei
INTO TABLE @DATA(lt_history).Following Procure to Pay
A procure-to-pay chain usually starts with a purchase order, continues with a material document for goods receipt, and ends with an invoice receipt. The accounting document created by invoice verification can then be traced in FI. Compare quantities and item numbers because partial receipts, reversals, and multiple invoices create several history rows.
Exercise
Which table should you inspect first to find goods receipts and invoice receipts for a purchase order?
Show answer
Inspect EKBE, filtering by the purchase order number and item. Use VGABE and the document fields to distinguish the recorded events.