Quick answer

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): only C means 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.

Check: after the first five rows, open two billing documents in VF03 and compare payer, net value, tax and the accounting document in the document flow with what the file expected.

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.

RouteHow it billsUse it whenWatch out for
PostNow.ai: VF01 recordingCALL TRANSACTION VF01 on an SHDB recording, one reference per rowA chosen list of deliveries or orders; you want the billing number in the sheet and a Simulate pass with the save removedSynchronous update: each row's messages and billing number return at once in the Run Log
PostNow.ai: BAPI_BILLINGDOC_CREATEMULTIPLEOne RFC call per row or group, no screensNo SAP GUI screen logic wanted; several references combined in one callCommits 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 listCollective billing of what VKDFS says is dueThe routine daily or month-end run, selected by date, sales organisation, customerBills everything that matches; no per-row choice
VF06 background billingVF04's selection as a background job (report RV60SBAT)Overnight runs with a saved variantDynamic variant values can behave differently in background (SAP KBA 2610773)
Comparison of SAP VF04 collective billing, VF01 individual billing and a file-based run: how each selects documents, controls grouping and billing date, and what each is right for
VF04 handles the routine run. A file is for a population someone chose outside SAP.

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 fileCategory (REF_DOC_CA)Typical billing typeNeeds goods issue?
A Delivery-relatedOutbound deliveryJF2 invoiceYes, otherwise VF 066
B / C Order-related (status by order or target quantity)Sales orderCF1 invoiceNo
D Relevant for pro formaOrder or deliveryC or JF5 (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: G copies pricing elements unchanged and redetermines taxes, C copies manual elements and redetermines the others, B prices 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.

ParameterTypeWhat it does
BILLINGDATAINBAPIVBRK (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
TESTRUNImport, 1 characterX = simulation run, blank = update run
CONDITIONDATAIN, TEXTDATAIN, CCARDDATAINTablesConditions, texts and payment card data, only if you pass them
RETURNBAPIRET1 (table)Processing errors, in both test and update runs
SUCCESSBAPIVBRKSUCCESS (table)REF_DOC, BILL_DOC, BILL_DOC_ITEM, net and tax value per billed item
ERRORSBAPIVBRKERRORS (table)The reference document and item that failed, with the message
  • It commits on its own. SAP's documentation: in the update run (TESTRUN blank) 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, with TESTRUN = X as 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_NO token 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 for BAPIRET2.
  • 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 BILLINGDATAIN produce "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 078 asks 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.

MessageWhat it meansFix
VF 066 Goods issue has not been posted for the deliveryThe delivery is picked or packed but has not left; delivery-related billing waits for goods issuePost goods issue in VL02N or VL06O, then Retry Failed
VF 014 / VF 064 The document is blocked for billing; VF 015 / VF 065 item blockedA 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 billingBilling block in the customer master of the payerCustomer master team; take the rows out of this run
VF 069 Document & is incomplete so billing cannot be carried outThe incompletion log of the order or delivery blocks billing, for example missing payment termsComplete it in VA02 or VL02N (Edit › Incompletion log), then Retry Failed
VF 140 Document cannot be billed due to credit limit checkCredit management blocks billing for this documentCredit 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 billedThe reference is fully billed, by an earlier run, by VF04, or by a colleagueNothing to do. Find the existing billing document in the document flow
VF 016 The document is not relevant for billingWrong reference type or category (an order number sent with J), or an item category that is not billing-relevantCheck 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 notSee the next section; release in VFX3 after the fix
F5 201 Posting period & & is not openThe billing date falls in a closed FI periodOpen 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 downSet 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.

RFBSKSAP's textWhat to do
CPosting document has been createdNothing; revenue and receivable are in FI
ABilling document blocked for forwarding to FIIntended: the billing type has a posting block. Release in VFX3 when approved
BPosting document not created (account determination error)Fix account determination (VKOA, or the account assignment group on customer or material), then release in VFX3
F / GNot created: pricing error / export data missingFix pricing or foreign trade data, then release
blankError in accounting interfaceRead the error in VF02 (release to accounting shows it) or VFX3
DNot relevant for accountingExpected for pro forma invoices
SAP billing produces two documents: an SD billing document the customer receives and an FI accounting document that posts the receivable, revenue and tax
One save, two records. A mass run is finished when both exist.

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.

  1. Build the list. The operator runs Billing-Due List (SD-15) for sales organisation 1010 and billing dates up to 31.10.2026, filters to the 60 approved deliveries (80004411 to 80004470, first customer 200371) and pastes them into the template with 20261031 in the billing date column.
  2. Validate. Formats and lengths are clean; delivery numbers are padded to ten digits by the column's Leading Zeros rule.
  3. Simulate. 57 rows come back green. Delivery 80004436 shows VF 066: the warehouse has not posted goods issue. Delivery 80004452 shows VF 064: the order still carries the billing block from the dispute. Delivery 80004468 shows VF 069: payment terms missing on the order. Nothing was saved.
  4. Fix or remove. The warehouse posts goods issue for 80004436. The customer service lead confirms the block on 80004452 stays, so that row is removed. Payment terms are added to the order behind 80004468.
  5. 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.
  6. 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: material TG-1001 has 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.
⚠
Pilot in a quality client first. A wrong billing document is cancelled in VF11, which also reverses its accounting document, and both documents stay visible for audit.

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 (J for deliveries, C for 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 with TESTRUN = X. It also has a NO_COMMIT import, 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 VBRK and VBRP with 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 TESTRUN flag 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 status FKSTK, moved into the document headers (VBAK, LIKP). PostNow.ai's Billing-Due List report reads billing status from VBUK, 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.

Frequently asked questions

How do I create billing documents in SAP from Excel?
With PostNow.ai, put one delivery or sales order number per row and run it through a VF01 recording template or BAPI_BILLINGDOC_CREATEMULTIPLE. On the recording route, Simulate shows SAP's billing messages without saving, and Run writes each new billing number back from SAP's message VF 311. On the BAPI route, test with TESTRUN set to X. Afterwards, check the posting status in the Billing / Invoice 360 report.
What is the difference between VF01, VF04 and VF06?
VF01 creates billing documents for references you enter. VF04 processes the billing due list: everything SAP's billing index says is due for the selection, billed collectively. VF06 runs VF04's selection as a background job. A file in PostNow.ai is for a list chosen outside SAP, which VF04's selection cannot express.
Does BAPI_BILLINGDOC_CREATEMULTIPLE need BAPI_TRANSACTION_COMMIT?
SAP's documentation says the update run (TESTRUN blank) commits with COMMIT WORK inside the method. You don't call BAPI_TRANSACTION_COMMIT after it, and a rollback after the call is not a safety net. In PostNow.ai, test it on a quality client with TESTRUN = X as a fixed value in a test copy of the template, then run the real template.
Why does a delivery not appear in the billing due list or fail to bill?
The most common reasons are goods issue not posted (VF 066), a billing block on the order, delivery or payer (VF 014, VF 064, VF 068), an incompletion log that blocks billing (VF 069) and credit management (VF 140). If the document is already fully billed, SAP says VF 017.
What does it mean if a billing document is not released to accounting?
The billing document exists but its accounting document does not, so no receivable or revenue is in FI. The posting status VBRK-RFBSK tells you why: A is a posting block, B an account determination error, F a pricing error. Fix the cause and release the document in VFX3 or VF02.
How do I avoid billing the same delivery twice from Excel?
SAP refuses to bill a reference that is already fully billed (VF 017), so a second run of the same deliveries stops row by row with that message. Pro forma invoices are the exception, because they do not update the billing status. In PostNow.ai, Run also offers to skip rows that already succeeded, and Retry Failed re-sends only rows marked ERROR.
Can I combine several deliveries into one invoice with a mass upload?
Yes, on the BAPI route: send the deliveries in one call, for example with a flat-row template split on payer, and SAP combines them where its split rules allow. Billing combines references with the same customer, billing date and sales organisation unless header data such as payment terms differs. The VF01 recording route bills one reference per row, so each delivery gets its own invoice.
How do I cancel many billing documents at once?
Record VF11, or use BAPI_BILLINGDOC_CANCEL1 with one billing document number per row; each creates a cancellation document and reverses the accounting entry. The cancel BAPI also commits inside SAP, so test it with TESTRUN = X. Pro forma invoices cannot be cancelled, and cleared invoices or closed periods need FI first.
Your delivery list. SAP's billing rules.

Bill your next batch of SAP deliveries from Excel

Map the billing once, test on a quality client, then post and check each billing document against the Billing / Invoice report.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Your data stays in your systems