# Mass Routing Creation Upload Program from Excel

> A custom program that creates material routings in bulk from operation rows in an Excel or CSV file, with header, operations, work centers, control keys and setup/machine/labor standard values. In test mode it checks the work center and material, skips materials that already have a routing and lists the result for each routing.

- Type: Program, Custom development, Mass upload
- Module: PP
- Estimated effort: M (5–7 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-routing-creation-upload-from-excel-program/


## Why is the standard not enough?

CA01 enters one routing on screen, operation by operation; for hundreds of new materials with dozens of operations this takes days. CA85 only replaces work centers in existing routings and does not create new ones. LSMW recordings are sensitive to screen changes and are not recommended in S/4HANA; the Migration Cockpit is for the initial migration. The custom program groups the file per routing and creates it through a BAPI.

### Closest standard alternatives

- CA01: Creates one routing on screen; does not read files.
- CA85: Replaces work centers in existing routings in mass; does not create new routings.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MARC | Existence of the material in the plant | Read | MARC-MATNR = dosya malzeme AND MARC-WERKS = dosya üretim yeri | ECC + S/4 |
| CRHD | Existence and deletion flag of the work center | Read | CRHD-OBJTY = 'A' AND CRHD-ARBPL = dosya iş yeri AND CRHD-WERKS = dosya üretim yeri | ECC + S/4 |
| PLKO | Routing header: usage, status, lot size | Write | PLKO-PLNTY = 'N' AND PLKO-PLNNR = yeni rota grubu | ECC + S/4 |
| MAPL | Material – routing assignment | Write | MAPL-PLNTY = PLKO-PLNTY AND MAPL-PLNNR = PLKO-PLNNR AND MAPL-PLNAL = PLKO-PLNAL | ECC + S/4 |
| PLAS | Assignment of operations to the routing counter | Write | PLAS-PLNTY = PLKO-PLNTY AND PLAS-PLNNR = PLKO-PLNNR AND PLAS-PLNAL = PLKO-PLNAL | ECC + S/4 |
| PLPO | Operations: work center, control key, standard values | Write | PLPO-PLNTY = PLAS-PLNTY AND PLPO-PLNNR = PLAS-PLNNR AND PLPO-PLNKN = PLAS-PLNKN | ECC + S/4 |

## BAPIs and functions used

- BAPI_ROUTING_EXISTENCE_CHECK: Checks whether the material already has a routing with the same usage
- BAPI_ROUTING_CREATE: Creates the routing with header, material assignment and operations
- BAPI_TRANSACTION_COMMIT: Saves successful routings permanently
- BAPI_TRANSACTION_ROLLBACK: Rolls back in test mode and for failed routings

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | - | Yes |
| P_DATUV | Valid from | Single value | PLKO-DATUV | Yes |
| P_AENNR | Change number | Single value | PLKO-AENNR | No |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Material | MAPL-MATNR | Yes |
| Plant | MAPL-WERKS | Yes |
| Usage | PLKO-VERWE | Yes |
| Status | PLKO-STATU | No |
| Lot size from | PLKO-LOSVN | No |
| Lot size to | PLKO-LOSBS | No |
| Routing text | PLKO-KTEXT | No |
| Operation | PLPO-VORNR | Yes |
| Work center | CRHD-ARBPL | Yes |
| Control key | PLPO-STEUS | Yes |
| Operation text | PLPO-LTXA1 | No |
| Base quantity | PLPO-BMSCH | No |
| Setup time | PLPO-VGW01 | No |
| Machine time | PLPO-VGW02 | No |
| Labor time | PLPO-VGW03 | No |
| Time unit | PLPO-VGE01 | No |

## Result list columns

| Column | Source |
|---|---|
| Rows | Calculated: File row range of the routing |
| Material | MAPL-MATNR |
| Plant | MAPL-WERKS |
| Operations | Calculated: Number of rows in the group |
| Routing group | PLKO-PLNNR |
| Counter | PLKO-PLNAL |
| Status | Calculated: Created, test passed, already exists or error |
| Message | Calculated: BAPI return message or check error |

## How does the program work?

1. The file (XLSX or CSV) is read; consecutive rows with the same material, plant and usage are grouped into one routing, each row being an operation.
2. MARC confirms the material exists in the plant, CRHD that the work center is defined for the plant and not flagged for deletion; operation numbers must be ascending and unique.
3. BAPI_ROUTING_EXISTENCE_CHECK checks whether the material already has a routing with the same usage; if so, the routing is skipped as 'already exists'.
4. For valid groups BAPI_ROUTING_CREATE is called with the header (usage, status, lot size range, text), the material assignment and the operations (work center, control key, text, base quantity, VGW01–VGW03 and unit); the valid-from date and change number come from the selection screen.
5. In test mode the call is rolled back with BAPI_TRANSACTION_ROLLBACK; in a real run each routing is committed separately.
6. The result list shows routing group, counter, number of operations and the BAPI message; rows of failed routings can be downloaded as an error file.

## Authorization objects

- C_ROUT: Authorization to create routings
- C_ROUT_MAT: Assignment of the routing to materials

## Frequently asked questions

### Can component allocation and production resources/tools be loaded too?

The base template covers operations and standard values. Allocation of BOM components to operations and production resources/tools can be added to the template as separate sheets; each extra object increases the effort range.

### Can existing routings be updated?

This program creates new routings. A separate change mode working with change numbers can be added to update standard values in existing routings; the changes can be audited in the routing standard value change report.

### Does the program work on S/4HANA?

Yes. BAPI_ROUTING_CREATE is supported on S/4HANA. Because S/4HANA also needs a production version to use the routing, the program can optionally produce a version proposal for the new routing.

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