PP Program Custom development Mass upload

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

  • CO01 Create Production Order. Creates one production order on screen; does not read files.
  • CO41 Collective Conversion of Planned Orders. Converts planned orders collectively; does not create orders from a list prepared outside MRP.

Tables used

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

TableRoleAccessSystem
MARCPlant Data for MaterialExistence of the material in the plant and procurement typeReadECC + S/4
T399XOrder-Type-Dependent ParametersOrder type defined for the plantReadECC + S/4
MKALProduction Versions of MaterialValidity and lock of the production versionReadECC + S/4
AUFKOrder Master DataNew order header (through the BAPI)WriteECC + S/4
AFKOOrder Header Data for PP OrdersOrder quantity and basic dates; duplicate checkWriteECC + S/4
AFPOOrder ItemOrder item: material, version, storage locationWriteECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\haftalik-uretim-programi.xlsx
P_AUARTDefault order typeSingle valueAUFK-AUARTYesPP01
P_RELRelease orders immediatelyCheckbox—No—
P_DUPLSkip when an open order exists for the same material and dateCheckbox—NoX
P_TESTTest mode (check without posting)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
1MaterialAFPO-MATNRYes
2PlantAUFK-WERKSYes
3Order type (blank = default)AUFK-AUARTNo
4QuantityAFKO-GAMNGYes
5Basic startAFKO-GSTRPNo
6Basic finishAFKO-GLTRPYes
7Production versionAFPO-VERIDNo
8Storage locationAFPO-LGORTNo
9Short textAUFK-KTEXTNo

Sample upload file

1Material *Plant *Order type (blank = default)Quantity *Basic startBasic finish *Production versionStorage locationShort text
2FG-500310001,20011/23/202611/25/202600010002Week 48 filling
3FG-61001000PP0115011/24/202611/27/202600010002Project P-118 cabinets
4FG-72002000PP026012/04/202600020005
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2MaterialAFPO-MATNR
3PlantAUFK-WERKS
4QuantityAFKO-GAMNG
5OrderAUFK-AUFNR
6ReleaseCalculated Result of BAPI_PRODORD_RELEASE: released, not requested or error
7StatusCalculated Created, test passed, already exists or error
8MessageCalculated BAPI return message or check error

Sample result list

RowMaterialPlantQuantityOrderReleaseStatusMessage
2FG-500310001,2001000512Not requestedCreatedOrder 1000512 saved
3FG-61001000150Already existsOpen order 1000437 exists on the same date
4FG-7200200060ErrorProduction version 0002 is locked
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. 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.
  3. 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’.
  4. 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.
  5. 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.
  6. 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

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 Production Order Creation from File Program