Mass Purchase Order Creation from Excel Program
Short answer: A custom program that creates purchase orders in bulk from Excel or CSV rows, grouping them by vendor, purchasing organization and group number. It checks all rows in test mode first, then lists the number created for each order and the messages per row.
- Estimated effort
- M · 5–7 working days
- System
- ECC and S/4HANA
- Tables
- 7
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
ME21N creates each order one at a time on screen. ME59N only converts existing purchase requisitions; it does not cover bulk orders placed without a requisition. LSMW recordings are fragile on the ME21N Enjoy screens. Project purchases with hundreds of items or periodic price-list orders need a templated upload with a test mode.
Who uses it? Buyers, project buying teams and teams that regularly place bulk orders from price lists.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| EKKOPurchasing Document Header | Order header: vendor, organization, document type | Write | ECC + S/4 |
| EKPOPurchasing Document Item | Order item: material, plant, quantity, price | Write | ECC + S/4 |
| EKETPurchasing Schedule Lines | Schedule line and delivery date | Write | ECC + S/4 |
| EKKNAccount Assignment in Purchasing Document | Account assignment: cost center or WBS element | Write | ECC + S/4 |
| LFM1Vendor Master: Purchasing Organization Data | Vendor purchasing organization data and block (check) | Read | ECC + S/4 |
| MARCPlant Data for Material | Material exists in the plant (check) | Read | ECC + S/4 |
| EINEPurchasing Info Record: Purchasing Organization Data | Info record net price when the price is blank | Read | ECC + S/4 |
BAPIs and functions used
- BAPI_PO_CREATE1Create Purchase Order. Creates each order group as one purchase order; only checks in test mode
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves a successful order permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the changes of a failed order
- TEXT_CONVERT_XLS_TO_SAPConvert Excel File to SAP Format. Reads the Excel file into an internal table
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\siparisler.xlsx |
| P_BSART | Order document type | Single value | EKKO-BSART | Yes | NB |
| P_TEST | Test mode (check without posting) | Checkbox | — | No | X |
| P_INFO | Take price from info record if blank | 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 | Group no (same number = same order) | By rule Grouping key in the file; together with vendor and organization it defines the order header | Yes |
| 2 | Vendor | EKKO-LIFNR | Yes |
| 3 | Purchasing organization | EKKO-EKORG | Yes |
| 4 | Purchasing group | EKKO-EKGRP | Yes |
| 5 | Company code | EKKO-BUKRS | Yes |
| 6 | Material (blank for text items) | EKPO-MATNR | No |
| 7 | Short text | EKPO-TXZ01 | No |
| 8 | Plant | EKPO-WERKS | Yes |
| 9 | Quantity | EKPO-MENGE | Yes |
| 10 | Unit | EKPO-MEINS | No |
| 11 | Net price (blank = info record) | EKPO-NETPR | No |
| 12 | Delivery date | EKET-EINDT | Yes |
| 13 | Account assignment category | EKPO-KNTTP | No |
| 14 | Cost center | EKKN-KOSTL | No |
| 15 | WBS element | EKKN-PS_PSP_PNR | No |
Sample upload file
| 1 | Group no (same number = same order) * | Vendor * | Purchasing organization * | Purchasing group * | Company code * | Material (blank for text items) | Short text | Plant * | Quantity * | Unit | Net price (blank = info record) | Delivery date * | Account assignment category | Cost center | WBS element |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | 100245 | 1000 | 001 | 1000 | RM-1001 | Carton box 40x30 | 1000 | 5,000 | PC | 12/05/2026 | ||||
| 3 | 1 | 100245 | 1000 | 001 | 1000 | RM-1002 | Stretch film 50 cm | 1000 | 800 | KG | 38.50 | 12/05/2026 | |||
| 4 | 2 | 100700 | 1000 | 003 | 1000 | Site freight service | 1000 | 1 | PC | 45,000 | 12/10/2026 | P | P-26-0012-03 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Group no | Calculated Group number from the file |
| 3 | Vendor | EKKO-LIFNR |
| 4 | Purchase order | EKKO-EBELN |
| 5 | Item | EKPO-EBELP |
| 6 | Net value | EKPO-NETWR |
| 7 | Status | Calculated From the BAPI return messages: checked, created or error |
| 8 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Group no | Vendor | Purchase order | Item | Net value | Status | Message |
|---|---|---|---|---|---|---|---|
| 2 | 1 | 100245 | 4500013301 | 00010 | 8,500 | Created | Purchase order 4500013301 created |
| 3 | 1 | 100245 | 4500013301 | 00020 | 30,800 | Created | Purchase order 4500013301 created |
| 4 | 2 | 100700 | 0 | Error | WBS element P-26-0012-03 is not an account assignment element |
How does the program work?
- The file is read from the user’s PC (TEXT_CONVERT_XLS_TO_SAP) or, in a background job, from the application server; rows are split into order headers by group number, vendor, purchasing organization, purchasing group and company code.
- Every row is checked: the vendor’s purchasing organization data (LFM1) and blocks, the material existing in the plant (MARC), the unit of measure, the delivery date and the account assignment. If the price is blank, it is taken from the valid purchasing info record (EINE).
- Rows are mapped to the BAPI_PO_CREATE1 structures: POHEADER, POITEM, POSCHEDULE and, for account-assigned items, POACCOUNT (cost center or WBS element).
- In test mode the BAPI is called with TESTRUN = X, so all errors and warnings are visible without a number being assigned.
- In a real run BAPI_TRANSACTION_COMMIT is called after each successful order and BAPI_TRANSACTION_ROLLBACK after a failed one; the result list shows the order number and row messages, and failed rows can be downloaded as a separate file.
Performance notes
Committing per order isolates failed orders. Run files above a few thousand rows as a background job. For order types with a release strategy, the created orders enter the normal release flow.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file The corrected file can be uploaded again with the same template.
- Export to Excel An empty upload template can be downloaded as Excel.
- Runs as a background job
Authorization objects
- M_BEST_BSAPurchase order create authorization by document type
- M_BEST_EKOPurchase order create authorization by purchasing organization
- M_BEST_EKGPurchase order create authorization by purchasing group
- M_BEST_WRKPurchase order create authorization by plant
Frequently asked questions
Do the created orders go through the release strategy?
Yes. BAPI_PO_CREATE1 creates the order with the standard rules; if the order type and value match a release strategy, the order waits for release.
Can conditions (discounts, freight) be loaded too?
They can be loaded through the POCOND structure by adding condition type and amount columns to the template. Each extra field group increases the effort range.
Can this program be used on S/4HANA?
Yes. BAPI_PO_CREATE1 is supported on S/4HANA. For a clean core approach, the same file logic can also be built on the purchase order API.
Packages that include this solution
Excel Mass Data Upload Pack
A pack that puts the five bulk uploads key users run most often into one upload structure: material master, equipment master with installation at a …
Related reports
Purchasing Contract Utilization and Remaining Balance Report
A custom ALV report that lists, for quantity and value contracts, how much of the target quantity and value has been used by release orders, the …
Open Purchase Orders by Vendor Report
A custom ALV report that shows, per vendor, the quantity not yet received, the open order value and the days of delay since the delivery date in a …
Released Purchase Requisitions Not Yet Converted to Purchase Orders Report
A custom ALV report that lists released purchase requisition items not yet converted to a purchase order, with open quantity, open value and days …
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.