SD Program Custom development Background program

Scheduled Billing Job with Pre-Billing Checks and Hold List

Short answer: A custom background job that bills goods-issued, unbilled deliveries at set times and runs customer-specific checks before billing. Deliveries that fail a check are not billed; they go to a hold list with the reason and the billing team is notified by email.

Estimated effort
M · 5–7 working days
System
ECC and S/4HANA
Tables
9
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

VF04 processes the billing due list and VF06 runs it in the background with a variant. Neither applies business rules outside standard copy control: customers who require a customer PO number, payment terms or incoterms that differ from master data and goods issue dates outside the period are billed anyway and then cancelled and re-billed. A job that checks these rules before billing and reports the held items is needed.

Who uses it? Billing teams, sales operations, accounts receivable and SD consultants.

Closest standard alternatives

  • VF04 Maintain Billing Due List. Processes the billing due list; does not apply customer-specific pre-checks.
  • VF06 Background Billing. Runs billing in the background; produces no hold list or reason email.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
LIKPDelivery HeaderDeliveries to bill and goods issue dateReadECC + S/4
LIPSDelivery Item DataDelivery item, value and reference orderReadECC + S/4
VBUPSales Document: Item StatusItem billing status in ECCReadECC only
VBAKSales Document HeaderOrder header and billing blockReadECC + S/4
VBKDSales Document: Business DataCustomer PO number, payment terms and incotermsReadECC + S/4
KNVVCustomer Master Sales DataCustomer sales area data: payment terms, incoterms, billing blockReadECC + S/4
VBRKBilling Document HeaderBilling headers createdWriteECC + S/4
VBRPBilling Document: Item DataBilling items createdWriteECC + S/4
KNA1Customer Master (General Section)Customer nameReadECC + S/4

S/4HANA notes

  • VBUP → VBAP: VBUP was removed in S/4HANA; the item status fields moved directly into VBAP (sales), LIPS (delivery) and VBRP (billing).

BAPIs and functions used

  • BAPI_BILLINGDOC_CREATEMULTIPLECreate Billing Documents (Multiple). Bills the deliveries that passed the checks; also supports a test run
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves the invoices created permanently
  • SO_DOCUMENT_SEND_API1SAPoffice: Send Document with Attachments. Emails the hold list to the billing team

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_VKORGSales organizationRange / multipleVBAK-VKORGYes1000
S_VSTELShipping pointRange / multipleLIKP-VSTELNo1000
S_KUNNRShip-to partyRange / multipleLIKP-KUNNRNo200100
S_GIDATGoods issue date rangeRange / multipleLIKP-WADAT_ISTYes01.11.2026 – 17.11.2026
P_FKDATBilling date (blank = goods issue date)Single valueVBRK-FKDATNo17.11.2026
P_MAILEmail address for the hold listSingle value—No[email protected]
P_TESTTest mode (check without creating invoices)Checkbox—NoX

Result list columns

#ColumnSource
1DeliveryLIKP-VBELN
2Ship-toLIKP-KUNNR
3Customer nameKNA1-NAME1
4Goods issue dateLIKP-WADAT_IST
5Delivery valueCalculated Sum of LIPS-NETWR of the delivery
6Billing documentVBRK-VBELN
7Invoice valueVBRK-NETWR
8ResultCalculated Billed, test OK, on hold or error
9ReasonCalculated Text of the first failed check or the BAPI error message

Sample result list

DeliveryShip-toCustomer nameGoods issue dateDelivery valueBilling documentInvoice valueResultReason
80004620200100Marmara Gıda11/17/202656,4009000901256,400Billed
80004633200388Toros Yapı Market11/16/202649,6000On holdCustomer PO number missing
80004650200245Karadeniz Market11/16/202618,3000On holdPayment terms differ from master data (Z030 / Z060)
80004658300410Ege Tekstil Dış Ticaret11/17/202621,8009000901321,800Billed
A view built with fictional sample data; not real system data.

How does the program work?

  1. Deliveries in the selection are read: goods-issued (WADAT_IST filled) items whose billing status is open or partially processed (VBUP-FKSTA in ECC, LIPS-FKSTA in S/4HANA).
  2. For each delivery the order data is read and the checks run: the customer PO number (VBKD-BSTKD) must be filled for customers who require it, the payment terms (VBKD-ZTERM) and incoterms (VBKD-INCO1) on the order must match the customer’s sales area data (KNVV), there must be no billing block on the order (VBAK-FAKSK) or the customer (KNVV-FAKSD), and the goods issue date must be in an open period. Which rule applies to which customer is kept in a small rule table maintained by the business.
  3. Deliveries that pass are billed with BAPI_BILLINGDOC_CREATEMULTIPLE; in test mode the same BAPI is called as a test run and no invoice is created.
  4. Deliveries that fail are written to a hold list with the reason; the list is emailed to the billing team with SO_DOCUMENT_SEND_API1.
  5. Invoices created (VBRK, VBRP) and their values are listed in the job log; once the reason is fixed, the delivery is retried automatically in the next run.

Performance notes

Schedule the job once or a few times a day with separate variants per shipping point or sales organization. Call the BAPI in packages (for example 200 deliveries); deliveries that combine into one invoice must stay in the same package.

Features

  • Runs as a background job
  • Test mode (check without posting)
  • Line-by-line result and error log
  • Send the result by email The hold list is sent to the billing team after every run.
  • ALV list (sort, filter, subtotals) The hold list can also be displayed as an ALV with drilldown to the delivery.

Authorization objects

  • V_VBRK_FKABilling creation authorization by billing type
  • V_VBRK_VKOBilling authorization by sales organization
  • S_OC_SENDAuthorization to send email

Frequently asked questions

Does it change the invoice split rules?

No. Standard copy control decides which deliveries combine into one invoice. The program only filters which deliveries go to billing, so one faulty delivery does not hold up the whole group.

How are held deliveries released?

Once the reason is fixed on the order or in master data, the delivery is billed automatically in the next run. An authorized user can skip a specific check once for a single delivery; that decision is written to the log.

Can it be used on S/4HANA?

Yes. BAPI_BILLINGDOC_CREATEMULTIPLE is supported on S/4HANA as well; the billing status is read from LIPS instead of VBUP. It also works alongside the Fiori billing apps.

Related reports

SD Report Custom ALV report

Billing Documents Not Posted to Accounting Report

A custom ALV report that lists billing documents which exist in SD but have no accounting document yet, with the reason code, age and amount. At …

VBRK · VBRP · BKPF · KNA1

SD Report Custom ALV report

Sales Order – Delivery – Invoice Status Report

A custom ALV report that shows every sales order item on the same line as its delivery and invoice documents. You see in one list which orders have …

VBAK · VBAP · VBFA · LIKP

Let us build this program for your system

Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.

Related report: Scheduled Billing Job with Pre-Billing Checks and Hold List