# Mass Change Program for Open Sales Orders (Delivery Date, Ship-to, Rejection Reason)

> A custom program that changes the requested delivery date, the ship-to and the reason for rejection on open sales orders in bulk, from the rows of a file. It makes the changes through the standard BAPI, can redetermine pricing, checks everything in test mode first and logs the old and new value of every row.

- Type: Program, Custom development, Mass upload
- Module: SD
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-change-open-sales-orders-program/


## Why is the standard not enough?

VA02 changes one order. MASS can make mass changes, but it does not read a file, does not always redetermine schedule lines, route and pricing as expected, and gives no test result per row. After a supply delay, changing the date or the ship-to of hundreds of orders needs a controlled program that keeps a log.

### Closest standard alternatives

- VA02: Changes one order; no mass change and no file input.
- MASS: Can make mass changes; does not read a file and gives no test result per row.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| VBAK | Order header and sold-to (check) | Read | VBAK-VBELN = dosyadaki sipariş | ECC + S/4 |
| VBAP | Reason for rejection of the item | Write | VBAP-VBELN = VBAK-VBELN | ECC + S/4 |
| VBEP | Requested delivery date in the schedule line | Write | VBEP-VBELN = VBAP-VBELN AND VBEP-POSNR = VBAP-POSNR | ECC + S/4 |
| VBPA | Ship-to partner | Write | VBPA-VBELN = VBAK-VBELN AND VBPA-PARVW = malı teslim alan rolü | ECC + S/4 |
| VBUP | Item overall and delivery status (check) | Read | VBUP-VBELN = VBAP-VBELN AND VBUP-POSNR = VBAP-POSNR | ECC only |
| KNVP | Permitted ship-to partners of the sold-to (check) | Read | KNVP-KUNNR = VBAK-KUNNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_SALESORDER_CHANGE: Changes the date, partner and rejection reason on the order
- BAPI_TRANSACTION_ROLLBACK: Rolls back the change in test mode
- BAPI_TRANSACTION_COMMIT: Saves successful changes permanently

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Change file (XLSX or CSV) | Single value | - | Yes |
| P_PRICE | Redetermine pricing for changed items | Checkbox | - | No |
| P_TEST | Test mode (check without saving) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Sales order | VBAP-VBELN | Yes |
| Item (blank = all items) | VBAP-POSNR | No |
| New requested delivery date | VBEP-EDATU | No |
| New ship-to | VBPA-KUNNR | No |
| Reason for rejection | VBAP-ABGRU | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Sales order | VBAP-VBELN |
| Item | VBAP-POSNR |
| Changed field | Calculated: The field filled in the file: delivery date, ship-to or rejection reason |
| Old value | Calculated: VBEP-EDATU, VBPA-KUNNR or VBAP-ABGRU before the change |
| New value | Calculated: Value from the file |
| Status | Calculated: From the BAPI return messages: checked, changed or error |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file is read; each row holds the order, the item and the fields to change (new requested delivery date, new ship-to, reason for rejection).
2. Checks: the order must exist and be open (VBUP-GBSTA ≠ C); for a date change the item must not be fully delivered (VBUP-LFSTA ≠ C); the new ship-to must be among the partners of the sold-to (KNVP).
3. The old values are read from VBEP, VBPA and VBAP and logged.
4. The header, item, schedule line and partner change structures of BAPI_SALESORDER_CHANGE are filled with their update flags (X structures); with pricing redetermination selected, pricing is triggered through LOGIC_SWITCH.
5. In test mode the BAPI is called and rolled back with BAPI_TRANSACTION_ROLLBACK; in a real run BAPI_TRANSACTION_COMMIT follows each successful order. Old value, new value and message are listed per row.

## Authorization objects

- V_VBAK_VKO: Sales document change authorization by sales area
- V_VBAK_AAT: Change authorization by order type

## Frequently asked questions

### What happens to the confirmation and schedule lines when the date changes?

After changing the requested date, the BAPI runs the standard availability check; the confirmed date and quantity are redetermined according to SAP rules. The resulting messages are written to the log.

### Can items that already have a delivery be changed?

Dates and rejection reasons are not changed on fully delivered items; the program flags these rows as errors. For partially delivered items, the open quantity can be changed.

### Can this program be used on S/4HANA?

Yes. BAPI_SALESORDER_CHANGE is supported on S/4HANA; the status checks use the status fields in VBAP instead of VBUP.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=sd-open-order-mass-change
