Mass Production Order Creation from File Program
Short answer: A custom program that creates production orders in bulk from material, quantity and date rows in an Excel or CSV file, and optionally releases them immediately. In test mode it checks the material, production version and order type, skips duplicate orders and lists the result of each row with the order number.
- 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?
CO01 creates one order; CO40 and CO41 only convert planned orders created by MRP. Entering independent requirements in MD61 and running MRP is a planning process and does not give firm order quantities on specific dates. Planners who prepare the schedule outside SAP enter hundreds of rows one by one in CO01. The custom program creates the order for each row in the file through a BAPI and lists the result.
Who uses it? Production planners who prepare the weekly production schedule in Excel or an external planning tool, and companies producing by project or for contract customers.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| MARCPlant Data for Material | Existence of the material in the plant and procurement type | Read | ECC + S/4 |
| T399XOrder-Type-Dependent Parameters | Order type defined for the plant | Read | ECC + S/4 |
| MKALProduction Versions of Material | Validity and lock of the production version | Read | ECC + S/4 |
| AUFKOrder Master Data | New order header (through the BAPI) | Write | ECC + S/4 |
| AFKOOrder Header Data for PP Orders | Order quantity and basic dates; duplicate check | Write | ECC + S/4 |
| AFPOOrder Item | Order item: material, version, storage location | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_PRODORD_CREATECreate Production Order. Creates the production order for each valid row
- BAPI_PRODORD_RELEASERelease Production Orders. Releases the new order when requested
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful rows permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back in test mode and for failed rows
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\haftalik-uretim-programi.xlsx |
| P_AUART | Default order type | Single value | AUFK-AUART | Yes | PP01 |
| P_REL | Release orders immediately | Checkbox | — | No | — |
| P_DUPL | Skip when an open order exists for the same material and date | Checkbox | — | No | X |
| P_TEST | Test mode (check without posting) | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Material | AFPO-MATNR | Yes |
| 2 | Plant | AUFK-WERKS | Yes |
| 3 | Order type (blank = default) | AUFK-AUART | No |
| 4 | Quantity | AFKO-GAMNG | Yes |
| 5 | Basic start | AFKO-GSTRP | No |
| 6 | Basic finish | AFKO-GLTRP | Yes |
| 7 | Production version | AFPO-VERID | No |
| 8 | Storage location | AFPO-LGORT | No |
| 9 | Short text | AUFK-KTEXT | No |
Sample upload file
| 1 | Material * | Plant * | Order type (blank = default) | Quantity * | Basic start | Basic finish * | Production version | Storage location | Short text |
|---|---|---|---|---|---|---|---|---|---|
| 2 | FG-5003 | 1000 | 1,200 | 11/23/2026 | 11/25/2026 | 0001 | 0002 | Week 48 filling | |
| 3 | FG-6100 | 1000 | PP01 | 150 | 11/24/2026 | 11/27/2026 | 0001 | 0002 | Project P-118 cabinets |
| 4 | FG-7200 | 2000 | PP02 | 60 | 12/04/2026 | 0002 | 0005 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Material | AFPO-MATNR |
| 3 | Plant | AUFK-WERKS |
| 4 | Quantity | AFKO-GAMNG |
| 5 | Order | AUFK-AUFNR |
| 6 | Release | Calculated Result of BAPI_PRODORD_RELEASE: released, not requested or error |
| 7 | Status | Calculated Created, test passed, already exists or error |
| 8 | Message | Calculated BAPI return message or check error |
Sample result list
| Row | Material | Plant | Quantity | Order | Release | Status | Message |
|---|---|---|---|---|---|---|---|
| 2 | FG-5003 | 1000 | 1,200 | 1000512 | Not requested | Created | Order 1000512 saved |
| 3 | FG-6100 | 1000 | 150 | Already exists | Open order 1000437 exists on the same date | ||
| 4 | FG-7200 | 2000 | 60 | Error | Production version 0002 is locked |
How does the program work?
- The file (XLSX or CSV) is read from the user’s PC or, in a background job, from the application server; the first row is skipped as the header.
- For each row MARC confirms that the material exists in the plant and is produced in-house, T399X that the order type is defined for the plant; if a production version is given, MKAL confirms it is not locked and is valid on the date.
- With the duplicate check selected, rows for which an open order with the same material, plant and basic start date exists in AFPO/AFKO are skipped as ‘already exists’.
- For valid rows BAPI_PRODORD_CREATE is called with quantity, basic start/finish, version and storage location. In test mode the call is rolled back with BAPI_TRANSACTION_ROLLBACK.
- With ‘release immediately’ selected, the new order is released with BAPI_PRODORD_RELEASE; each row is committed separately, so a failed row does not affect the others.
- The result list shows the row, order number, release result and BAPI message; failed rows can be corrected and uploaded again with the same template.
Performance notes
BAPI_PRODORD_CREATE schedules each order and checks materials; run files above a few hundred rows as a background job. Do the check reads (MARC, MKAL, T399X) once with the keys from the file.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file Failed rows can be downloaded in the same template, corrected and uploaded again.
- Runs as a background job
Authorization objects
- C_AFKO_AWACreate and release production orders by order type
- C_AFKO_AWKProduction order authorization by plant and order type
Frequently asked questions
Can orders be linked to a sales order?
Yes. By adding sales order and item columns to the template, orders can be created for sales-order stock; the requirement class and account assignment are then checked as well, and the effort range increases by one or two days.
Does creating production orders instead of planned orders disturb MRP?
No. The new production orders are seen as firm receipts in MRP; the related planned orders are reduced or deleted in the next MRP run. Keep the duplicate check on so that the same requirement is not covered by both a planned and a production order.
Does the program work on S/4HANA?
Yes. BAPI_PRODORD_CREATE and BAPI_PRODORD_RELEASE are supported on S/4HANA. Because the production version is mandatory in S/4HANA, the program selects the valid version automatically or marks the row as failed if the version column is left blank.
Related reports
Mass Production Order Release with Component Availability Check Program
A custom background program that automatically releases production orders whose scheduled start is approaching, when the share of components covered …
Planned Order Conversion Readiness and Component Availability Report
A custom ALV report that ranks planned orders whose opening date has arrived by how much of their component demand today's stock covers. For each …
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.