SD Program Custom development Mass upload

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

Short answer: 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.

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

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.

Who uses it? Customer service, sales operations and planning teams; users who update the dates of many orders after a production or supply delay.

Closest standard alternatives

  • VA02 Change Sales Order. Changes one order; no mass change and no file input.
  • MASS Mass Change. Can make mass changes; does not read a file and gives no test result per row.

Tables used

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

TableRoleAccessSystem
VBAKSales Document HeaderOrder header and sold-to (check)ReadECC + S/4
VBAPSales Document ItemReason for rejection of the itemWriteECC + S/4
VBEPSales Document: Schedule Line DataRequested delivery date in the schedule lineWriteECC + S/4
VBPASales Document: PartnersShip-to partnerWriteECC + S/4
VBUPSales Document: Item StatusItem overall and delivery status (check)ReadECC only
KNVPCustomer Master Partner FunctionsPermitted ship-to partners of the sold-to (check)ReadECC + 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_SALESORDER_CHANGEChange Sales Order. Changes the date, partner and rejection reason on the order
  • BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the change in test mode
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful changes permanently

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEChange file (XLSX or CSV)Single value—YesC:\temp\siparis_degisiklik.xlsx
P_PRICERedetermine pricing for changed itemsCheckbox—No—
P_TESTTest mode (check without saving)Checkbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Sales orderVBAP-VBELNYes
2Item (blank = all items)VBAP-POSNRNo
3New requested delivery dateVBEP-EDATUNo
4New ship-toVBPA-KUNNRNo
5Reason for rejectionVBAP-ABGRUNo

Sample upload file

1Sales order *Item (blank = all items)New requested delivery dateNew ship-toReason for rejection
2000012345500001011/28/2026
30000123498200425
4000012351200003005
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Sales orderVBAP-VBELN
3ItemVBAP-POSNR
4Changed fieldCalculated The field filled in the file: delivery date, ship-to or rejection reason
5Old valueCalculated VBEP-EDATU, VBPA-KUNNR or VBAP-ABGRU before the change
6New valueCalculated Value from the file
7StatusCalculated From the BAPI return messages: checked, changed or error
8MessageCalculated First error or success message from the BAPI return table

Sample result list

RowSales orderItemChanged fieldOld valueNew valueStatusMessage
20000123455000010Delivery date11/20/202611/28/2026ChangedSales order 123455 saved
30000123498000000Ship-to200422200425ChangedSales order 123498 saved
40000123512000030Rejection reason05ErrorItem is fully delivered; no rejection reason allowed
A view built with fictional sample data; not real system data.

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.

Performance notes

Group the rows of the same order and change the order in a single BAPI call; this reduces lock conflicts and unnecessary repricing. Run large files in the background.

Features

  • Test mode (check without posting)
  • Line-by-line result and error log
  • Download failed lines as a separate file Failed rows can be corrected and uploaded again with the same template.
  • Export to Excel A change template pre-filled from selected orders can be downloaded as Excel.
  • Runs as a background job

Authorization objects

  • V_VBAK_VKOSales document change authorization by sales area
  • V_VBAK_AATChange 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.

Related reports

SD Program Custom Mass upload

Mass Sales Order Creation from Excel Program

A custom program that creates sales orders in bulk from the rows of an order file sent by the customer. It groups rows into orders by customer PO …

VBAK · VBAP · VBEP · VBKD

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: Mass Change Program for Open Sales Orders (Delivery Date, Ship-to, Rejection Reason)