Sub topic 12
How SD postings reach accounting
This chapter assumes you know the SD steps from sales order to billing and the basics of debits and credits. It also assumes you have seen the Universal Journal table ACDOCA mentioned before. It explains how two SD events, post goods issue and billing, create accounting documents without anyone entering them. It also covers how SAP chooses the G/L accounts and what to do when it can't.
Two SD events that post to accounting
Most SD steps change no ledger. Sales orders, deliveries and picking have no financial effect. Only two steps in the standard flow do:
| SD event | Accounting effect | Typical posting |
|---|---|---|
| Post goods issue (movement type 601) | Inventory leaves the books and cost of goods sold is recognized | Debit cost of goods sold, credit inventory |
| Billing document release | Receivable and revenue are recognized | Debit customer receivable, credit revenue, credit output tax |
Each posting is created in the same database transaction as the SD document that triggers it. Goods issue creates a material document and an accounting document together. If the accounting part fails, the goods issue fails too. Billing works differently, as described later in this chapter.
The goods issue posting
When you post goods issue for a standard delivery, SAP uses movement type 601. The movement type tells the system which transaction keys to use. For a normal sale, two keys matter:
- BSX is the inventory posting. It credits the stock account.
- GBB is the offsetting posting for goods issues. With the general modification key VAX it debits cost of goods sold for a delivery without a sales order account assignment.
The system finds the actual G/L accounts from the material's valuation class (on the Accounting tab of the material master), the valuation grouping code, and the chart of accounts. This setup is configured in transaction OBYC. Valuation depends on the plant, so two plants can post the same material to different accounts.
The amount is not the sales price. It is the material's inventory value at the time of issue, which is the moving average price or the standard price, depending on the price control. This is why cost of goods sold can differ from what you expected: the cost comes from the material valuation, not from the pricing conditions in the sales order.
The billing posting
The billing document is the trigger for the revenue side. When you save it, SAP builds a posting from the billing items and their pricing conditions:
- The customer line is a debit to the receivables account. The G/L account is not looked up in SD. It is the reconciliation account in the customer's company code data.
- The revenue lines are credits to revenue accounts, determined by SD account determination.
- The tax lines are credits to output tax accounts, based on the tax code found during pricing.
Account determination for revenue
Revenue accounts come from account determination for billing, maintained in transaction VKOA. It uses the same condition technique you saw in pricing. The condition type is KOFI, and its access sequence tries a list of key combinations from most specific to least specific. The fields in those keys are:
- Chart of accounts
- Sales organization
- Account assignment group of the customer. This is on the Billing tab of the customer's sales area data.
- Account assignment group of the material. This is on the Sales Org 2 tab of the material master.
- Account key
The account key links the pricing procedure to the G/L accounts. Each condition type in the pricing procedure carries an account key. Typical examples are ERL for revenue, ERS for sales deductions such as discounts, and MWS for output tax. Pricing condition PR00 maps to ERL, a customer discount maps to ERS, and the tax condition maps to MWS.
A common design is to put domestic and export customers into different account assignment groups. Each group then posts to its own revenue account, with no change to the sales order or billing.
When the posting fails
Billing and accounting are less tightly coupled than goods issue and accounting. If account determination fails, for example because no VKOA entry exists for a new combination of account assignment groups, the billing document is still saved. It receives a posting status of "not yet transferred" with a posting block. You can see this in the billing document's header data.
To fix it:
- Open the billing document and use the account determination analysis, found under the Environment menu in VF02/VF03. It shows which condition record was tried and which key was missing.
- Add the missing entry in VKOA.
- Release the document to accounting with VFX3, the list of billing documents blocked for accounting.
Verifying the postings
The accounting document refers back to the billing document through a reference type and a reference key. For a billing document the reference type (AWTYP) is VBRK. For goods issue it is typically MKPF. In S/4HANA the line items sit in ACDOCA, so you can query them directly. The query below returns the journal lines for one billing document in the leading ledger 0L:
DATA(lv_billing) = CONV vbeln_vf( '0090001234' ).
SELECT rbukrs, gjahr, belnr, docln, racct, hsl
FROM acdoca
WHERE rldnr = '0L'
AND awtyp = 'VBRK'
AND awref = @lv_billing
INTO TABLE @DATA(lt_journal).For a normal invoice you expect at least three kinds of lines: one on the reconciliation account (positive amount), one or more on revenue accounts (negative), and one on a tax account (negative). The signed amounts in hsl (amount in company code currency) should sum to zero within each document. If they don't sum to zero, you are probably looking at only part of the document, for example because you filtered by another field.
Run the same query with the goods issue's material document number and awtyp = 'MKPF' to see the COGS and inventory lines. The material document number is the vbeln of the goods issue entry in the document flow.
Common mistakes
- Looking for COGS at billing. In the standard flow, cost of goods sold is posted at goods issue. Billing posts only revenue, receivable and tax.
- Looking for revenue at delivery. Goods issue never posts revenue. Until billing, a shipped order has inventory out and COGS booked, but no receivable.
- Fixing the wrong table. A wrong revenue account is fixed in VKOA. A wrong inventory or COGS account is fixed in OBYC. The valuation class and the account assignment groups come from different master data.
- Ignoring the posting block. A billing document that was created successfully is not proof that accounting has it.
Exercise
A billing document for a new export customer is saved, but the customer account in FI shows no open item for it. The SD team confirms that pricing is correct. Name the most likely cause, the transaction where you would correct it, and the transaction that releases the document afterwards.
Show answer
The most likely cause is that revenue account determination failed, for example because VKOA has no entry for the export customer's account assignment group combined with the material's account assignment group and the account key. This leaves the billing document with a posting block, so no accounting document exists. Use the account determination analysis in the billing document to identify the missing key, add the entry in VKOA, and then release the document to accounting with VFX3.