Every accounting document posted in SAP involves two codes: a document type and, on each line, a posting key. Both are unavoidable if you want to read SAP accounting, and both are common stumbling blocks early on.
Document types
A document type is a two-character code describing what kind of transaction the document represents โ a vendor invoice, a customer payment, a plain transfer posting. Reading the document type tells you where a document came from.
It is more than a label. The document type determines the number range used, controls which account types may be posted to, and governs whether reference fields are required. It configures how the document behaves.
| Code | Use | Typically posted from |
|---|---|---|
| SA | G/L transfer posting | FI (manual) |
| AB | General document, any account type | FI |
| KR | Vendor invoice | FI-AP (FB60) |
| KZ | Vendor payment | FI-AP (F-53, F110) |
| KG | Vendor credit memo | FI-AP |
| DR | Customer invoice | FI-AR (FB70) |
| DZ | Customer payment | FI-AR (F-28) |
| DG | Customer credit memo | FI-AR |
| RE | Vendor invoice via invoice verification | MM (MIRO) |
| RV | Billing document | SD (VF01) |
| AA | Asset acquisition or retirement | FI-AA |
| AF | Depreciation posting | FI-AA (depreciation run) |
Note that an MM invoice verification posts as RE rather than KR, and an SD billing document posts as RV rather than DR. Separating document types by originating module means you can tell which business process created an obligation from the document type alone.
Number ranges
Each document type is assigned a number range, and documents are numbered within it at posting time. Ranges can be maintained per fiscal year or continue across years.
A document number alone does not identify an accounting document. You need company code, fiscal year and document number together, because the same number can exist in different company codes. That is why document display (FB03) asks for all three.
Posting keys
A posting key is a two-digit number that decides, for a single line item, both whether it is a debit or a credit and which account type it posts to. It applies per line, unlike the document type, which is one value in the header.
| Key | Side | Account type | Typical use |
|---|---|---|---|
| 40 | Debit | G/L | Recording an expense, increasing an asset |
| 50 | Credit | G/L | Recording revenue, increasing a liability |
| 21 | Debit | Vendor | Paying a vendor, reducing payables |
| 31 | Credit | Vendor | Recording a vendor invoice |
| 01 | Debit | Customer | Recording a customer invoice |
| 15 | Credit | Customer | Receiving payment, reducing receivables |
| 70 | Debit | Asset | Acquiring an asset |
| 75 | Credit | Asset | Retiring or selling an asset |
Posting keys also drive field display
Beyond debit/credit and account type, a posting key influences which fields appear on the line item entry screen. Combined with the field status group on the G/L account master, it determines what ends up required, optional or suppressed.
When someone asks why a cost centre is optional when it was meant to be mandatory, the answer lies in one or both of those settings. Note too that the more restrictive of the two wins.
Modern entry screens hide the posting key
In the so-called enjoy transactions โ FB50 for G/L documents, FB60 for vendor invoices โ you never type a posting key. You pick debit or credit from a dropdown and SAP assigns the appropriate key behind the scenes.
Posting keys still matter because the older entry screens such as F-02 remain in use, and because displaying a posted document in FB03 shows the posting key on every line. Reading documents requires knowing what they mean.