How an FB01 mass upload works
FB01 in SAP is the general transaction for posting an accounting document: you enter a posting key and an account for every line, so one document can mix G/L, vendor and customer lines under any document type. PostNow.ai does an FB01 mass upload from Excel through BAPI_ACC_DOCUMENT_POST, SAP's standard BAPI for posting the same documents: one header row per document, one detail row per line, with the posting key expressed as the line's table and the amount's sign. Validate checks the sheet offline, Simulate lets SAP check every document and rolls it back, and Run writes each document number back to its row. Where a document must carry the exact keys from your file, PostNow.ai can also replay a recording of the FB01 screens.
- The BAPI has no posting key field. SAP derives the key from the table the line goes into (G/L, vendor, customer) and the sign of the amount, plus the special G/L indicator on vendor and customer lines.
- One document = one atomic posting. Rows that share a document reference post together or not at all, and the lines must add up to zero.
This page covers one job: posting documents whose lines need what only FB01 expresses, such as a vendor and a customer in the same document, a special G/L posting or a document type FI chose for an interface. Journals whose lines are all G/L accounts belong in FB50 mass upload, vendor invoices without a purchase order in FB60 mass upload, invoices against a purchase order in MIRO mass invoice posting, and the overview of finance postings in SAP FICO mass posting.
FB01 mass upload with PostNow.ai, step by step
PostNow.ai turns an FB01 mass upload into a published template: a designer maps it once against your SAP system, and the accountants run their own files through it, each under their own SAP login, on their own computer, when they click Run.
- Start from the template or the BAPI. Download the free FB01 G/L document template, whose field guide maps every column to its
BAPI_ACC_DOCUMENT_POSTfield, or open the BAPI in the add-in: Find with AI answers "FB01" with this BAPI, and Mapping AI matches your own column headers to its fields. Mapping AI reads headers, never your amounts. - Group header and lines. A marker column turns one
Hrow (company code, document date, posting date, document type, currency, reference, header text) and itsDrows into one document. A Document Ref column such asGD-0001keeps the rows of each document together. - Map each line type to its table. G/L columns go to
ACCOUNTGL, the vendor column toACCOUNTPAYABLE, the customer column toACCOUNTRECEIVABLE, and every amount toCURRENCYAMOUNT. PostNow.ai builds a line in a table from every detail row in which at least one cell mapped to that table holds a value. A G/L row therefore leaves the vendor and customer columns empty, and a vendor or customer row leaves every column mapped toACCOUNTGLempty, which is why mixed documents need their own item number, assignment and text columns per table (see mixed lines). - Validate the sheet. Validate checks every cell offline, in Excel: required fields, type, length, date format, decimals and allowed values, such as an allow-list of document types. Whether a key fits an account, the document balances and the period is open is SAP's call, in the next step.
- Simulate. PostNow.ai calls the BAPI for every document and then
BAPI_TRANSACTION_ROLLBACKinstead of a commit. SAP's own messages (balance, closed period, account type not allowed, missing required field) land on each document's row, and nothing is posted. - Run, then re-run only what failed. For each document PostNow.ai calls the BAPI and commits with
BAPI_TRANSACTION_COMMITonly when SAP returned no error. The H row gets "Accounting Document number posted successfully" with user, time and SAP system; with Call Transaction set toFB03, the number becomes a link that opens the document. Retry Failed re-posts the documents whose Run Log starts with ERROR, and a second Run on the same sheet first offers Skip posted rows, Post again or Cancel.
The posting key is the instruction
In PostNow.ai's FB01 template the posting key is carried by the line's table and the amount's sign; on the FB01 screen you type it. Either way it decides three things, as SAP's own definition puts it: the account type of the line, debit or credit, and which fields the line accepts. These are the keys of the standard system; your FI team can define more in OB41.
| Posting key | Account type | Debit / credit | Typical line | In the BAPI |
|---|---|---|---|---|
| 40 / 50 | G/L account (S) | Debit / credit | Expense, revenue, accrual, clearing account | ACCOUNTGL, positive / negative amount |
| 01 / 11 | Customer (D) | Debit / credit | Customer invoice / credit memo | ACCOUNTRECEIVABLE, positive / negative |
| 21 / 31 | Vendor (K) | Debit / credit | Vendor credit memo / invoice | ACCOUNTPAYABLE, positive / negative |
| 09 / 19 | Customer, special G/L | Debit / credit | Down payment request, down payment received | ACCOUNTRECEIVABLE with SP_GL_IND |
| 29 / 39 | Vendor, special G/L | Debit / credit | Down payment made / down payment request (indicator F) | ACCOUNTPAYABLE with SP_GL_IND |
| 70 / 75 | Asset (A) | Debit / credit | Asset acquisition or retirement line | ACCOUNTGL with ASSET_NO, SUB_NUMBER and transaction type CS_TRANS_T |

