VBAP: Sales Document: Item Data
SDVBAP stores the items of sales documents: one row per item with the material, plant, short text, order quantity, net value and item category. Every row belongs to a header in VBAK with the same VBELN.
Primary key
VBELN + POSNR
plus the client field
Module
SD
Fields in this reference
9
How the VBAP key works
The primary key is MANDT, VBELN and POSNR. Item numbers have six digits and usually step in tens (000010, 000020), but never rely on the numbering being continuous.
VBAP fields
| Field | Type / data element | Length | Description |
|---|---|---|---|
| πMANDT | CLNT | 3 | Client |
| πVBELN | VBELN | 10 | Sales Document Number |
| πPOSNR | POSNR | 6 | Item Number |
| MATNR | MATNR | 18 | Material Number |
| WERKS | WERKS | 4 | Plant |
| ARKTX | ARKTX | 40 | Short text |
| KWMENG | KWMENG | 13 | Order Quantity (Sales) |
| NETWR | NETWR | 15 | Net Value |
| PSTYV | PSTYV | 4 | Item Category |
This is a curated subset of the most commonly used fields, not the complete table definition. A real system contains more fields and can differ by release and customizing, so confirm the definition in transaction SE11 before relying on it.
Example ABAP SELECT for VBAP
" Open SQL applies the client (MANDT) automatically, so it is not part of the WHERE clause. DATA lv_vbeln TYPE vbap-vbeln. SELECT posnr, matnr, werks, arktx FROM vbap WHERE vbeln = @lv_vbeln INTO TABLE @DATA(lt_vbap).
Modern Open SQL with host variables (ABAP 7.40 and later). Need a different field list or conditions? Build it in the ABAP SELECT Builder.
Tables related to VBAP
Practical tips for VBAP
- KWMENG is the order quantity in sales units, not in the base unit of measure.
- The item category PSTYV controls behaviour such as free-of-charge items, text items and returns.
- Select with VBELN only to read all items of an order, and add POSNR to read a single item.
- Rejected items keep their row and carry a rejection reason in ABGRU. Add ABGRU = space to the WHERE clause to list only the items that are still active.
- Sub-items, such as the components of a bill of materials, point to their higher-level item through UEPOS, so an order can contain items that are not part of the main numbering sequence.
VBAP FAQ
What is the primary key of VBAP?
MANDT, VBELN and POSNR: the sales document number and the item number.
How do I join VBAK and VBAP?
On VBELN. A join of VBAK to VBAP on vbap~vbeln = vbak~vbeln returns one row per order item with the header fields repeated on each row.
Keep exploring
- SAP Table Field Lookup: search all 28 tables and their fields.
- SAP BAPI Explorer: find the BAPI that creates or changes this data.
- CDS View Generator: expose these tables through a CDS view.