Sub topic 5
Creating and understanding the sales order
This chapter assumes you know the organizational units (sales organization, distribution channel, division), the customer and material master records, and basic SAP navigation. It covers what a sales order contains and how to read one.
What the sales order does
The sales order is the customer's binding request, recorded in SAP. It is the first document in the process that drives later steps. Delivery, billing and pricing all copy data from it. Pricing, the availability check and the credit check also run while you save it.
You create an order in transaction VA01 or in the Fiori app "Create Sales Orders". You enter an order type, such as OR for a standard order, plus the sales area. Then you enter the sold-to party, a purchase order reference, and the materials and quantities.
Header and item structure
An order has two levels, and each level has its own data.
| Level | Table | Typical content |
|---|---|---|
| Header | VBAK | Order type, sold-to party, sales area, document currency, net value |
| Item | VBAP | Material, quantity, unit, item category, net value |
| Schedule line | VBEP | Requested and confirmed delivery date and quantity |
Header data applies to all items unless an item overrides it. Examples are payment terms and the ship-to party.
Item categories and schedule lines
The item category controls how SAP treats an item. For example, TAN is a standard item that is delivered and billed. TAD is a service item that is billed but not delivered. The item category determines whether the item is relevant for delivery, billing and pricing.
Each item has at least one schedule line. A schedule line holds a delivery date and a quantity. If stock covers only part of the request, the availability check can split the item into several schedule lines with different dates.
What happens when you save
Pricing determines the net value, the availability check sets confirmed dates, and the credit check can block the order. The next chapters explain each of these.
Reading the order in the database
The tables show what the screen hides. This query reads the header and items of one order.
DATA(lv_vbeln) = CONV vbeln_va( '0000012345' ).
SELECT h~vbeln, h~auart, h~kunnr,
i~posnr, i~matnr, i~kwmeng, i~vrkme, i~netwr
FROM vbak AS h
INNER JOIN vbap AS i ON i~vbeln = h~vbeln
WHERE h~vbeln = @lv_vbeln
INTO TABLE @DATA(lt_items).Each row in lt_items is one item. The header columns repeat on every row because of the join. AUART is the order type, KUNNR is the sold-to party, KWMENG is the order quantity, and NETWR is the item net value.
Common errors
- Missing sales area data: the customer or material is not extended to the sales area you entered. Maintain the sales view in the master data.
- No pricing found: no valid condition record exists for the date. The item shows a net value of zero or an incompletion message.
- Order saved with an incompletion log: required fields are empty. Complete them before you deliver.
- Delivery block on the header: a credit or manual block stops the follow-on delivery.
Exercise
A standard order has one item for 100 pieces. Stock covers 60 pieces now and 40 next week. Which structure holds the two dates and quantities, and in which table?
Show answer
The schedule lines hold them. The item has two schedule lines, one for 60 pieces with today's date and one for 40 pieces with next week's date, stored in table VBEP.