Mass Internal Order Creation from Excel with Settlement Rule
Short answer: A custom program that creates internal orders in bulk from file rows, with order type, company code, responsible cost center and profit center, and adds the settlement rule to each order in the same step. It checks in test mode and lists the created order numbers.
- Estimated effort
- M · 3–4 working days
- System
- ECC and S/4HANA
- Tables
- 3
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
KO01 creates internal orders one at a time; copying from a reference order saves time, but every order is still entered separately. The settlement rule is maintained on a separate screen, often added later with KO02, and forgotten rules cause errors in the month-end settlement. Hundreds of campaign or project orders need bulk creation from a file.
Who uses it? Controllers, teams that manage marketing and campaign budgets, and CO teams that open many internal orders at the start of the year.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| AUFKOrder Master Data | Internal order master: type, short text, company code, profit center, responsible cost center | Write | ECC + S/4 |
| COBRBSettlement Rule Distribution Rules | Settlement rule: receiving cost center, percentage, settlement type | Write | ECC + S/4 |
| CSKSCost Center Master Record | Validity check of the responsible and receiving cost centers | Read | ECC + S/4 |
BAPIs and functions used
- BAPI_INTERNALORDER_CREATECreate Internal Order. Creates the internal order with master data and settlement rule
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful orders permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the change 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\kampanya_siparisleri_2027.xlsx |
| P_KOKRS | Controlling area | Single value | AUFK-KOKRS | Yes | 1000 |
| 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 | Order type | AUFK-AUART | Yes |
| 2 | Short text | AUFK-KTEXT | Yes |
| 3 | Company code | AUFK-BUKRS | Yes |
| 4 | Plant | AUFK-WERKS | No |
| 5 | Profit center | AUFK-PRCTR | No |
| 6 | Responsible cost center | AUFK-KOSTV | No |
| 7 | Receiving cost center | COBRB-KOSTL | Yes |
| 8 | Settlement percentage | COBRB-PROZS | No |
| 9 | Settlement type | COBRB-PERBZ | No |
Sample upload file
| 1 | Order type * | Short text * | Company code * | Plant | Profit center | Responsible cost center | Receiving cost center * | Settlement percentage | Settlement type |
|---|---|---|---|---|---|---|---|---|---|
| 2 | 0400 | 2027 spring campaign | 1000 | 1000 | PC1200 | 4300 | 4300 | 100 | PER |
| 3 | 0400 | Dealer meeting January 2027 | 1000 | 1000 | PC1200 | 4300 | 4310 | 100 | FUL |
| 4 | 0400 | Trade fair stand 2027 | 1000 | PC1200 | 4300 | 4399 | 100 | PER |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Order | AUFK-AUFNR |
| 3 | Short text | AUFK-KTEXT |
| 4 | Status | Calculated From the BAPI return messages: created, checked or error |
| 5 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Order | Short text | Status | Message |
|---|---|---|---|---|
| 2 | 400201 | 2027 spring campaign | Created | Order 400201 created with settlement rule |
| 3 | 400202 | Dealer meeting January 2027 | Created | Order 400202 created with settlement rule |
| 4 | Trade fair stand 2027 | Error | Cost center 4399 does not exist in controlling area 1000 |
How does the program work?
- The file is read from the user’s PC or, in a background job, from the application server; the first row is skipped as the header.
- Every row is checked: order type, company code and profit center must exist; the responsible and receiving cost centers must be valid in the controlling area (CSKS); the settlement percentage must be between 0 and 100 and the settlement type PER or FUL.
- The row is mapped to the master data structure of BAPI_INTERNALORDER_CREATE (order type, short text, company code, plant, profit center, responsible cost center) and to the settlement rule lines.
- In test mode the BAPI is called and rolled back with BAPI_TRANSACTION_ROLLBACK, so every error is visible without posting.
- In a real run BAPI_TRANSACTION_COMMIT is called after each successful order; the created order number and messages are listed per row.
Performance notes
Files with a few hundred orders run in the foreground; for thousands of orders a background job is recommended. Committing per order isolates failed rows.
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 to a separate file, corrected and uploaded again.
- Export to Excel An empty upload template can be downloaded as Excel.
- Runs as a background job
Authorization objects
- K_ORDERInternal order create authorization by order type
Frequently asked questions
Can a budget be loaded to the orders too?
Budget entry is outside the scope of this program and is done with the standard budgeting transactions. If needed, a budget column can be added to the same file with a step that enters the budget after the orders are created; this extension adds 1–2 days to the effort range.
How are order numbers assigned?
If the order type's number range is internal, the system assigns the number. If external numbering is used, an order number column is added to the template and the numbers from the file are used.
Is the order released after creation?
The initial status of the order follows the status profile of the order type. If release right after creation is required, a separate status change step can be added to the program.
Related reports
Internal Order Budget Availability Report
A custom ALV report that compares the annual or overall budget of internal orders with actual costs and open commitments, and shows the remaining …
Orders Without Settlement Rule or With Unsettled Balance Report
A custom ALV report that lists orders that received costs but have no settlement rule, and internal and production orders that still carry a balance …
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.