Section 3 of 10

Document Types & Posting Keys

What document types control and how number ranges work, plus how posting keys determine the debit/credit side and the account type of each line.

Open contents

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.

Standard document types you will meet
CodeUseTypically posted from
SAG/L transfer postingFI (manual)
ABGeneral document, any account typeFI
KRVendor invoiceFI-AP (FB60)
KZVendor paymentFI-AP (F-53, F110)
KGVendor credit memoFI-AP
DRCustomer invoiceFI-AR (FB70)
DZCustomer paymentFI-AR (F-28)
DGCustomer credit memoFI-AR
REVendor invoice via invoice verificationMM (MIRO)
RVBilling documentSD (VF01)
AAAsset acquisition or retirementFI-AA
AFDepreciation postingFI-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.

The posting keys worth knowing
KeySideAccount typeTypical use
40DebitG/LRecording an expense, increasing an asset
50CreditG/LRecording revenue, increasing a liability
21DebitVendorPaying a vendor, reducing payables
31CreditVendorRecording a vendor invoice
01DebitCustomerRecording a customer invoice
15CreditCustomerReceiving payment, reducing receivables
70DebitAssetAcquiring an asset
75CreditAssetRetiring 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.

๐Ÿ“– Unfamiliar term? Look it up in the SAP glossary.

Check your understanding

Test what you just read.

Quiz 1

Which standard document type represents a Vendor Payment?

Quiz 2

A posting key controls not only the debit/credit indicator but also which account type (G/L, vendor, customer, etc.) can be used on that line item.

Quiz 3

Which posting key is used for a debit posting to a G/L account?

Quiz 4

Which standard document type represents a Customer Invoice?

Quiz 5

A Document Type controls not only the business transaction category but also the number range used for document numbering.

Quiz 6

Which posting key is used for a vendor account credit posting when recording a vendor invoice (FB60)?