# Overnight Outbound Delivery Creation Job for Due Sales Orders with Exception List

> A custom background program that creates outbound deliveries every night for confirmed sales order items whose material availability date has come, and lists the orders it could not deliver with their reason, such as credit block, delivery block, incomplete data or missing confirmation, and emails that list to the shipping team.

- Type: Program, Custom development, Background program
- Module: SD
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/overnight-outbound-delivery-creation-job-with-exception-list/


## Why is the standard not enough?

VL10A can also run delivery creation in the background with a variant, but its collective processing log only holds messages for the orders it processed. Orders that were never selected because of a credit block, a delivery block or missing confirmation do not appear in the log, and nobody is informed. VA14L gives orders blocked for delivery in a separate list. The custom job creates the deliveries and sends the "why no delivery" list to the responsible team every morning.

### Closest standard alternatives

- VL10A: Creates deliveries for due orders and can run in the background; does not report why orders were not selected.
- VA14L: Lists orders blocked for delivery; does not create deliveries or show missing confirmations.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| VBAK | Order header: customer, delivery block, complete delivery indicator | Read | - | ECC + S/4 |
| VBAP | Item: material, shipping point, delivery priority | Read | VBAP-VBELN = VBAK-VBELN | ECC + S/4 |
| VBEP | Material availability date, confirmed quantity, schedule-line block | Read | VBEP-VBELN = VBAP-VBELN AND VBEP-POSNR = VBAP-POSNR | ECC + S/4 |
| VBUK | Credit status and incompletion status for delivery in ECC | Read | VBUK-VBELN = VBAK-VBELN | ECC only |
| KNA1 | Customer name | Read | KNA1-KUNNR = VBAK-KUNNR | ECC + S/4 |
| LIKP | Delivery headers created | Write | - | ECC + S/4 |
| LIPS | Delivery items and quantities created | Write | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_OUTB_DELIVERY_CREATE_SLS: Creates outbound deliveries for the order items that passed the checks
- BAPI_TRANSACTION_COMMIT: Saves the deliveries created permanently
- SO_DOCUMENT_SEND_API1: Emails the exception list to the shipping team

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_VSTEL | Shipping point | Range / multiple | VBAP-VSTEL | Yes |
| S_VKORG | Sales organization | Range / multiple | VBAK-VKORG | No |
| S_KUNNR | Sold-to party | Range / multiple | VBAK-KUNNR | No |
| S_LPRIO | Delivery priority | Range / multiple | VBAP-LPRIO | No |
| P_DUEDT | Material availability date upper limit (default: tomorrow) | Single value | VBEP-MBDAT | Yes |
| P_COMPL | Hold orders requiring complete delivery that have unconfirmed items | Checkbox | - | No |
| P_MAIL | Email address for the exception list | Single value | - | No |
| P_TEST | Test mode (check without creating deliveries) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Sales order | VBAK-VBELN |
| Item | VBAP-POSNR |
| Customer | VBAK-KUNNR |
| Customer name | KNA1-NAME1 |
| Material | VBAP-MATNR |
| Availability date | VBEP-MBDAT |
| Confirmed qty | VBEP-BMENG |
| Delivery | LIKP-VBELN |
| Delivery qty | LIPS-LFIMG |
| Result | Calculated: Created, test OK, on hold or error |
| Reason | Calculated: Text of the first failed pre-check or the BAPI error message |

## How does the program work?

1. Selection: from the schedule lines of open order items at the shipping point (VBAP-VSTEL), those whose material availability date (VBEP-MBDAT) is not later than the upper limit are taken; fully delivered items are skipped (VBUP-LFSTA in ECC, VBAP-LFSTA in S/4HANA).
2. Pre-checks and reasons: header delivery block (VBAK-LIFSK), schedule-line delivery block (VBEP-LIFSP), credit status (VBUK-CMGST in ECC, VBAK-CMGST in S/4HANA), data incomplete for delivery (VBUK-UVVLK in ECC), zero confirmed quantity (VBEP-BMENG) and, if selected, an unconfirmed item on an order that requires complete delivery (VBAK-AUTLF).
3. Items that pass are passed to BAPI_OUTB_DELIVERY_CREATE_SLS per order; split rules by shipping point, date and ship-to follow the standard delivery logic.
4. BAPI_TRANSACTION_COMMIT is called after each successful order; the delivery number and quantity created (LIKP, LIPS) are written to the result list. In test mode only the pre-checks run and the items that would be delivered are listed.
5. Held and failed lines are emailed to the shipping team with SO_DOCUMENT_SEND_API1; the full list stays in the job spool.

## Authorization objects

- V_LIKP_VST: Authorization to create deliveries by shipping point
- V_VBAK_VKO: Authorization to read orders by sales area
- S_OC_SEND: Authorization to send email (for the job user)

## Frequently asked questions

### Why a custom job instead of a VL10A background run?

The standard background run creates the deliveries but gives no reason for orders that were never selected. The custom job uses the same delivery logic through the BAPI and writes a reason for every order on hold, so customer service knows the problem before the customer calls.

### Do the delivery split rules change?

No. Split criteria such as shipping point, ship-to, route and date come from the standard delivery creation and copy control settings; the program only decides which items go to delivery.

### Does the program work on S/4HANA?

Yes. BAPI_OUTB_DELIVERY_CREATE_SLS is also used in S/4HANA. Status fields are read from VBAK and VBAP instead of VBUK/VBUP; for warehouses that run EWM, the warehouse request is distributed by the standard after the delivery is created.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=sd-overnight-delivery-creation-exceptions
