eInvoice Posting for SAP
1 · What it does
eInvoice Posting for SAP books incoming e-invoices in SAP GUI. You choose an XRechnung, a ZUGFeRD or Factur-X PDF or a Peppol invoice. The tool shows the invoice in readable form, checks it, finds the company code and the vendor, and proposes a complete vendor document: header, vendor line, an account assignment for every invoice line and the tax lines. You check the proposal, fill in missing assignments, have SAP simulate the document, and park or post it. Finally the tool stores the original file at the document.
The tool learns with every invoice. An assignment you set by hand once is proposed again next time for the same line of the same supplier. With assignment rules you decide how certain lines are always assigned. For a recurring invoice such as the monthly electricity bill, the work then comes down to uploading, checking and parking.
eInvoice Posting for SAP is the third stage of the eInvoice Viewer for SAP and contains it in full:
| Stage | Content |
|---|---|
| eInvoice Viewer for SAP | Shows the e-invoice in readable form |
| eInvoice Viewer for SAP with Checks | Adds the inbound check, the outbound check and the identifier check |
| eInvoice Posting for SAP | Adds the posting tool this manual describes |
The tool follows these principles:
- SAP decides. The proposal is made in the display, but only what SAP checks is binding. Before any document is created, SAP compares the proposal with the values it reads from the invoice itself and simulates the document.
- Only SAP's standard ways. Documents are created through function modules of the SAP standard. There is no modification, no enhancement and no BAdI.
- Nothing leaves the house. The display runs entirely in the HTML window of SAP GUI on the workstation and calls no address on the internet.
- One package. Everything lies in a single abapGit package, the display included.
screenshots/posting-uebersicht.en.pngThe posting tool with the invoice on the left and the posting proposal on the right2 · Requirements
| What | Requirement |
|---|---|
| SAP system | SAP ECC 6.0 on basis 7.40 SP05 or later, or S/4HANA on-premise |
| Financial accounting | Vendors, G/L accounts and, where you assign cost centres, controlling |
| Archive | A content repository for ArchiveLink to store the original files in |
| abapGit | The report ZABAPGIT in the system. If you do not want abapGit in the system permanently, install the standalone version ZABAPGIT_STANDALONE just for the installation and delete it afterwards. The installation guide of abapGit describes how. |
| Workstation | SAP GUI for Windows 7.70 or later with the browser control “Edge (based on Chromium)” |
| Authorisation | Creating a package and importing objects into the development system |
Important: The display does not start with the older browser control “Internet Explorer”. Set the control in SAP GUI under Options → Interaction Design → Control Settings → Browser Control.
The tool books invoices without a purchase order in financial accounting. Invoices for purchase orders still belong in logistics invoice verification ( MIRO ); chapter 10 describes what the tool does with a purchase order number.
3 · Installation
After your purchase you receive the file einvoice-posting-for-sap-abapgit.zip for abapGit. Do not unpack it; abapGit reads it as it is.
New installation
Upgrading from the viewer
If the eInvoice Viewer for SAP or the viewer with checks is already in your system, pull Posting into the same abapGit repository:
A second repository in another package would not work, because the viewer's objects already belong to a package. The menu entry “Display e-invoice” and your settings in STVARV keep working as before after the upgrade.
What the package contains
| Object | Kind | Purpose |
|---|---|---|
ZSPE_EPOST | Transaction | The posting tool |
ZSPE_EPOST_LOG | Report | The log with “Display document” and “File again” |
ZSPE_EPOST_BUK | Table | Settings per company code |
ZSPE_EPOST_TAX | Table | Tax mapping |
ZSPE_EPOST_RULE | Table | Assignment rules |
ZSPE_EPOST_HIST | Table | Learned assignments |
ZSPE_EPOST_LOG | Table | Log of every run |
ZCL_SPE_EPOST_* | Classes | The logic of the tool |
ZSPE_EVIEWER, ZCL_SPE_EVIEWER_* | Report and classes | The eInvoice Viewer for SAP |
ZSPE_EVIEWER_APP | MIME object | The display |
4 · Setup
The setup has eight steps. Most of them you do once per system; the settings and the tax mapping once per company code.
Document type for storage
The tool stores every processed file at the accounting document. This needs an ArchiveLink document type.
Tip: If you already use the viewer and maintain the selection option ZSPE_EVIEWER_DOC_IN in STVARV, you can skip this step. Without an entry in AR_OBJECT, the tool takes the first value of that selection option. “Display e-invoice” then finds the stored file at once.
Maintenance dialogs
SAP generates the SM30 maintenance dialogs itself; they are therefore not in the package.
The log ZSPE_EPOST_LOG gets no dialog. It cannot be changed, only viewed with the report of the same name.
Number range of the rules
In SNRO, object ZSPE_EPRUL, under “Number ranges”, create interval 01 from 000001 to 999999. Without an interval the tool assigns the next rule number itself; that is safe as long as only one person creates rules at a time.
Settings per company code
In SM30, create one row in ZSPE_EPOST_BUK for each company code in which you post. Without a row, the defaults in the right-hand column apply. An empty field for document type, posting date, text source or learning period also means the default.
| Field | Meaning | Default |
|---|---|---|
BLART_INV | Document type for invoices | KR |
BLART_CRE | Document type for credit notes | KG |
BUDAT_RULE | Posting date: T today, D document date | T |
TAX_TOL | Allowed tax difference per tax code, in document currency | 0.02 |
RND_ACCT | G/L account for a rounding amount in the invoice | empty; an invoice with a rounding amount then cannot be posted |
ZLSPR_IBAN | Payment block when the invoice names an unknown IBAN | R |
ZLSPR_PREPAID | Payment block when the invoice shows a prepayment | empty |
ALLOW_PO | Allow posting although the invoice carries a purchase order number | no |
CONDENSE | Condense lines with the same assignment into one G/L line | yes |
TEXT_SRC | Source of the line text: I invoice line, R rule, H header text | I |
BT133_USE | How to read an accounting reference in the invoice: empty none, K cost centre, S G/L account, A internal order, M pattern | empty |
BT133_MASK | The pattern for BT133_USE = M, for example {SAKNR}/{KOSTL} | empty |
LEARN | Remember assignments you set by hand for the next document | yes |
LEARN_DAYS | After how many days without use a remembered assignment is no longer proposed | 730 |
KTOKK | Account group for vendor creation from the tool | empty |
AR_OBJECT | ArchiveLink document type for storage | the first value of ZSPE_EVIEWER_DOC_IN |
AR_ATTACH | Also store the attachments of an invoice as separate documents | no |
Tax mapping
In SM30, maintain in ZSPE_EPOST_TAX per company code which input tax code belongs to which combination of tax category and tax rate in the invoice. Chapter 9 explains how the tool handles tax and shows example rows for Germany.
Settings in STVARV
All entries are optional.
| Variable | Kind | Content | Effect |
|---|---|---|---|
ZSPE_EPOST_MAXSIZE | Parameter | Number in megabytes | Largest file the tool accepts; 20 MB without an entry |
ZSPE_EPOST_PARKMODE | Parameter | FM or BI | How documents are parked, see chapter 13; FM without an entry |
ZSPE_EVIEWER_KIT | Parameter | sap-horizon | SAP Horizon design; SAP Quartz without an entry |
ZSPE_EVIEWER_DARK | Parameter | X | Dark design |
To create a parameter:
Authorisations
The tool introduces no authorisation object of its own. It checks the objects of the SAP standard that your accounting roles maintain anyway. Add these values to the users' roles:
| Object | Value | For |
|---|---|---|
S_TCODE | ZSPE_EPOST | Starting the tool |
F_BKPF_BUK | Activity 03 | Seeing the value lists of the company code |
F_BKPF_BUK | Activity 77 | Button “Park” |
F_BKPF_BUK | Activity 01 | Additionally button “Post” |
F_BKPF_BLA, F_BKPF_KOA, F_BKPF_GSB | as usual in your accounting | SAP checks them itself when the document is created |
F_LFA1_APP ( SAP ECC ) or B_BUPA_RLT ( S/4HANA ) | Activity 01 | Button “Create vendor” |
S_TABU_NAM | Activity 02, table ZSPE_EPOST_RULE | Creating rules from the tool and maintaining them in SM30 |
You separate entry from approval like this: the people who enter documents get activity 77 only and park; the people who approve post the parked document in FBV0. If a user has neither 77 nor 01, the tool only displays the invoice and the proposal and says in one sentence why nothing can be posted.
On the workstation
On the first start the tool places the display once in the temporary folder of SAP GUI. If SAP GUI asks for permission for this folder, grant it permanently.
5 · The screen
You start the tool with transaction ZSPE_EPOST. It opens in full screen, because assigning accounts needs room.
screenshots/posting-aufbau.en.pngThe areas of the posting tool| Area | Content |
|---|---|
| Top bar | Title, the company code to switch, the file name, “Next invoice” and “Close” |
| Vendor bar | The vendor found with the feature it was found by, the result of the bank check and a payment block |
| Check bar | The number of errors, warnings and notes with the button “Details” |
| Left half | The invoice as the viewer shows it, with its attachments and the checks |
| Right half | The document header, the row “For all selected lines”, the line table, the sum bar and the tabs “Lines”, “Document preview” and “Messages” |
| Bottom bar | “Check”, “Park” and “Post” |
You can move the divider between the two halves with the mouse. The tool remembers the split for your workstation.
The line table
Every invoice line is a row, and so is every allowance ( such as a discount ) and every charge ( such as freight ) on the whole invoice. The columns are item, text, net amount, tax rate, G/L account, cost centre, internal order, WBS element, profit centre and tax code. A letter at the end of every row shows where the assignment comes from:
| Letter | Origin |
|---|---|
| I | from the invoice itself ( chapter 7 ) |
| R | from an assignment rule |
| L | learned from an earlier posting |
| S | the vendor's default |
| M | set by hand |
Move the mouse over the letter to see the rule number or the source. An empty G/L account and an empty tax code are highlighted in yellow. A field for which SAP reported an error in the simulation has a red border; the message appears when you move the mouse over it.
The table shows invoices with several thousand lines without delay, because it draws only the visible rows. With “Group” you order the rows by tax rate, by assignment or by origin; each group shows its sum. A click on a row jumps to the same line in the invoice on the left.
The sum bar
Below the table are the net amount, the tax, the vendor amount and the difference. A document is only possible when the difference is 0.00.
The document preview
The tab “Document preview” shows the document as it will be created: per row the posting key, account, assignment, tax code and the amount on the debit or credit side. For an invoice the vendor is on the credit side, expense and input tax on the debit side; for a credit note it is the other way round.
screenshots/posting-belegvorschau.en.pngThe document preview of an electricity bill6 · Posting an invoice
Note: Any change after the check switches “Park” and “Post” off again. That way a state SAP has not seen is never posted. When parking or posting, SAP checks the document once more in full anyway.
Keyboard
| Key | Effect |
|---|---|
| Tab, Shift+Tab | to the next or previous field |
| F4 | opens the value list of a field, as in SAP |
| Enter | takes the highlighted value of the value list |
For G/L account, cost centre and tax code, the value list shows matching entries while you type. You enter internal order, WBS element and profit centre freely; SAP checks them in the simulation.
7 · Where the assignment comes from
For every row the tool looks for an assignment in this order. Each source fills only what is still empty; the letter in the table shows the first source that filled something.
A pattern for BT133_USE = M describes the layout of the reference. {SAKNR}/{KOSTL} reads “470000/1000” as account 470000 and cost centre 1000. Possible are {SAKNR}, {KOSTL}, {AUFNR} and {POSID} with any separators between them.
8 · Assignment rules and learned assignments
Creating a rule in the tool
The rule applies at once to the next invoice. In SM30 you can view, change, delete or create every rule in ZSPE_EPOST_RULE; all conditions are available there.
What a rule checks
| Condition | Comparison |
|---|---|
| Company code | always |
| Vendor | empty means: for all vendors |
| Seller's article number ( BT-155 ) | exact |
| Standard identifier of the item ( BT-157, for example a GTIN ) | exact |
| Item classification ( BT-158, for example an eCl@ss or UNSPSC class ) | exact |
| Item text ( BT-153 ) | pattern with * for any characters, case does not matter |
| Tax category and tax rate | exact, if given |
A rule sets G/L account, cost centre, internal order, WBS element, tax code, line text and assignment. An empty result field overwrites nothing.
Which rule wins
If several rules match, the most precise one always wins, in this fixed order:
A rule that names only the vendor and no further condition is not a rule in the sense of this list but the vendor's default. It only applies when neither another rule nor a learned assignment matches.
Typical rules
| Supplier | Condition | Result |
|---|---|---|
| Municipal utility | vendor only | account electricity, cost centre administration |
| Municipal utility | text Arbeitspreis* | account electricity, cost centre production |
| all | eCl@ss class office supplies | account office supplies |
| all | text *Porto* | account postage |
| Phone company | vendor only | account telephone, cost centre administration |
| Software house | article number of the licence | account software, assignment “Licence” |
Examples
The monthly electricity bill. The municipal utility sends an XRechnung every month with an energy charge and a standing charge. The first time, the tool finds the vendor by its VAT ID but knows no assignment. You select both lines, set account and cost centre, and save a rule “vendor only”. From the next month on, everything is filled in.
Office supplies with forty lines. Your office supplier sends a ZUGFeRD invoice with forty lines at 19 % and three books at 7 %, all with the eCl@ss class of office supplies. One rule without a vendor on that class sets the account for all 43 rows. You set the cost centre with “For all selected lines”. With condensing switched on, two expense lines are created, one per tax rate.
Learned assignments
After every parking or posting, the tool remembers the assignment of every row you set or changed by hand. Next time it recognises the line by the seller's article number, otherwise by the standard identifier, otherwise by its text without digits, dates and month names. “Strom Oktober 2026” and “Strom November 2026” therefore count as the same line.
- A learned assignment takes precedence over the vendor's default, but not over a rule.
- A new posting of the same line replaces the learned assignment.
- What has not been used for more than
LEARN_DAYSdays is no longer proposed. - With
LEARNempty, the tool learns nothing in this company code. - In SM30 you see the learned assignments in
ZSPE_EPOST_HISTand can delete single ones.
9 · Tax
The tool takes the tax amounts from the invoice and does not let SAP recalculate them. The supplier calculates the tax per rate on the whole invoice; SAP would round per row differently. Taking the amounts over makes the document match the invoice to the cent. SAP still recalculates the tax as a check: if it differs by more than TAX_TOL, that is an error, because then either the tax mapping does not fit or the invoice is wrong.
Maintaining the tax mapping
In ZSPE_EPOST_TAX you map, per company code, every combination of tax category and tax rate to an input tax code. Tax code names differ in every company; the following rows are an example for a German company code:
| Category | Rate | Code ( example ) | Meaning |
|---|---|---|---|
S | 19.00 | V1 | Input tax 19 % |
S | 7.00 | V2 | Input tax 7 % |
AE | 0.00 | VR | Reverse charge under section 13b of the German VAT Act |
K | 0.00 | VE | Intra-community acquisition |
E | 0.00 | V0 | Exempt |
Z | 0.00 | V0 | Zero rate |
O | 0.00 | V0 | Not subject to VAT |
For the categories without a rate of their own ( AE, K, E, Z, O ) always enter rate 0, even if a supplier prints another rate in the invoice.
If the row for a combination in the invoice is missing, the tool reports the missing combination. You can then choose the tax code by hand for this invoice and add the mapping later.
Reverse charge and intra-community acquisition
For categories AE and K the invoice shows no tax, because you owe it yourself. The tax code in SAP must then be set up to create input and output tax of the same amount. The tool takes these two tax lines from SAP, and the vendor receives the net amount.
Date of supply
If the date of supply lies before a change of the tax rate, it can matter for the choice of tax code. The invoice on the left shows it next to the tax breakdown.
10 · Special cases
Invoice types
| Invoice type | Handling |
|---|---|
| Invoice, debit note, prepayment invoice, factored invoice, partial and final construction invoice ( 380, 383, 386, 393, 875, 876, 877 ) | as an invoice |
| Corrected invoice ( 384 ) | as an invoice, with a note on the preceding invoice; if that one is already posted, it may have to be reversed |
| Credit note ( 381 ) | with the document type for credit notes, the vendor on the debit side, expense and input tax on the credit side |
| Self-billing, issued by the buyer ( 389, 261 ) | cannot be posted; such a document belongs in accounts receivable |
| others | cannot be posted, with a note |
If the total of an invoice is negative, the tool treats it like a credit note and says so. Single negative lines of an invoice are posted as credit rows on the expense account.
Purchase order number
If the invoice names a purchase order number, it usually belongs in logistics invoice verification ( MIRO ). If ALLOW_PO is empty in the settings, the tool cannot post it; you can still read and check the invoice. If ALLOW_PO is set, the tool shows a warning, and you confirm with “Book here despite the purchase order”.
New supplier
If the tool finds no vendor, it shows the card “No vendor found” with name, address, VAT ID, bank details and contact data from the invoice.
If you may not create vendors, save the data with “Save data” as a file and pass it on to master data maintenance.
New bank details
If the invoice names an IBAN that is not on file for the vendor, the tool sets the payment block from ZLSPR_IBAN and warns. You can still park or post; the block stays until master data maintenance has checked the new bank details. If you want to remove the block yourself, confirm “I have checked the bank details; the payment block may go.” This confirmation is logged with your name.
Invoice received twice
The tool recognises an invoice that is already posted or parked by the same file and by the same invoice number with the same vendor. It then shows, for example: “This file was processed before on 09.11.2026 by MEIER, document 1900000123 / 2026 ( parked ).” No document is possible then. If the amount differs with the same number, it is only a warning to check.
Allowances and charges on the whole invoice
A discount or a freight charge on the whole invoice appears as a row of its own and is assigned like a line. With the button “spread” in that row you spread the amount over the lines with the same tax rate instead, in proportion to their amounts; a rounding remainder goes to the largest line.
Rounding amount
If the supplier rounds the amount due, for example from 119.98 to 120.00, the tool posts the difference without tax to the rounding account from RND_ACCT, and the vendor receives the rounded amount. If no rounding account is set, such an invoice cannot be posted.
Long invoice number
The reference field of an SAP document has 16 characters. If the invoice number is longer, the reference holds its beginning, the full number is in the header text and the log, and the tool points this out.
Foreign currency
The document currency is the currency of the invoice. SAP takes the exchange rate on the posting date from its rate table. If the invoice also states the tax in your local currency, the tool shows this amount as a note; compare it after the check with the tax in local currency in the simulation.
Prepayment
If the invoice shows an amount already paid, the tool still posts the full invoice amount, because for tax purposes the whole invoice counts. You clear the down payment in SAP. If ZLSPR_PREPAID is set, the document gets a payment block, so that the full amount is not paid.
Very large invoices
An SAP document has at most 999 rows. If an invoice has more lines, the tool condenses the rows with the same assignment even when CONDENSE is switched off.
One document per file
A file contains exactly one invoice. With “Next invoice” you go through several files one after the other; the file dialog remembers the folder.
11 · Log and filing again
Every run is in the log. Start the report ZSPE_EPOST_LOG in SA38 and choose company code, user, kind or period. The list shows company code, vendor, invoice number, document number, user and time; you save it as a file through the functions of the list.
A double-click on a row offers two ways:
- “Show doc.” opens the document in FBV3 or FB03.
- “File again” files the original afterwards if filing failed during posting.
Important: The log does not store the invoice file. When filing again, you therefore choose the file once more from your workstation. The report checks that it is the same file and only then stores it at the document. As long as the tool is still open after posting, the button “File again” in the result bar is enough.
If the document was created but filing failed, the result bar says “Document created, filing failed.” The document is then validly posted or parked; only the original is missing at the document.
12 · What the tool deliberately does not do
- No logistics invoice verification. Invoices for purchase orders belong in MIRO.
- No work list and no background processing. The tool works in dialog, one file after the other. The parked document takes the role of the work list.
- No text recognition. A PDF without an embedded e-invoice is not processed.
- No approval workflow of its own. Approvals run through parking and posting by a second person or through your existing SAP workflow for parked documents.
- No down payment clearing and no automatic creation of bank details.
- No validation with KoSIT or VAMPIRE. The tool's checks are about whether the invoice can be posted and about master data, not about formal validity under XRechnung.
13 · Questions and answers
Why does the page reload in between?
SAP cannot hand data to the running display. When SAP has determined something, such as the vendor or the result of the simulation, it writes the data anew and reloads the page. Your input is kept. Because all files already lie on your workstation, this takes only a moment.
Why are “Park” and “Post” greyed out?
Either SAP has not checked the current state yet, or you changed something after the check, or there is still an error. The sentence next to the buttons names the reason. Choose “Check”. If you lack the authorisation, the tool says so too.
Why does the tool propose an account I did not expect?
Move the mouse over the letter at the end of the row. It names the rule number or the source. The order in which rules win is in chapter 8.
Parking does not work. What can I do?
SAP ECC has no released BAPI for parking. The tool therefore uses a widespread function module of the SAP standard. If it does not work as expected in your system, set the parameter ZSPE_EPOST_PARKMODE to BI in STVARV. The tool then parks through batch input.
Can I post without a cost centre?
Whether a cost object is required is decided by SAP through the field status and through whether the G/L account is a cost element. If the account is a cost element, the tool reports an error at the row while assigning, as long as neither cost centre nor internal order nor WBS element is set. The simulation checks it bindingly.
Is the PDF file changed?
No. The tool stores the uploaded file unchanged. In a ZUGFeRD PDF the e-invoice is contained in the PDF; no second file is stored.
How do I remove the tool again?
Settings, tax mapping, rules, learned assignments and log are lost. Posted and parked documents and the stored files remain, because they belong to the SAP standard.
14 · List of images
This list shows which screenshots this manual expects and which were found in the folder screenshots/ of the package. An image is always named key.language.png, for example posting-uebersicht.en.png. The images show sample data only.
| Status | File | What it shows |
|---|---|---|
| – | posting-uebersicht.en.png | The posting tool with the invoice on the left and the posting proposal on the right |
| – | posting-aufbau.en.png | The areas of the posting tool |
| – | posting-belegvorschau.en.png | The document preview of an electricity bill |