How to do SAP mass billing from Excel
PostNow.ai does SAP mass billing from an Excel list of deliveries or sales orders, one row per reference document, through one of two routes. A VF01 recording replays the billing screen for each row and writes the new billing document number back. BAPI_BILLINGDOC_CREATEMULTIPLE bills without screens and, per SAP's documentation, saves with its own COMMIT WORK, so you test it with its own TESTRUN flag on a quality client first. Either way SAP applies the same copy control, billing blocks, goods issue check and account determination as VF01. Use VF04 for the routine due list; use a file when someone has chosen the documents outside SAP.
- A green row is not yet revenue. Check the posting status (
VBRK-RFBSK): onlyCmeans the accounting document exists. - SAP refuses to bill a reference twice (
VF 017), except pro forma invoices, which never update the billing status.
This page covers one job: creating SD billing documents in bulk from a list in Excel, as VF01 would one at a time. For reporting on billing documents that already exist, use the Billing / Invoice 360 report. For the deliveries that feed billing, see mass outbound delivery creation (VL01N), and for choosing a method across all SAP objects, SAP mass upload from Excel.
How PostNow.ai creates billing documents from Excel
PostNow.ai treats mass billing as a template: a designer builds it once against your SAP system, publishes it, and operators bill their own lists through it, each under their own SAP login on their own computer.
1. Get the list of documents to bill
The list usually starts in SAP. In PostNow.ai's Report Library, Billing-Due List (SD-15) reads SAP's billing index VKDFS, the same source VF04 uses, and puts the documents due for billing into Excel with customer, billing date, net value and billing status. Filter it to the population someone has approved, for example one payer group or one month's deliveries, and paste the document numbers into the billing template.
2. Build the template: record VF01, or pick the BAPI
For the recording route, click Record, bill one delivery in VF01 and save. PostNow.ai records it through SHDB, and the delivery number field (KOMFK-VBELN(01) on screen SAPMV60A 0102) and the billing date (RV60A-FKDAT) become mappable. For the BAPI route, search BAPI_BILLINGDOC_CREATEMULTIPLE in the BAPI Explorer, or ask Find with AI for "VF01", which suggests it. PostNow.ai reads the interface from your own system.
3. Map the columns and fix what should not vary
Map the reference document and, if you control it, the billing date. On the BAPI route, also map the document category (J for a delivery, C for a sales order) as a fixed value, or as a column if the file mixes both. Give billing type a fixed value or a value list with Restrict on, so Validate refuses an F8 pro forma in an invoice template. Document numbers need their leading zeros: BAPI fields that use SAP's ALPHA conversion get them automatically, and on a recording you switch on Leading Zeros for the column.
4. Test without creating invoices
On the recording route, Simulate replays the screens with the save removed, so the errors VF01 raises while it processes each reference show per row and nothing is saved. On the BAPI route, the BAPI saves inside itself (the next section has SAP's wording), so test with its own switch: a copy of the template with TESTRUN set to the fixed value X, run on a copy of the sheet in a quality client, and read SAP's errors in the Run Log. On the recording route, Debug replays the rows in front of you in SAP GUI, screen by screen or stopping on errors.
5. Run, and read SAP's answer per row
Run bills row by row. On the recording route, SAP's save message VF 311 "Document & has been saved" carries the new number as its first variable, and PostNow.ai writes it to the column you map it to. If an approval policy covers the template, Run waits until someone other than the submitter approves this exact data. Each row's outcome also goes to the central audit with template, SAP system, client, user, result and document number.
6. Re-run only what failed, then reconcile
Retry Failed re-sends only rows whose Run Log starts with ERROR, scanning from the current Start Row down. A normal Run first reads the Run Log and offers Skip posted rows, Post again or Cancel for rows that already succeeded. Then run Billing / Invoice 360 (SD-08) for the run's date and check that every reference delivery has a billing document with posting status C.
VF01 recording, BAPI_BILLINGDOC_CREATEMULTIPLE or VF04: which route
PostNow.ai supports both file routes, and for billing existing deliveries we usually start with the VF01 recording: the screen is short, Simulate replays it with the save removed, and the billing number comes back in SAP's message. VF04 stays the right tool when the due list itself is the selection.
| Route | How it bills | Use it when | Watch out for |
|---|---|---|---|
| PostNow.ai: VF01 recording | CALL TRANSACTION VF01 on an SHDB recording, one reference per row | A chosen list of deliveries or orders; you want the billing number in the sheet and a Simulate pass with the save removed | Synchronous update: each row's messages and billing number return at once in the Run Log |
PostNow.ai: BAPI_BILLINGDOC_CREATEMULTIPLE | One RFC call per row or group, no screens | No SAP GUI screen logic wanted; several references combined in one call | Commits inside SAP; test with its TESTRUN flag on a quality client. SAP returns the billing number in the SUCCESS table; check on the first test that it reaches your number column |
| VF04 billing due list | Collective billing of what VKDFS says is due | The routine daily or month-end run, selected by date, sales organisation, customer | Bills everything that matches; no per-row choice |
| VF06 background billing | VF04's selection as a background job (report RV60SBAT) | Overnight runs with a saved variant | Dynamic variant values can behave differently in background (SAP KBA 2610773) |

When a file beats VF04. Month-end selections approved by finance, or documents released one by one after a dispute. If the list is "everything due up to today for sales organisation 1010", VF04 or VF06 already does that. The general trade-off between the two file methods is in BAPI vs BDC in SAP, and how to record so a recording replays reliably is in the BDC recording guide.
Delivery-related vs order-related billing: what goes in the file
In PostNow.ai the reference column holds a delivery number for delivery-related billing and a sales order number for order-related billing; SAP decides which one an item needs from its item category's billing relevance.
| Billing relevance (item category) | Reference in the file | Category (REF_DOC_CA) | Typical billing type | Needs goods issue? |
|---|---|---|---|---|
A Delivery-related | Outbound delivery | J | F2 invoice | Yes, otherwise VF 066 |
B / C Order-related (status by order or target quantity) | Sales order | C | F1 invoice | No |
D Relevant for pro forma | Order or delivery | C or J | F5 (order), F8 (delivery) | No accounting document |
- Billing date drives the period. If the billing date falls in a closed FI period, the accounting document is not created (
F5 201), so a month-end file dated the 31st needs that period open. Put the date in the file explicitly rather than relying on whoever runs it doing so on the right day. - Pricing follows copy control, not the file. The pricing type on the item copy control from delivery or order to billing type decides what happens to prices:
Gcopies pricing elements unchanged and redetermines taxes,Ccopies manual elements and redetermines the others,Bprices again. If the invoice must match the order price, check that setting before a big run rather than after customer queries. Expired condition records matter only where the pricing type redetermines. - Pro forma invoices do not consume the reference. They post nothing to FI and do not update the billing status, so the same delivery can get any number of pro formas. That makes a re-run of a pro forma file a duplicate generator: SAP won't stop it, so rely on PostNow.ai's re-post check on the same sheet and never re-run a pro forma file from a fresh copy.
- Credit memos are billed from a credit memo request, not a delivery; keep them in their own template with their own billing type.
BAPI_BILLINGDOC_CREATEMULTIPLE: structure, commit and test run
PostNow.ai calls BAPI_BILLINGDOC_CREATEMULTIPLE like any remote-enabled BAPI, but this one behaves differently from most: SAP's own documentation says the update run commits inside the method.
| Parameter | Type | What it does |
|---|---|---|
BILLINGDATAIN | BAPIVBRK (table) | One line per item to bill. With a reference: REF_DOC, REF_DOC_CA, DOC_NUMBER, optionally REF_ITEM, ORDBILLTYP, BILL_DATE, PRICE_DATE |
TESTRUN | Import, 1 character | X = simulation run, blank = update run |
CONDITIONDATAIN, TEXTDATAIN, CCARDDATAIN | Tables | Conditions, texts and payment card data, only if you pass them |
RETURN | BAPIRET1 (table) | Processing errors, in both test and update runs |
SUCCESS | BAPIVBRKSUCCESS (table) | REF_DOC, BILL_DOC, BILL_DOC_ITEM, net and tax value per billed item |
ERRORS | BAPIVBRKERRORS (table) | The reference document and item that failed, with the message |
- It commits on its own. SAP's documentation: in the update run (
TESTRUNblank) the update is carried out by COMMIT WORK as part of the method. Most BAPIs leave the commit to the caller (BAPI_TRANSACTION_COMMIT); this one does not, so a rollback after the call is not a safety net. Test on a quality client first, withTESTRUN=Xas a fixed value in a separate test copy of the template. - Keep the test run apart from the real run. A test run creates no billing document, so treat its Run Log as a list of SAP's errors only. Run the test on a copy of the sheet, then run the real template on a fresh copy, so test-run results never sit in the sheet you post from.
- The billing number is in a table. SAP returns it in
SUCCESS-BILL_DOC. PostNow.ai fills its$DOC_NOtoken from export parameters and from SAP's success message, so on the first test check that the number column fills; where it stays empty, take the numbers from the Billing / Invoice 360 report by reference delivery. - Errors are read from
RETURN. SAP's documentation says both run types report errors there, and PostNow.ai writes those messages to the Run Log as it does forBAPIRET2. - SAP's "required entries" are for billing without a reference. The BAPI's documentation lists sales organisation, distribution channel, division, sales document type, billing type, sold-to, item category, quantity, unit and currency as required, because the same interface also bills external data that has no SD document behind it. With a reference, the usual code fills only the reference fields and copy control brings the rest; prove it with a test run per billing type.
Invoice split: one invoice per delivery or combined invoices
PostNow.ai decides how many references go to SAP together, and SAP decides how many invoices those references become. Both halves matter when customers expect one invoice per order, or one per month.
- SAP's rule. Billing combines everything for the same customer, billing date and sales organisation into one billing document, unless header fields of the references differ. Different payment terms always force a split; differences that live only at item level do not. Extra split rules are set in copy control, by billing type, reference document type and item category.
- The recording route bills one reference per row. VF01 gets one document per row, so every delivery gets its own invoice. That is usually what a chosen-list file wants.
- The BAPI route can combine. SAP's documentation says the lines in
BILLINGDATAINproduce "a batch of billing documents". In PostNow.ai, a flat-row template with a split column (for example on payer, splitting on change) sends all of a payer's rows in one call, and SAP's split rules then decide how many invoices result. SAP's documentation does not say whether one failing reference stops the others in the same call, so test a group with one blocked delivery on a quality client before you rely on grouping. - When the split surprises you, compare two billing documents with SAP's split analysis, available from the billing document display and the billing due list (message
VF 078asks you to select exactly two) or ask the SD team which copy control requirement fired.
Why a delivery won't bill: SAP billing errors and fixes
PostNow.ai writes SAP's message into the row's Run Log; in a mass billing run most of them are not data errors but decisions someone made in SAP, and the fix is a conversation, not a re-run.
| Message | What it means | Fix |
|---|---|---|
VF 066 Goods issue has not been posted for the delivery | The delivery is picked or packed but has not left; delivery-related billing waits for goods issue | Post goods issue in VL02N or VL06O, then Retry Failed |
VF 014 / VF 064 The document is blocked for billing; VF 015 / VF 065 item blocked | A billing block on the order or delivery header or item, set on purpose (dispute, price check, missing proof of delivery) | Ask the owner of the block. Remove it in VA02 or VL02N only with their agreement |
VF 068 Payer & is blocked for billing | Billing block in the customer master of the payer | Customer master team; take the rows out of this run |
VF 069 Document & is incomplete so billing cannot be carried out | The incompletion log of the order or delivery blocks billing, for example missing payment terms | Complete it in VA02 or VL02N (Edit › Incompletion log), then Retry Failed |
VF 140 Document cannot be billed due to credit limit check | Credit management blocks billing for this document | Credit team releases it; do not loosen the check for a run |
VF 017 The document has already been fully invoiced; VF 305 item already completely billed | The reference is fully billed, by an earlier run, by VF04, or by a colleague | Nothing to do. Find the existing billing document in the document flow |
VF 016 The document is not relevant for billing | Wrong reference type or category (an order number sent with J), or an item category that is not billing-relevant | Check the reference column and REF_DOC_CA |
VF 051 Document & saved (error in account determination); VF 071 saved (pricing error) | The billing document exists, the accounting document does not | See the next section; release in VFX3 after the fix |
F5 201 Posting period & & is not open | The billing date falls in a closed FI period | Open the period or move the billing date into an open one, then release |
| PostNow.ai: "No rows in the Run Log column (A) are marked ERROR" | Retry Failed found nothing to re-send from the current Start Row down | Set Start Row back to 2 after a pilot |
For a failed row, AI Review in the run diagnostics explains SAP's messages in plain language. By default it receives the messages, the interface name and the field structure, never the cell values. If a call times out after it may have reached SAP, the row is marked UNKNOWN rather than ERROR and Retry Failed leaves it alone: look the reference up in the document flow before you send it again.
Release to accounting: billing documents without an accounting document
PostNow.ai reports what SAP said when the billing document was saved, and SAP can save a billing document whose accounting document failed. The posting status field VBRK-RFBSK is where you find out, and VFX3 is where you fix it.
RFBSK | SAP's text | What to do |
|---|---|---|
C | Posting document has been created | Nothing; revenue and receivable are in FI |
A | Billing document blocked for forwarding to FI | Intended: the billing type has a posting block. Release in VFX3 when approved |
B | Posting document not created (account determination error) | Fix account determination (VKOA, or the account assignment group on customer or material), then release in VFX3 |
F / G | Not created: pricing error / export data missing | Fix pricing or foreign trade data, then release |
| blank | Error in accounting interface | Read the error in VF02 (release to accounting shows it) or VFX3 |
D | Not relevant for accounting | Expected for pro forma invoices |

