# Mass Production Order Confirmation Upload Program

> A custom program that reads operation confirmations (yield, scrap, rework, activity times) coming from MES, shop-floor terminals or Excel at the end of a shift and posts them to production orders in bulk. It checks everything in test mode first, stops duplicate confirmations and lists the result of every row.

- Type: Program, Custom development, Mass upload
- Module: PP
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-production-order-confirmation-upload-program/


## Why is the standard not enough?

CO11N confirms one operation on screen; CO12 is a collective entry screen but does not read files. Entering hundreds of confirmations by hand at the end of a shift takes time and increases the risk of wrong quantities and duplicate records. A full MES interface is not needed in every plant; a file-based upload with a test mode covers most needs.

### Closest standard alternatives

- CO11N: Confirms one operation on screen; does not read files.
- CO12: A collective entry screen; rows are still entered by hand and there is no duplicate check.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| AFRU | Posted confirmations; also read for the duplicate check | Write | - | ECC + S/4 |
| AFKO | Order header and routing number (AUFPL) | Read | - | ECC + S/4 |
| AFVC | Operation number, control key and work center | Read | - | ECC + S/4 |
| AFFW | Goods movements that fail during backflush (written as standard) | Write | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_PRODORDCONF_CREATE_TT: Creates the operation confirmation as a time ticket for each row
- BAPI_TRANSACTION_COMMIT: Saves successful rows permanently
- BAPI_TRANSACTION_ROLLBACK: Rolls back the changes of a failed row

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Confirmation file (XLSX or CSV) | Single value | - | Yes |
| P_BUDAT | Default posting date (when blank in the file) | Single value | AFRU-BUDAT | No |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |
| P_CHKDUP | Duplicate confirmation check | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Production order | AFRU-AUFNR | Yes |
| Operation | AFRU-VORNR | Yes |
| Posting date | AFRU-BUDAT | No |
| Yield | AFRU-LMNGA | Yes |
| Scrap | AFRU-XMNGA | No |
| Rework | AFRU-RMNGA | No |
| Variance reason | AFRU-GRUND | No |
| Setup time (h) | AFRU-ISM01 | No |
| Machine time (h) | AFRU-ISM02 | No |
| Labor time (h) | AFRU-ISM03 | No |
| Final confirmation (X) | AFRU-AUERU | No |
| Personnel number | AFRU-PERNR | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Production order | AFRU-AUFNR |
| Operation | AFRU-VORNR |
| Confirmation no. | Calculated: AFRU-RUECK / AFRU-RMZHL returned by the BAPI |
| Status | Calculated: From the BAPI return messages: posted, posted (COGI) or error |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file (XLSX or CSV) is read from the user's PC or, in a background job, from a folder on the application server; the first row is skipped as the header.
2. Every row is checked: the order exists in AFKO, is released (REL) and not technically completed; the operation number exists in AFVC and its control key allows confirmation; the variance reason and personnel number are valid when filled.
3. Duplicate check: if AFRU already has a non-cancelled confirmation (STOKZ blank) with the same order, operation, posting date, personnel number and yield, the row is stopped with a warning.
4. The row is mapped to the time ticket structure of BAPI_PRODORDCONF_CREATE_TT: yield, scrap, rework, variance reason, setup/machine/labor activities, final confirmation and personnel number. When the posting date is blank, the default date from the selection screen is used.
5. In test mode the BAPI is called as a test run; confirmation and backflush are checked without posting.
6. In a real run BAPI_TRANSACTION_COMMIT is called after every successful row and BAPI_TRANSACTION_ROLLBACK after an error. The confirmation number (RUECK/RMZHL) and messages are listed. Goods movements that fail during backflush are written to AFFW (COGI) as standard; this is shown on the row as well.

## Authorization objects

- C_AFRU_AWK: Authorization to enter confirmations by plant and order type

## Frequently asked questions

### Do backflush and automatic goods receipt run as well?

Yes. The BAPI uses the same confirmation logic as CO11N; backflush defined on the operation and automatic goods receipt on the last operation run as standard. Movements that fail go to COGI and are shown in the result list.

### Can the file come automatically from MES?

Yes. Files that MES drops into a folder on the application server are processed periodically by a background job; processed files are moved to an archive folder.

### Can it be used on S/4HANA?

Yes. BAPI_PRODORDCONF_CREATE_TT is supported on S/4HANA as well; backflush writes material documents to MATDOC.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=pp-confirmation-upload
