Account Determination and Automatic Postings
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
When a warehouse clerk books goods into stock, nobody types the stock account, the clearing account or the price difference account, yet the books receive all three lines. SAP calls these lines automatic postings, and the rules that pick the G/L account for each of them account determination. This page explains where the rules come from, how a goods movement in purchasing and inventory and a billing document in sales find their accounts, which other lines (tax, cash discount, exchange rate differences) the system adds by itself, and how to check a result. After reading it you can follow a posting from the business event to the G/L account and know which setting to look at when an account is wrong or missing. It is written against SAP S/4HANA 2025 FPS02 (on premise and Private Edition) and, where stated, SAP S/4HANA Cloud Public Edition 2608. The inventory and invoice verification parts rest on SAP Learning and SAP support content, which are older than the product help pages, so check each setting in your own release.
Before you read
-
Journal Entries, Document Types and Posting Keys: what a balanced accounting document and a posting key are.
-
Ledgers, Currencies and Exchange Rates: company code currency, exchange rate types and the ledgers
0Land2Lof Example Trading Co. -
Organizational Structures: plant, company code and chart of accounts.
Key terms
-
Automatic posting: a line the system adds to a document by itself, for example tax, a cash discount or an exchange rate difference.
-
Account determination: the rules that pick the G/L account for an automatic posting.
-
Transaction key: a three-character key such as
BSXthat names the kind of line in a goods movement or invoice, so that Customizing can assign an account to it. -
Valuation class: a setting in the accounting data of a material that groups materials which post to the same accounts.
-
Movement type: the three-digit key of a goods movement, such as 261 for a material issue to a production order.
-
GR/IR clearing account: the account that holds the value of goods received but not yet invoiced, or invoiced but not yet received.
-
Account key: a key assigned to a pricing condition type so that its amount posts to its own revenue or deduction account.
-
Condition technique: the search method that tries condition tables from the most specific to the most general until it finds a matching record.
-
Chart of accounts: the list of G/L accounts a company code uses.
-
Exchange rate difference: the gain or loss that arises when an amount in a foreign currency is booked or valued at different rates.
The running example: Example Trading Co.
Example Trading Co. has company code EX01. It keeps its books in euro (EUR), reports to a parent that consolidates in
British pounds (GBP), and posts to the leading ledger 0L and the non-leading ledger 2L. All amounts below are euro
amounts in the company code currency unless a line says otherwise. Account names are descriptive, not account numbers,
and quantities, prices, tax rates and exchange rates are illustrative values chosen for this site, not SAP defaults.
Every automatic line is part of the accounting document, so it is stored for each ledger and currency type like a typed
line (see the page on ledgers and currencies).
The idea: a key, not an account
A clerk who posts a goods receipt knows the material, the quantity and the plant. The accounting department knows which G/L accounts exist. Neither should have to meet at posting time. SAP solves this with an indirection. The business event carries keys (a movement type, a transaction key, an account key), and a table of Customizing connects those keys to G/L accounts once, for the whole company. The same event then always lands on the same accounts, and a change of account is a Customizing change, not a change to every posting.
Three families of automatic postings appear on this page:
-
Logistics postings from Materials Management (MM): goods movements in inventory management and invoices in invoice verification.
-
Sales postings from Sales and Distribution (SD): the lines of a billing document.
-
Financial Accounting (FI) postings that exist in any document: tax, cash discount and exchange rate differences.
SAP states for the last family that with certain transactions the system generates automatic postings, including input and output tax postings, exchange rate differences and cash discount gains and losses, and that each one is shown as a separate line item. For each you define the G/L account and the rules, for example a different tax account for each tax code. A line can be supplemented by hand if the Supplement auto. postings field is selected in the master record of the account it posts to, and the field status group of that account decides which fields are offered.
Goods movements: from movement type to G/L account
What decides the account
SAP Learning describes the principle for inventory management and invoice verification: accounting-relevant transactions post to G/L accounts that the system determines without user input, from a special Customizing table. Because the meaning of an account depends on the chart of accounts, account determination is set up separately for each chart, and the chart is assigned to each company code in Financial Accounting. Four things steer the choice:
| Influence | What it contributes |
|---|---|
Plant |
Determines the company code, the chart of accounts, the valuation area and the valuation grouping code, a key for differentiated account assignment per valuation area. |
Material |
Determines the material type and the valuation class, which is used for differentiated account assignment. |
Movement type |
Decides the posting specifications and which stock and value fields are updated, for example 261 for a material issue to a production order and 551 for scrapping. |
Transaction key |
Names the kind of line in the posting, for example the stock line or the clearing line. |
Different accounts can be assigned to different goods issue types, so production, scrapping and inventory differences can be reported separately in FI and in Controlling (CO).
Value strings and transaction keys
SAP S/4HANA predefines the posting for each accounting-relevant MM transaction as a value string, a general posting record that contains transaction keys and no G/L account numbers. This is what lets companies with different charts of accounts share the same logic. SAP Learning states that the value string assignments, and the keys inside a value string, cannot be changed. The keys named on the SAP Learning page are:
| Key | Use named by SAP Learning |
|---|---|
|
Stock posting for a valuated goods receipt against a purchase order item without account assignment. The system always posts to a stock account. |
|
GR/IR clearing account, the offsetting entry to the valuated goods receipt. |
|
Price difference posting, used when a material is valued at standard price and the purchase order or invoice price differs from it. |
|
Exchange rate differences on a foreign-currency purchase order, when the material account cannot be debited or credited because of standard price control or lack of stock. |
|
Purchase account and purchase offsetting account, in company codes with purchase account management. |
|
Subcontracting only: change in stock account, external services and incidental costs for external services. |
The same page names GBB and UMB only as examples inside a value string and does not describe them. Stoil Jotev’s book
describes GBB as the key for the offsetting entry of inventory postings, which is how a goods issue to a production
order can debit a consumption account while the stock account is credited. A free-of-charge delivery (movement type 511)
uses the value string WA14, and for a material with standard price control it produces a BSX stock line and a PRD
price difference line.
From goods movement to G/L account
The figure follows one posting. The business event selects a value string, the value string lists transaction keys, and
for each key the Customizing table is read with the chart of accounts, the valuation modifier, the general modifier and
the valuation class. SAP support content names exactly these fields as the key of the account table T030.
The figure shows that no step needs a typed account. The chart of accounts decides which table rows apply, the
valuation class separates, for example, raw materials from trading goods, and the transaction key separates the stock
line from the clearing line. Plant 1000 is an illustrative plant of EX01.
The tools that show and change the table
SAP support content for the error that reports a missing account (message M8147) names the places to look, in this
order: the account assignment simulation in transaction OMWB, then OX14 (is the valuation area the plant), OMWM
(is the valuation grouping code active), OMWD (valuation area linked to chart of accounts and grouping code), OMWN
(material type linked to account modifiers), OMSK (is the valuation class assigned correctly) and OBYC (is each
transaction key assigned to account numbers). It adds that a developer can compare the missing entry with table T030
through the function module MR_ACCOUNT_ASSIGNMENT. The SAP Learning page calls the same assignment activity Configure
Automatic Postings and describes its simulation: you enter a material number or a valuation class and an inventory
management or invoice verification transaction, and the simulation lists all influencing factors, checks that every
assigned account exists in the chart of accounts, and shows all transaction keys of the value string, including those
that are not relevant for the company code. Its Check Screen Layout button compares the field selection of a movement type
with the assigned accounts, for inventory management only.
Worked example: a purchase from goods receipt to invoice
Example Trading Co. orders 50 pieces of a trading good for EUR 8.00 each. The material is valued at a standard price of EUR 7.50. The three keys of the previous section appear in turn.
Goods receipt. The stock line is valued at the standard price, the clearing line at the order price, and the difference goes to the price difference account:
| Line | Transaction key | Debit EUR | Credit EUR |
|---|---|---|---|
Stock account of the valuation class |
|
375.00 |
|
Price difference account |
|
25.00 |
|
GR/IR clearing account |
|
400.00 |
|
Total |
400.00 |
400.00 |
Invoice receipt. The supplier invoices EUR 8.20 per piece, so the net amount is . With an illustrative input tax of 19 percent, the tax is and the gross amount is . The clearing line is reversed at the order value, the extra goes to the price difference account, and the vendor receives the gross amount:
| Line | Source | Debit EUR | Credit EUR |
|---|---|---|---|
GR/IR clearing account |
|
400.00 |
|
Price difference account |
|
10.00 |
|
Input tax account |
tax code of the invoice |
77.90 |
|
Vendor (reconciliation account of the supplier) |
vendor master |
487.90 |
|
Total |
487.90 |
487.90 |
Each table balances: on the debit side of the first, and \(400.00 + 10.00 + 77.90 =
487.90\) in the second. After both documents the GR/IR account is cleared for these 50 pieces: it was credited 400.00 and
debited 400.00. SAP’s description of the clearing account says the same in general terms: postings to one purchase
order item are updated but not cleared automatically; the open items are cleared by automatic clearing (F.13 or
F.13E), which groups them by purchase order and item and clears those that produce a zero balance; manual clearing of
these accounts is not possible, though they can be edited with MR11, Maintain GR/IR Clearing Account. Before a balance
sheet, an analysis program shows what is still open: a credit balance means goods received but not invoiced, a debit
balance means invoiced but not yet received.
This example requires an SAP system to reproduce; not run here. The lines follow the pattern that SAP Learning describes for a purchase order with a standard-price material, and the exact lines and accounts of your system depend on the Customizing in force.
Sales: from billing document to revenue account
The search
In Sales, the lines of a billing document are posted to FI when the billing document is transferred, and the system finds the accounts for each amount by the condition technique, the same method that finds prices. The SAP Help Portal lists the inputs of the search:
-
the chart of accounts of the company code;
-
the sales organization;
-
the account assignment group of the customer (the Account Group field of the customer master);
-
the account assignment group of the material (the Account Assignment Group field on the sales screen of the material master);
-
the account key, which comes from the pricing procedure;
-
further fields of the billing document header and item, such as company code, item category or tax code.
All billing types use an account determination procedure. The procedure contains an account determination type, also
called a condition type, for example KOFI, which is assigned to an access sequence of the same name. The access
sequence tries condition tables one after another, from the most specific to the most general, until a condition record
matches the billing document. SAP’s own example is a discounted item: the first access, which uses sales organization,
customer account group, material account group and account key, finds no record, the second, which leaves out the
material account group, finds one, and the discount posts to the sales deduction account in that record. Revenue account
determination covers the revenue accounts and the sales deduction accounts for surcharges and discounts.
The offsetting entry of a billing document goes to the customer account in the standard billing types. If you want it to
go to a G/L account instead, for example a cash clearing account, SAP says to assign the account key for cash allocation
EVV in the account determination procedure. Cash account determination and reconciliation account determination work by
the same technique, and if the condition technique cannot find a reconciliation account, the customer master decides. If
account determination fails, the billing data cannot be forwarded to FI, and the account determination analysis shows,
per billing item, the accounts of each condition type, the accesses made and their results, and the keys used. On premise
you start it in a billing document with Environment, Account determination analysis; in the Public Edition it is in the
Display Billing Documents app under More, Environment, Acct. Determ. Analysis.
Account keys and VKOA
An account key is attached to a condition type in the pricing procedure, so that a freight surcharge, for example, can
post to a freight revenue account and a packaging surcharge to a packaging revenue account. SAP support content for SAP
ERP lists keys that are commonly delivered: ERL sales revenues, ERS sales deductions, ERF freight revenue, ERB
rebate sales deductions, ERU accruals and MWS taxes on sales and purchases. That page is older, so confirm the keys
in your own system. The same support content names transaction VKOA as the place that assigns G/L accounts to
revenues (and, for revenue recognition, deferred revenues). SAP’s help pages name these on-premise Customizing activities instead of the transaction:
under Sales and Distribution, Basic Functions, Account Assignment/Costing, Revenue Account Determination, activities
for defining and assigning account determination procedures, and for Assign G/L Accounts. SAP also states that the
condition records are Customizing content, so changes belong in the quality system first and are then transported to
production.
Worked example: a billing document
Example Trading Co. bills a customer for goods at EUR 1,200.00 with a discount of EUR 200.00 and a freight charge of EUR
50.00. The pricing procedure gives the goods the account key ERL, the discount ERS and the freight ERF. Output tax
of an illustrative 19 percent applies to the net amount , so the tax is
and the customer owes .
| Line | Account key or source | Debit EUR | Credit EUR |
|---|---|---|---|
Customer (reconciliation account) |
billing type |
1,249.50 |
|
Sales deduction account (discount) |
|
200.00 |
|
Revenue account |
|
1,200.00 |
|
Freight revenue account |
|
50.00 |
|
Output tax account |
tax code |
199.50 |
|
Total |
1,449.50 |
1,449.50 |
The debits are and the credits . Which sales organization, customer group and material group select which record is Customizing of the company. This example requires an SAP system to reproduce; not run here.
Financial Accounting’s own automatic postings
Cash discount
When an invoice is paid within the discount period, the discount is a separate automatic line. Example Trading Co. owes a supplier EUR 1,000.00 and pays within the period with an illustrative 2 percent discount, so it pays . The vendor line is cleared in full and the system adds the gain:
| Line | Debit EUR | Credit EUR |
|---|---|---|
Vendor (reconciliation account) |
1,000.00 |
|
Bank account |
980.00 |
|
Cash discount gain account (automatic) |
20.00 |
|
Total |
1,000.00 |
1,000.00 |
Tax is ignored here to keep the lines visible. Where the account is tax relevant, the tax handling comes from the tax code of the invoice, and a cash discount loss on the customer side is the mirror image.
Realized exchange rate difference
Example Trading Co. receives a supplier invoice of USD 1,000.00. With the USD to EUR rate 0.80 of the ledgers page, the invoice is booked at EUR 800.00. At payment the illustrative rate is 0.82, so the payment costs \(1{,}000 \times 0.82 = 820.00\) euro. The vendor line clears at 800.00 and the system posts the difference:
| Line | Debit EUR | Credit EUR |
|---|---|---|
Vendor (open item of the invoice) |
800.00 |
|
Loss from exchange rate differences (automatic) |
20.00 |
|
Bank account |
820.00 |
|
Total |
820.00 |
820.00 |
SAP lists exchange rate differences among the automatic postings, with an account you define in Customizing. This example requires an SAP system to reproduce; not run here. The group currency amounts, translated at their own rates, are not shown.
Valuation of a foreign currency balance
A realized difference arises when an item is cleared. A valuation difference arises on a key date, with nothing cleared. For foreign currency balance sheet accounts SAP states that the balance in each foreign currency is valuated, the result is posted to the valuated account or to an adjustment account, and the profit or loss is posted against a separate expense or revenue account for exchange rate differences. Because only postings in the account currency are allowed on such an account, the difference is posted with a foreign currency amount of zero and a local currency amount equal to the difference. The expense and revenue accounts are defined in Prepare Automatic Postings for Foreign Currency Valuation, and an exchange rate key in the account master groups accounts, for example USD accounts apart from the rest. Take a USD account with a balance of 1,000.00 USD, booked at 0.80 (EUR 800.00) and valuated at an illustrative key date rate of 0.85, which gives EUR 850.00:
The account is debited by EUR 50.00, with USD 0.00, and the revenue account for exchange rate differences is credited by
EUR 50.00. The valuation run is the program FAGL_FCV (on the Easy Access menu under General Ledger, Periodic
Processing, Closing, Valuate, Foreign Currency Valuation (New)), and it can be reset or reversed. This example requires
an SAP system to reproduce; not run here.
Configuration paths
| Setting | On premise 2025 FPS02 (SPRO) | Public Edition 2608 |
|---|---|---|
Stock, clearing and price difference accounts |
Materials Management, Valuation and Account Assignment, Account Determination, activity Configure Automatic Postings
(transaction |
The SAP pages read for this page do not describe the Public Edition inventory settings; search the configuration environment by the topic name. |
Revenue accounts |
Sales and Distribution, Basic Functions, Account Assignment/Costing, Revenue Account Determination: define and assign
account determination procedures, define account keys, assign G/L accounts ( |
Configuration activities Define Account Assignment Groups for Materials and for Customers, Define Access Sequences for Revenue Account Determination, Define Account Determination Types, Define Account Keys and the condition table activities; records are created in Automatic Account Determination. |
Tax, cash discount and exchange rate difference accounts |
Financial Accounting Customizing; the exact activity is not read from a page for this release. |
Search the configuration environment by the topic name. |
Valuation of foreign currency balances |
General Ledger Accounting, Periodic Processing, Valuate, Foreign Currency Valuation, Prepare Automatic Postings for Foreign Currency Valuation. |
Not described on the page read. |
Requires an SAP system; not run here. Always open an activity by its name with the search of the Implementation Guide or of the configuration environment.
Common errors and pitfalls
| Symptom | Where to look |
|---|---|
Message M8147, account determination for an entry not possible |
Run the simulation in |
A billing document cannot be forwarded to FI |
Run the account determination analysis in the billing document and check the condition record for the combination of account key, sales organization and account groups. |
Stock goes to a different account after a master data change |
The valuation class is part of the key of the account table, so changing the valuation class of a material can lead to a different G/L account. Change it only when you are sure that the open goods receipts and invoice receipts are settled. |
GR/IR items stay open |
Postings are cleared only by automatic clearing; check purchase order number and item, and use |
The same chart of accounts is assumed everywhere |
Account determination is per chart of accounts. Two company codes with different charts need separate entries. |
What older books show, and what has changed
Stoil Jotev’s Configuring SAP S/4HANA Finance (3rd edition, 2025), section 5.3, explains that every logistics flow ends
in finance and that table ACDOCA collects all postings. It shows FBKP as the single entry to most automatic posting
settings and OBYC for Materials Management, with the criteria valuation modifier, general modifier and valuation class,
and treats automatic sales postings with the pricing procedure in a later chapter. Andrew Okungbowa’s SAP S/4HANA
Financial Accounting Configuration (2nd edition, 2023), chapter 13, covers the integration of FI with MM using the
valuation class, the BSX and WRX keys, and the integration of FI with SD and revenue account determination. Both
teach the on-premise Implementation Guide screens. They are outdated for the Public Edition, where these settings are
configuration activities of SAP Central Business Configuration and, for revenue account determination, a list of
activities and an app instead of VKOA and the Implementation Guide. Where the books and the help pages differ, the help
pages win.
Summary
-
An automatic posting is a line the system adds itself. Its account is found from keys, not typed: a movement type, a transaction key or an account key.
-
In Materials Management a movement type selects a value string of transaction keys; the account follows from the chart of accounts, the valuation grouping code, the account modifier and the valuation class of the material.
-
A purchase of 50 pieces at EUR 8.00 for a standard price of EUR 7.50 debits stock 375.00 and the price difference 25.00 and credits GR/IR 400.00; the invoice clears GR/IR and books the extra 10.00 as price difference.
-
In Sales the billing document finds revenue, deduction and freight accounts by the condition technique, with the account key of the pricing condition and the account groups of customer and material.
-
Tax, cash discount and exchange rate differences are automatic lines with accounts defined in Customizing, and a valuation difference is posted with a foreign currency amount of zero.
-
When an account is missing or wrong, simulate first:
OMWBfor goods movements, the account determination analysis for billing documents.
Try it
To do this by hand, follow the guide Follow a Purchase and a Sale through the Ledger: it follows a purchase and a sale from goods receipt and invoice to payment and clearing.
References
-
Setting Up Account Determination for Specific Transactions (SAP Learning)
-
Adjusting Further Customizing Settings in Invoice Verification (SAP Learning)
-
Error M8147 - Account Determination for entry not possible (SAP Help Portal, support content)
-
Performing an Account Determination Analysis (SAP Help Portal, on premise)
-
Revenue Account Determination (SAP Help Portal, Public Edition)
-
ERP SD Account Determination (SAP Help Portal, support content)
-
ERP SD Revenue Recognition (SAP Help Portal, support content)
-
Valuating Foreign Currency Balance Sheet Accounts (SAP Help Portal, on premise)
-
SAP S/4HANA Financial Accounting Configuration, Andrew Okungbowa, 2nd edition, Apress 2023
-
Configuring SAP S/4HANA Finance, Stoil Jotev, 3rd edition, SAP PRESS 2025