VFX3 (Release Billing Documents for Accounting) lists billing documents not yet passed to FI by sales organisation, payer, billing type and creator, and releases them in one go once the cause is fixed. In PostNow.ai, Billing / Invoice 360 has a KPI for exactly this, "Not passed to accounting" (posting status other than C), so the gap shows up the same day instead of at month-end close.
Worked example: month-end billing of 60 deliveries in sales organisation 1010
PostNow.ai handles this with one published VF01 recording template and one run. Finance has approved billing for 60 deliveries from shipping point 1010 in sales organisation 1010, billing date 31.10.2026, after a pricing dispute with two customers was settled.
- Build the list. The operator runs Billing-Due List (SD-15) for sales organisation
1010and billing dates up to 31.10.2026, filters to the 60 approved deliveries (80004411to80004470, first customer200371) and pastes them into the template with 20261031 in the billing date column. - Validate. Formats and lengths are clean; delivery numbers are padded to ten digits by the column's Leading Zeros rule.
- Simulate. 57 rows come back green. Delivery
80004436showsVF 066: the warehouse has not posted goods issue. Delivery80004452showsVF 064: the order still carries the billing block from the dispute. Delivery80004468showsVF 069: payment terms missing on the order. Nothing was saved. - Fix or remove. The warehouse posts goods issue for
80004436. The customer service lead confirms the block on80004452stays, so that row is removed. Payment terms are added to the order behind80004468. - Pilot, then run. Rows 2 to 6 run first; two billing documents are checked in VF03, including the accounting document in the document flow. Start Row goes back to 2 and the rest runs; Run offers to skip the five already billed, and the operator chooses Skip posted rows.
- Reconcile. 59 rows have a billing number. Billing / Invoice 360 for billing date 31.10.2026 shows 59 documents and one with posting status
B: materialTG-1001has no account assignment group. Master data adds it, the SD team releases the document in VFX3, and the KPI "Not passed to accounting" drops to zero.
Checklist before a mass billing run
PostNow.ai enforces formats, allowed values and run-only templates; this list covers the decisions that stay with whoever owns billing.
- The list was approved by whoever owns billing for these customers, and it does not overlap tonight's VF06 job.
- Goods issue is posted for every delivery in the file.
- Billing blocks in the file have been cleared by their owners, not by the person running the file.
- The billing date is in an open FI period, and finance agrees with the date.
- Billing type and document category match the references (
Jfor deliveries,Cfor orders). - The pricing type in copy control does what the business expects (copy the order price or reprice), checked on one document.
- On the BAPI route: the test ran in a quality client from a template copy with
TESTRUN=X, and the real run starts from a fresh sheet. - Someone owns the follow-up: blocked rows, and any document with posting status other than
C.
Cancel billing documents in bulk: VF11 and BAPI_BILLINGDOC_CANCEL1
PostNow.ai can cancel from a list the same two ways it creates: a recording of VF11, or BAPI_BILLINGDOC_CANCEL1 with the billing document number per row. A cancellation is a new document (billing type S1 for an F2 invoice in standard), never a deletion, and it reverses the accounting document.
- The cancel BAPI also commits itself. Its documentation says the update run commits with COMMIT WORK, and it returns the cancellation number in
SUCCESS. The same rule applies: test on a quality client withTESTRUN=X. It also has aNO_COMMITimport, which this page doesn't rely on. - Pro forma invoices cannot be cancelled (
VF 106), and a cancellation cannot itself be cancelled (VF 108). - Cleared invoices and closed periods are the usual blockers. SAP's guided answers for billing cancellation (KBA 2517034) cover both; involve FI before a bulk cancellation that crosses a period end.
- Re-bill only after the correction that caused the cancellation is in SAP, or the new invoice repeats the old mistake.
How to check billing documents after a mass run
PostNow.ai gives you the first check per row: the Run Log, the billing number column on the recording route, and the central audit. The proof that the run finished comes from SAP's billing tables.
- Billing / Invoice 360 (SD-08) in the PostNow.ai Report Library joins
VBRKandVBRPwith payer and billing type, and shows posting status, cancelled flag, reference delivery (VGBEL) and sales order (AUBEL) per item. Filter on the run's billing date and compare the reference deliveries with the file. Operators can run it under their own SAP authorisations. The report is described on the Billing / Invoice 360 page. - Billing-Due List (SD-15) run again after the load should no longer show the billed deliveries; anything left is a row that failed or was skipped.
- In SAP: VF03 for a sample with its document flow, VFX3 for anything not passed to accounting, and VF04 for what is still due.
Reconcile three numbers per run: references against billing documents, expected against billed net value, and billing documents against accounting documents. The full catalogue of ready-made reports is in the Report Library.
What to plan for in a mass billing run
PostNow.ai bills through VF01 or SAP's billing BAPI, so SAP's own billing rules decide every result.
- Run SAP's billing checks in Simulate or a test run. Validate checks formats, lengths and allowed values in Excel; SAP's billing checks start with Simulate or a test run.
- The billing BAPIs save inside themselves. Per SAP's documentation, the create and cancel BAPIs commit as part of the method, so test them with their own
TESTRUNflag on a quality client before the first real run. - Read the Run Log after a recording run. Recordings run with synchronous update, so each row's messages and billing number return at once in the Run Log.
- Keep re-runs in the same workbook. The re-post check reads this sheet's Run Log; a new file with the same deliveries is stopped by SAP's billing status (
VF 017), except for pro forma invoices. - Cancel in VF11, schedule in VF06. Stop cancels rows not yet sent; billed documents stay in SAP and are cancelled in VF11. Recording templates run when a user starts them, so the nightly due-list run belongs in VF06.
- Keep the PostNow.ai portal reachable for approved templates. The approval check runs against the portal; if the portal cannot be reached, the check lets the run through.
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.
SAP mass billing on S/4HANA: what changes
PostNow.ai uses the same routes on S/4HANA, because VF01, VF04, VFX3 and BAPI_BILLINGDOC_CREATEMULTIPLE are still there; the tables and apps around them moved.
- Status tables are gone. The header status fields of
VBUK, including billing statusFKSTK, moved into the document headers (VBAK,LIKP). PostNow.ai's Billing-Due List report reads billing status fromVBUK, so on S/4HANA compare it with VF04 once before relying on it. - Fiori apps sit next to the transactions. SAP's Create Billing Documents (F0798) and Manage Billing Documents (F0797) apps work on the same billing documents, so a file run and the apps can be used side by side.
- Customers are Business Partners. The payer's billing block and the customer's account assignment group are customer data maintained through BP; the customer master upload page covers that data.
The orders behind the deliveries are covered in VA01 mass upload, and the wider order-to-cash picture in SAP SD mass upload.
Free VF01 billing document template
PostNow.ai publishes a free VF01 billing document template: one row per reference document, with reference document, document category and sales document as the required columns and a field guide mapping every column to BAPI_BILLINGDOC_CREATEMULTIPLE. It is listed with the other SD templates on the sales and distribution templates page. Leave the optional columns empty when you bill with a reference, unless a test run shows you need them.