Why a wrong key is worse than a wrong amount. A wrong amount usually breaks the balance and SAP stops the document. Swap 40 and 50 on two G/L lines of the same value and the document still balances: it posts, and both accounts move the wrong way. The same trap sits in a signed amount column, where a lost minus sign flips a line. Review one posted document per key pattern in FB03 after the first run, and compare debit and credit totals separately, not only the net.
FB01, F-02, FB50, FB60, FB70: which one
PostNow.ai has a free template for each of these, and the choice follows the lines in the document: use FB01 only when the document needs a combination the Enjoy transactions cannot enter.
| Transaction | What it posts | Debit / credit set by | Use it for a mass upload when |
|---|---|---|---|
| FB01 | Any account types in one document, any document type | Posting key per line | A document mixes G/L, vendor and customer lines, carries a special G/L indicator, or comes from an interface file that already holds posting keys |
| F-02 | G/L account posting on the same classic screens | Posting key per line | Same program as FB01 (SAPMF05A) with defaults set in OBU1, usually document type SA and first key 40; for an upload, treat it as FB01 |
| FB50 | G/L lines only, document type SA by default | Debit/credit indicator | Accruals, reclassifications, allocations: see FB50 mass upload |
| FB60 | One vendor line plus G/L lines, document type KR | Invoice or credit memo on the header | Vendor invoices without a PO: see FB60 mass upload |
| FB70 | One customer line plus G/L lines, document type DR | Invoice or credit memo on the header | Customer invoices without SD billing; PostNow.ai's free FB70 customer invoice template covers it |
All five end in the same kind of accounting document, and all five can be posted through BAPI_ACC_DOCUMENT_POST. The Enjoy transactions derive the posting key for you, which is one less column that can be wrong across four hundred rows, so FB01 earns its place only where the document needs it.
The FB01 header: company code, dates and any document type
A PostNow.ai FB01 template puts the header on the H row: company code, document date, posting date, document type, currency, reference and header text, mapped to DOCUMENTHEADER with business transaction RFBU. FB01 lets you choose the document type, and that choice has consequences.
- The document type limits the account types. Each document type allows a set of account types (customer, vendor, G/L, asset, material), maintained in
OBA7. A vendor line in a document type that allows only G/L accounts stops withF5 243"Account type … is not defined for document type …", however correct the keys are. - The document type picks the number range. The posted document takes its number from the range assigned to its type, so documents of different types can land in different ranges. Ask FI which type they want for each kind of posting before the template is published.
- The period must be open for every account type in the document.
OB52opens periods by account type, with+for all. A document with G/L and vendor lines needs both open on its posting date. - One currency per document. The currency sits on the H row and is sent with every line's amount.
Posting keys on the BAPI route: BAPI_ACC_DOCUMENT_POST derives them
PostNow.ai posts FB01 documents through BAPI_ACC_DOCUMENT_POST, and its line tables have no posting key field. SAP derives the key from what you do send: which table the line is in and the sign of its amount in CURRENCYAMOUNT, where a positive amount is a debit and a negative one a credit. In the standard derivation that gives 40/50 for G/L lines, 01/11 for customer lines and 21/31 for vendor lines.
| Your source file says | Map it in PostNow.ai to | Amount sent |
|---|---|---|
| 40, G/L account 0000476000, 1,200.00 | ACCOUNTGL-GL_ACCOUNT | 1200.00 |
| 50, G/L account 0000800000, 3,000.00 | ACCOUNTGL-GL_ACCOUNT | -3000.00 |
| 01, customer 200371, 3,180.00 | ACCOUNTRECEIVABLE-CUSTOMER | 3180.00 |
| 31, vendor 100045, 2,400.00 | ACCOUNTPAYABLE-VENDOR_NO | -2400.00 |
| 29 with indicator A, vendor 100045, 5,000.00 | ACCOUNTPAYABLE-VENDOR_NO and SP_GL_IND = A | 5000.00 |
- Convert keys to signs in one helper column. Interface files usually carry unsigned amounts and a key column. A formula such as
=IF(OR(K2="40",K2="01",K2="21",K2="09",K2="29",K2="70"),L2,-L2)turns them into signed amounts; map that column, not the original. ITEMNO_ACCjoins everything. Each line's account sits in one of the three tables and its money inCURRENCYAMOUNT, linked only byITEMNO_ACC. Number lines 1, 2, 3 per document across all three tables, never restarting per table.- Special G/L goes in
SP_GL_IND. On vendor and customer lines the indicator (for exampleAfor a down payment) makes SAP use 29/39 or 09/19 and the special G/L reconciliation account. Bills of exchange can stop withF5 246"Special G/L transactions of type … are not supported" (SAP KBA 2076117): simulate one before you build a file of them, and keep the FB01 recording as the fallback. - Keys outside the standard set need an enhancement. SAP Community answers point to
EXTENSION2with the BAdIACC_DOCUMENTas the usual way to force a different key, which your ABAP team would build. If your FI team uses its own keys fromOB41, the FB01 recording carries them as typed.
Mixed G/L, vendor and customer lines in one document
PostNow.ai sends a mixed FB01 document as one BAPI call, and SAP either posts all its lines under one document number or none. This is the case FB01 exists for: a recharge that bills a customer and books revenue, a vendor rebate offset against cost, or a netting of a customer and a vendor that are the same business partner. The mapping decides which table each row lands in, so lay the template out so that a G/L row fills only ACCOUNTGL, a vendor row only ACCOUNTPAYABLE and a customer row only ACCOUNTRECEIVABLE.
- Give each table its own columns. PostNow.ai builds a line in a table from every row in which a cell mapped to that table holds a value. One shared item text or assignment column mapped to
ACCOUNTGLwould therefore add a G/L line to any vendor or customer row where it holds a value. Map item number, assignment and text once per table and fill them only on that table's rows; the item number forCURRENCYAMOUNTis filled on every row. - Prove each document pattern first. Simulate one document of every pattern the file contains, then post those few in a test client and open them in FB03 to check every line sits on the intended account and side, before the whole file runs.
- Give vendor and customer lines their own terms. Payment terms and baseline date sit on the sub-ledger line (
PMNTTRMS,BLINE_DATE), not on the header. Map them wherever the file's terms differ from the vendor or customer master record. - Keep CO objects on G/L lines. A cost center or order belongs on the expense or revenue line; vendor and customer lines post to their reconciliation account and take no cost center.
- Put the same reference everywhere it is searched. The header reference and each sub-ledger line's assignment field are what AP and AR use to find and clear these items later.
- Check the zero sum per document before Simulate. A
SUMIFon Document Ref over the signed amount column must return 0.00 for every document, counting G/L, vendor and customer lines together. - Stay under 999 lines per document. Above that SAP stops with
F5 727"Maximum number of items in FI reached".
Field status: why the same account asks for different fields
PostNow.ai sends what the template maps and SAP decides what a line must carry: the field status of the G/L account (its field status group, set in FS00) combined with the field status of the posting key (OB41). A field required by either is required, which is why one line passes and a similar line on the same account fails.
- Read the field name in the message.
F5 808"Field … is a required field for G/L account …" names the field; SAP's long text ties it to the field selection of the account in that company code and of the posting key. - Map the field, or ask FI to relax it. Add a column for it in the template, or have FI change the entry in the field status variant from required to optional (
OBC4) if the requirement is wrong. - Re-check after configuration changes. A template that posted last quarter can fail after FI changes a field status group, and the failure looks like a data problem until you read the field name.
Recording FB01 screens (SHDB)
PostNow.ai can post FB01 from a recording when the document must carry the keys from your file as typed: own posting keys, special G/L types the BAPI refuses, or a team that wants the screen logic. FB01 runs on classic screens of program SAPMF05A, which batch input handles well, and PostNow.ai's Simulate presses FB01's own Simulate function in place of Save. PostNow.ai logs in to SAP GUI only on the user's own computer, with the user's own stored login, when the user starts the action (Record, Run, Debug or Call Transaction); never on a server, never unattended.
- The next line is keyed on the current screen. The first screen (
0100) holds the header plus the first line's posting key and account (RF05A-NEWBS,RF05A-NEWKO). Each line screen (0300for a G/L line, with other screens for vendor and customer lines) holds that line's amount and, at the bottom, the key and account of the line after it. - Lay out the sheet to match. The recorded line block repeats once per detail row, so each D row needs its own amount and the next row's key and account. Two helper columns that read the row below do this; leave them empty on the last line so Save follows.
- The key decides the next screen. A vendor line opens a different screen from a G/L line, and a cost center can open a coding block popup. Record one document with every line type the file will contain, in the order the file uses, and keep every document in the file to that same sequence; a different pattern needs its own recording.
- Prove the loop with Debug. Debug replays the recording in the foreground so you can watch a two-line and a five-line document go through before the first Simulate of the whole file.
Recording rules, OK-codes and loops are in the SAP BDC recording guide. For multi-line documents in standard keys, the BAPI route above needs no screen sequence at all, which is why PostNow.ai's FB01 template uses it.
Worked example: 18 mixed documents in company code 1010
PostNow.ai handles this with one published FB01 template, laid out with item number, assignment and text columns per table as described above, and one run. Finance in company code 1010 has 18 documents for October 2026, currency EUR, posting date 31.10.2026, document type SA, which FI has set in OBA7 to allow customer, vendor and G/L lines. Twelve net a customer balance against the same partner's vendor account; six book vendor rebates against cost. One of each looks like this:
| Row | Document Ref | FB01 key | Line fields in the template |
|---|---|---|---|
| H | NET-2610-004 | Company code 1010, document date 20261031, posting date 20261031, type SA, EUR, reference NET-2610-004, text "Oct AR/AP netting" | |
| D | NET-2610-004 | 11 | Line 1, customer 200371, -4,800.00, assignment NET-2610-004 |
| D | NET-2610-004 | 21 | Line 2, vendor 100045, 4,800.00, assignment NET-2610-004 |
| H | REB-2610-002 | Company code 1010, same dates, type SA, EUR, reference REB-2610-002, text "Q3 volume rebate" | |
| D | REB-2610-002 | 21 | Line 1, vendor 100045, 2,400.00, payment terms 0001 |
| D | REB-2610-002 | 50 | Line 2, G/L 0000411000, -2,400.00, cost center 10101301 |
- Validate. One cell is flagged: a posting date typed as 31/10/2026. It is fixed in the sheet.
- Simulate. 16 documents pass. One netting document returns
F5 702because the customer credit was pasted without its minus sign; one rebate returnsF5 808because the cost account's field status requires a line item text in this company code. Both are corrected and pass a second Simulate. - Run. With both patterns already proved in the test client, all 18 post. Each H row now holds its document number with user, time and SAP system.
- Review. One netting and one rebate document are opened from their links in FB03 to confirm each line sits on the intended side and account; the GL Line Items 360 report, run for posting date 31.10.2026 and the user who ran the file, shows debit and credit totals equal to the file's.
- Clear. AP and AR clear the netted items later against the assignment value
NET-2610-004, which every line of that document carries.
Reverse FB01 documents: FB08, F.80 or a reversal file
PostNow.ai reverses posted documents in bulk with a second template, one row per document with its reversal reason and reversal posting date: the free FB08 reversal template on BAPI_ACC_DOCUMENT_REV_POST, or a recording of FB08 with document number, company code and fiscal year as columns. In SAP itself, FB08 reverses one document at a time and F.80 reverses a selection of documents in one run.
- The reversal BAPI needs the object key, not the document number. For documents posted through
BAPI_ACC_DOCUMENT_POSTthat is object typeBKPFFand the 18-characterOBJ_KEYreturned at posting; map$OBJ_KEYto a result column when you post. - Prove the route on a few documents first. SAP Community answers differ on whether
BAPI_ACC_DOCUMENT_REV_POSTacceptsBKPFFdocuments; some reportRWmessages such as "Reversal in component Financial Accounting not possible". Reverse three documents in a test client and check them in FB03; if SAP refuses them, the FB08 recording orF.80does the same job. - Cleared lines stop a reversal. Once a vendor or customer line from the document has been cleared, SAP refuses the reversal with "Document already contains cleared items - reversal not possible" until the clearing is reset (
FBRA). - A correction document mirrors the keys. Where FB08 cannot apply, for a partial correction or a shape change, post a new FB01 document whose lines flip each key (40 becomes 50, 31 becomes 21) on the same accounts, and carry the original document number in the reference so the two can be found together.
FB01 upload errors and how to fix them
PostNow.ai writes SAP's messages to each failed document's H row, so the fix starts from the message text. These are the ones a bulk FB01 run meets most:
| Message | What it means | Fix |
|---|---|---|
RW 609 Error in document | A wrapper from the accounting interface; the real reason is the next message in the cell | Read the message after it and fix that one |
F5 702 Balance in transaction currency | The document's lines do not add up to zero | Check the signs from the key conversion and that every D row sits under the right H row |
F5 201 Posting period … is not open | The posting date falls in a closed period for one of the document's account types | Correct the date, or ask FI to open the period in OB52 for every account type in the document |
F5 243 Account type … is not defined for document type … | The document type does not allow a customer, vendor or asset line | Use a document type that allows all the document's account types (OBA7) |
F5 808 Field … is a required field for G/L account … | The account's or posting key's field status requires a field the row left empty | Map the named field, or have FI change the field status |
F5 761 Posting key … does not permit specification of a special G/L indicator | A recorded line has a normal key (such as 31) with a special G/L indicator | Use the special G/L key (29 or 39, 09 or 19) for that line |
F5 246 Special G/L transactions of type … are not supported | The BAPI refuses that special G/L type, for example bills of exchange | Simulate one such document through the FB01 recording, then post that type by recording |
F5 727 Maximum number of items in FI reached | More than 999 lines in one document | Split it into several balanced documents |
| Run Log: UNKNOWN (PostNow.ai) | SAP's answer was lost after the document was sent, so it may have posted | Look the reference up in FB03 before posting it again; Retry Failed leaves UNKNOWN rows alone |
FB01 in S/4HANA
PostNow.ai uses the same FB01 template on S/4HANA: FB01 and BAPI_ACC_DOCUMENT_POST are both there, and the posted document lands in the Universal Journal. What changes is mostly what your configuration makes mandatory.
- One line item table. The universal journal entry replaces the separate FI and CO documents, and its line items are written to table
ACDOCA(SAP Help). FB03 shows the document as before. - Customers and vendors are business partners. The customer and vendor numbers in the file are the ones CVI keeps in sync with each business partner; a partner without the customer or vendor role has no account to post to.
- Profit center and segment. Many S/4HANA systems require a profit center on every G/L line, and the segment is usually derived from it. Add the profit center column even where ECC did not ask for it.
- Asset lines bring Asset Accounting's checks. An FB01 line with key 70 or 75 posts through the new asset accounting logic, with its own
FAA_POSTmessages, for example on the technical clearing account. Prove asset lines on Simulate with your asset accountant; the assets themselves are created first, as in mass create assets in SAP (AS01). - API mode. PostNow.ai can also post through SAP's SOAP service Journal Entry - Post (Synchronous) (
JournalEntryCreateRequestConfirmation_In), which takes G/L, customer (debtor) and supplier (creditor) items, with a test-run flag for Simulate. Each item carries a debit/credit code that must match the amount's sign. SAP Help documents it for S/4HANA Cloud under communication scenarioSAP_COM_0002; on premise, Basis exposes it inSOAMANAGER.
Checklist before an FB01 mass upload
PostNow.ai checks formats and allowed values and keeps operators on the published template; this list covers the decisions that stay with FI.
- Every document needs FB01: it mixes account types, uses a special G/L indicator or a document type the Enjoy transactions would not choose. Everything else goes to FB50, FB60 or FB70.
- Posting keys from the source are converted to signed amounts in one helper column, and that column is the one mapped.
- Every document's signed amounts add up to zero, checked with a
SUMIFper Document Ref. - Line numbers run 1, 2, 3 per document across G/L, vendor and customer lines, and on mixed documents each table has its own item number, assignment and text columns.
- One document of every pattern has been simulated and posted in a test client, and checked in FB03.
- The document type allows every account type in the document (
OBA7), and FI agrees which type each kind of posting uses. - The posting period is open in
OB52for every account type the file touches. - Accounts, vendors and customers are text with leading zeros and exist in the company code.
- Special G/L lines carry the indicator, and each indicator has been simulated once.
- Fields the field status requires (cost center, profit center, assignment) are mapped.
- The reversal plan is agreed: FB08 template, recording, F.80, or a mirrored correction document.
- Simulate has run clean on the whole file.
What to plan for in an FB01 mass upload
PostNow.ai posts through SAP's accounting BAPI, so SAP's own posting key, account type, period and field status checks decide every result.
- Run SAP's checks in Simulate. Validate checks formats, lengths and allowed values in Excel; balance, account type, period and field status checks start when SAP sees the document in Simulate.
- Review the sides after the first run. A swapped key or a lost minus sign posts cleanly when the document still balances. Open one posted document per key pattern in FB03 and compare debit and credit totals with the source separately.
- Keep re-runs in the same workbook. The re-post check reads this sheet's Run Log. A copied file with the same documents has no Run Log, so look the references up in the GL Line Items 360 report before posting it.
- Check UNKNOWN rows in SAP first. Look the reference up in FB03; post the row again only if the document is not there.
- Keep the PostNow.ai portal reachable on approval-controlled runs. When an approval policy covers the template, Run waits for an approver to approve that exact data, and the submitter cannot approve their own run. The check asks the portal at Run; if the portal cannot be reached, the run goes ahead without the approval step.
Making a template like this repeatable for a team (designers who build, operators who only run, a published template in the central library) is covered in Excel to SAP automation.
Free FB01 document template
PostNow.ai publishes a free FB01 G/L document template: H rows for the document header and D rows for the lines, two sample documents that mix customer, vendor and G/L lines, and a field guide that maps every column to its BAPI_ACC_DOCUMENT_POST field. Before you post mixed documents with it, give each table its own item number, assignment and text columns as described in mixed lines, and Simulate the sample documents in your system before you paste your own. The FB08 reversal template is the companion for reversing them, and the GL line items report shows what was posted.
