Quick answer

How to do an ME51N mass upload from Excel

ME51N in SAP creates a purchase requisition: internal demand for a material or service at a plant, by a date, often charged to a cost object. For SAP purchase requisition automation, PostNow.ai creates requisitions from Excel through BAPI_PR_CREATE, the BAPI behind ME51N, so an ME51N mass upload is one H row per requisition with D rows for its items. Validate checks the sheet offline, Simulate lets SAP check every requisition and rolls it back, and Run writes each requisition number back to its row.

  • Use the Enjoy BAPI. According to SAP Note 1803189, BAPI_PR_CREATE replaces the older BAPI_REQUISITION_CREATE, and SAP Note 217437 is titled "ME21N/ME51N: Batch input and CATT not possible".
  • SAP's rules still run. Account assignment checks, source determination and release strategy apply to a BAPI-created requisition as they do in ME51N.

This page covers one job: the ME51N mass upload, raising purchase requisitions in bulk from a demand file. Turning those requisitions into orders, or loading purchase orders directly, is covered in ME21N mass upload. The whole purchase-to-pay chain is in SAP process automation, and the other MM uploads, from goods receipts to invoices, are in SAP MM mass upload.

SAP purchase requisition automation: create requisitions from Excel with PostNow.ai

PostNow.ai treats an ME51N mass upload as a template: a designer builds it once against your SAP system and publishes it, and requesters or buyers run their own demand files through it, each user under their own SAP login on their own computer.

  1. Start from the template or the BAPI. Download the free ME51N purchase requisition template, whose field guide names the BAPI_PR_CREATE structure and field behind every column, or search for BAPI_PR_CREATE by name in your own system. Mapping AI reads the column headings and proposes the field mapping; it sees the headings and the BAPI's field list, never your cell values.
  2. One H row per requisition, one D row per item. A marker column groups an H row (document type, such as NB) with its D rows: material or short text, quantity, unit, delivery date, plant, purchasing group, valuation price, account assignment and, where known, a vendor. The D rows fill the PRITEM table, and account-assigned items also fill PRACCOUNT.
  3. Let PostNow.ai set the X flags. Every data structure of the BAPI has an X twin that tells SAP which fields to take, and a value without its flag is ignored. PostNow.ai sets the flag for each field you map. In PRITEMX the item number is a key, not a flag, so PostNow.ai copies the real item number (00010) across at run time, and copies it into the PRACCOUNT line built from the same D row. Review X-pairs shows every pair before the first run.
  4. Validate the sheet. Validate checks every cell offline: required fields, type, length, date format and allowed values, such as an allow-list of account assignment categories. Whether a material is maintained for the plant or a cost center is valid on the date is SAP's answer, and that comes in Simulate.
  5. Simulate. PostNow.ai calls BAPI_PR_CREATE for every requisition and then BAPI_TRANSACTION_ROLLBACK instead of a commit, so SAP's own messages appear on each H row and no requisition is created.
  6. Run. For each requisition PostNow.ai calls the BAPI and commits with BAPI_TRANSACTION_COMMIT only when SAP returned no error; otherwise it rolls back. In the template's Run Log Message settings, on the Save to Excel tab, save the BAPI's NUMBER export to an Excel column: each H row then receives the requisition number SAP assigned, and its Run Log line records user, time and system.
  7. Re-run only what failed. Retry Failed re-posts only the requisitions marked ERROR. If someone clicks Run again on the same sheet, PostNow.ai first lists the requisitions whose Run Log already shows a success and offers Skip posted rows, Post again or Cancel before anything is sent to SAP.

Where a budget holder wants to see the demand before it enters SAP, an approval policy on the template holds the run until an approver has reviewed the rows in the PostNow.ai portal. The approval is tied to that exact data, so a sheet changed after approval needs approval again. SAP's own release strategy still applies afterwards, inside SAP.

Posting route: ME51N recording or BAPI_PR_CREATE

PostNow.ai can post a requisition template through BAPI_PR_CREATE or by replaying a recording of ME51N. For requisitions we start with the BAPI, and the table shows why.

RouteUse it whenWhat to plan for
PostNow.ai, BAPI mode on BAPI_PR_CREATEMaterial and text items, several items per requisition, account-assigned or stock demand, from one sheetFields that exist only on a screen; customer fields go through EXTENSIONIN, which you declare in the template
PostNow.ai, recording mode on ME51NA simple single-item requisition where you want the exact screens your requesters useSAP Note 217437, "ME21N/ME51N: Batch input and CATT not possible". Prove the recording on a few rows before any volume.
BAPI_REQUISITION_CREATEPrograms written for the pre-Enjoy ME51 that are still in useNote 1803189 names BAPI_PR_CREATE as its successor; new templates use the Enjoy BAPI

Why the Enjoy BAPI. According to SAP's FAQ note on purchase requisition BAPIs (Note 499627), BAPI_REQUISITION_CREATE and BAPI_REQUISITION_CHANGE do not cover all the functions of the ME51N and ME52N transactions, and BAPI_PR_CREATE and BAPI_PR_CHANGE are released as of ERP 6.0. SAP Note 1803189, the FAQ on the end of support for ME21, ME51 and BAPI_PO_CREATE, names BAPI_PR_CREATE and BAPI_PR_CHANGE as the successors of the old pair. The new pair share one structure set (PRHEADER, PRITEM, PRACCOUNT and their X twins), so a creation template and a later change template look alike.

It is the BAPI SAP itself points to. BAPI_PR_CREATE ("Create Enjoy Purchase Requisition", function group 2105) implements method CreateFromData1 of business object PurchaseRequisition. SAP's own S/4HANA developer tutorial uses it as the API to wrap when an ABAP Cloud program needs to create requisitions (SAP tutorial). Before building, open it in SE37 on your system: the parameters for your release are listed there, and the Attributes tab shows the Remote-Enabled Module setting.

One call per requisition. Note 499627 also answers "no" to calling BAPI_PR_CREATE or BAPI_PR_CHANGE several times in sequence for the same requisition. PostNow.ai sends one H row and its D rows as one call and commits it, so each requisition is complete in its own call.

BAPI_PR_CREATE parameters a requisition upload uses

ParameterWhat it carriesExcel side
PRHEADER / PRHEADERXDocument type (PR_TYPE), and optionally AUTO_SOURCE (automatic source determination) and PREQ_NO for external numberingH row
PRITEM / PRITEMXItem number, material or short text, material group, quantity, unit, delivery date, plant, storage location, purchasing group and organisation, valuation price (PREQ_PRICE), price unit, requisitioner, tracking number, account assignment category, desired and fixed vendor, contract, info recordOne D row per item
PRACCOUNT / PRACCOUNTXItem number, sequence number (SERIAL_NO), G/L account, cost center, order, WBS element, assetSame D row, account-assigned items only
PRITEMTEXT, PRHEADERTEXTItem and header long textsOptional text columns
EXTENSIONINCustomer fieldsDeclared as extensions in the template
TESTRUNTest indicatorLeft empty: Simulate calls BAPI_TRANSACTION_ROLLBACK instead of a commit
NUMBER, RETURNThe new requisition number; SAP's messagesWritten back to the H row

Service requisitions are a separate design. BAPI_PR_CREATE has service tables (SERVICELINES, SERVICELIMIT and their X twins), but according to Note 499627 creating service items needs Enhancement Package 4 with the business function LOG_MM_CI_2 active (switched on in SFW5); SAP KBA 1950319 gives sample records for service and limit requisitions (SAP KBA 1950319). Build and simulate a service template on its own before you mix it with goods items.

The ME51N fields you have to map

A PostNow.ai requisition template is shorter than a purchase order template, because vendor and price can still be open. These are the columns that decide whether a requisition is created and whether it converts cleanly later.

ColumnBAPI fieldWhat to know
Document typePRHEADER-PR_TYPENB is the standard requisition. The document type brings the number range, the allowed item categories and, for release, whether the requisition is released as a whole or item by item.
Material or Short textPRITEM-MATERIAL, SHORT_TEXTWith a material, SAP takes the description and material group from the material master. A text item has no material, so it needs Short Text, Material Group and a unit in the file.
Quantity and UnitQUANTITY, UNITKeep the unit as text; it is the internal unit of measure your system uses.
Delivery dateDELIV_DATEA date field. Set the date format on the column, and plan dates around the planned delivery time and the factory calendar.
Plant, Purchasing groupPLANT, PUR_GROUPMap both as columns or fixed values. The BAPI gets only what the template sends, not a requester's ME51N personal defaults.
Valuation pricePREQ_PRICE, PRICE_UNITPREQ_PRICE is a BAPI amount field with 9 decimals. The price times the quantity gives the item value that a value-based release strategy reads.
Requisitioner, Tracking numberPREQ_NAME, TRACKINGNOFree fields that let a requester find their demand again in ME53N and in the buyer's worklist.

Material maintained for the plant. A material without a purchasing view at the plant on the row returns ME 034 "Plant & not created for material &" or ME 046 "Material & not maintained by Purchasing". On a file for a new site that is often every row, so the material extension comes first; see mass create materials with MM01.

Account assignment on requisitions: K, F, P and A

PostNow.ai sends the account assignment category in PRITEM-ACCTASSCAT and the cost object in a PRACCOUNT line built from the same D row. Which fields SAP then requires is set per category in your purchasing Customizing, so read the table as the usual pattern.

CategoryCost objectPRACCOUNT fields usually needed
KCost centerGL_ACCOUNT, COSTCENTER
FOrderGL_ACCOUNT, ORDERID
PProjectGL_ACCOUNT, WBS_ELEMENT
AAssetASSET_NO (and SUB_NUMBER where used)
blankStock itemNo PRACCOUNT line
  • Give SERIAL_NO a value. Each account assignment line has a two-digit sequence number. For one assignment per item, a fixed value of 01 does it.
  • Pad the cost objects. Set leading zeros with a target length on the G/L account and cost center columns (both 10 characters). A cost center typed as 4120 in Excel is 0000004120 in SAP.
  • Category set, no line sent. SAP answers 06 436 "In case of account assignment, please enter acc. assignment data for item". Map PRACCOUNT with its X twin.
  • The material can force a category. A material that may not be requested to stock returns ME 062 "Account assignment mandatory for material & (enter acc. ass. cat.)".
  • Cost objects must exist first. Projects and orders that are created for the same initiative have to be in SAP before the requisitions that reference them. Cost centers in bulk are covered in KS01 mass cost center creation.
  • The assignment carries forward. When a buyer converts the requisition, category and cost object pass into the purchase order item, so an error here becomes an error on the order.

Source of supply: desired vendor, fixed vendor, contract and info record

PostNow.ai sends whichever source fields the template maps, and SAP's source determination does the rest. The four fields mean different things, and requesters often mix them up.

FieldBAPI fieldWhat SAP does with it
Desired vendorPRITEM-DES_VENDORA suggestion from the requester. The buyer can source elsewhere.
Fixed vendorPRITEM-FIXED_VEND with PURCH_ORGAn assigned source. The requisition can then be converted without a sourcing step.
ContractAGREEMENT, AGMT_ITEMAssigns an outline agreement item as the source.
Info recordINFO_RECAssigns the purchasing info record that supplies vendor and price conditions.

Automatic source determination can change what you sent. With PRHEADER-AUTO_SOURCE set, or where Customizing determines a source for the material, SAP assigns one from the source list, quota arrangement or contracts. SAP KBA 1896111 covers exactly the case where the fixed vendor on the created requisition differs from the value passed to BAPI_PR_CREATE (SAP KBA 1896111). Decide with purchasing which fields the file fills and which ones source determination owns, and check the assigned source on the first Simulate and the pilot.

Explain the vendor column to requesters. A desired vendor does not secure that supplier. Put that sentence in the template's field notes, and leave the column empty rather than guessed.

Release strategy on uploaded requisitions

PostNow.ai creates each requisition through BAPI_PR_CREATE under the user's own SAP login, so SAP determines the release strategy for it as it does for a requisition entered in ME51N. SAP KBA 1497235, on release strategies that are not determined, lists BAPI_PR_CREATE next to ME51N for the same symptom (SAP KBA 1497235).

  • Overall or item-wise release comes from Customizing. SAP Help states that the document type determines whether a requisition is released as a whole or item by item (SAP Help). With item-wise release, a value-based strategy usually reads the item value (characteristic CEBAN-GSWRT); with overall release, the total of the requisition (CEBAN-GFWRT). Ask purchasing which one your document type uses before you promise approvers a number of approvals.
  • The valuation price decides the approval level. Where the strategy is value-based, PREQ_PRICE times the quantity is what it evaluates. Review the price column with the same care as the quantities.
  • Grouping changes the totals. With overall release, how items are grouped into requisitions decides each document's value. Group by requester, project or cost object, as purchasing agrees, and never to stay under an approval limit.
  • Warn the approvers. A run of 300 requisitions can land 300 release items in an inbox that normally sees a few a day.
  • Unreleased means not yet buyable. A requisition that is still waiting for release is not offered for conversion to a purchase order, so the run is finished for procurement only when the release queue has been worked.

Grouping and numbering: how rows become requisitions

PostNow.ai turns each H row and the D rows below it into one requisition, one BAPI_PR_CREATE call and one number. Thirty H rows create thirty requisitions, however many items sit under them.

  • A reference column keeps the groups readable. The free template carries a PR Ref (PR-0001, PR-0002) on every row, so a reviewer sees each requisition as a block and the H/D marker does the grouping.
  • Number items with gaps. 00010, 00020, 00030, so items can be added later in ME52N without renumbering. Item numbers must be unique within each requisition.
  • Internal numbering by default. SAP takes the next number from the range assigned to the document type, and NUMBER returns it. With an external range, the number goes in PRHEADER-PREQ_NO and must lie in that range.
  • Keep item types apart. Stock items, account-assigned items and text items need different columns. One sheet per type keeps every column meaningful on every row and makes a failure easier to read.

From purchase requisition to purchase order

PostNow.ai writes each requisition number back to its row, which gives the buyer a worklist; the conversion itself happens in SAP purchasing. Plant, quantity, delivery date, account assignment and any assigned source pass into the purchase order item, and the buyer adds what the requisition left open: vendor, price and terms.

Conversion routeTransactionWhen it fits
Purchase order with reference to the requisitionME21NA buyer works through requisitions one order at a time
Assign and process requisitionsME57Requisitions still need a source; the buyer assigns one and creates orders from the list
Automatic creation of purchase ordersME59NRequisitions with an assigned source, where material and vendor master allow automatic purchase orders

Loading purchase orders directly from Excel, for buys whose vendor and price are already decided, is covered in ME21N mass upload. To change many existing requisitions, SAP's mass-maintenance transaction MEMASSRQ is described in SAP mass change, and the query, edit and re-post loop in Excel in SAP mass change.

ME51N mass upload in S/4HANA

PostNow.ai uses the same BAPI_PR_CREATE template in SAP ECC and S/4HANA; ME51N and its BAPI remain in S/4HANA, and SAP's 2023 developer tutorial builds on that BAPI. A few points change.

  • The material number is longer. S/4HANA allows material numbers up to 40 characters, and the BAPI structures carry a long material field for it. Check in SE11 which field your release fills, and map that one.
  • Fiori apps sit beside ME51N. Requesters may create and approve requisitions in Fiori apps, and the Fiori app for automatic purchase order creation matches ME59N (SAP Learning). Requisitions created by the BAPI appear in those apps like any other.
  • OData APIs exist as well. SAP publishes purchase requisition APIs for S/4HANA; in the public cloud edition, release 2402 deprecated API_PURCHASEREQ_PROCESS_SRV in favour of API_PURCHASEREQUISITION_2. Where your company posts through SAP's published APIs, PostNow.ai's API mode is the third posting method next to BAPI and recording.

Worked example: 14 items for a line shutdown in plant 1010

PostNow.ai handles this with one published ME51N template on BAPI_PR_CREATE. Maintenance in plant 1010 plans a shutdown of line 2 and sends a demand file with 14 items: spare parts with material numbers, and text items for services and consumables. Purchasing agreed three requisitions, one per work package, all document type NB, purchasing group 001. Parts are charged to cost center 4120 on G/L account 400000 (category K); the contractor work goes to maintenance order 4000123 (category F).

The first rows of the sheet, one H row per work package and one D row per item:

Excel rowPR RefColumns filled
HPR-0001Document type NB
DPR-0001Item 00010, material TG-1001, 40 PC, delivery 12.01.2027, plant 1010, purchasing group 001, valuation price 18.50, category K, G/L 400000, cost center 4120
DPR-0003Item 00010, short text "Scaffolding, line 2, 5 days", material group M0600, 1 AU, valuation price 6,800.00, category F, G/L 400000, order 4000123
  1. Validate. Three cells are flagged: two delivery dates pasted as text, and a category typed "Q", which the category column's allow-list (K, F) rejects. All three are fixed in the sheet.
  2. Simulate. PR-0002 passes. PR-0001 returns ME 046 on item 00030: the bearing it asks for has no purchasing view for plant 1010, and the material team extends it. PR-0003 returns 06 436 on item 00020, where the order number column is empty. The planner adds the order and a second Simulate is clean.
  3. Pilot. Run Scope covers PR-0002 only. Its requisition number lands on the H row; in ME53N the buyer sees the items, the K assignment on each and the release strategy SAP determined.
  4. Run. PR-0001 and PR-0003 are created. Each H row holds its requisition number, the Run Log records user, time and system, and the shutdown planner forwards the three numbers to the buyer with the release approver copied.

Every item can be traced from its Excel row to its requisition in SAP, and the buyer converts the released requisitions into purchase orders from that list.

Checklist before an ME51N mass upload

PostNow.ai checks a requisition file in layers: Validate, Simulate, a pilot, then the run. This is the list to go through before a production run.

  • One H row per requisition purchasing expects; count H rows against the agreed number of documents.
  • Item numbers unique within each requisition and spaced (00010, 00020).
  • Materials extended to every plant in the file; text items carry short text, material group and unit.
  • Cost centers, orders and WBS elements exist and are valid on the delivery date.
  • Leading zeros and target lengths set on G/L account, cost center and vendor columns; date format set on the delivery date.
  • Valuation prices reviewed, because a value-based release strategy reads them.
  • Source fields agreed with purchasing: which columns the file fills, and which ones source determination owns.
  • The template's Run Log Message settings save the BAPI's NUMBER export to a column (Save to Excel tab).
  • Simulate clean on every requisition, and the release approvers told how many documents are coming.

What to plan for in an ME51N mass upload

PostNow.ai checks formats and allowed values and keeps operators on the published template; these decisions stay with purchasing and the requesters.

  • Requisition or purchase order. If nobody has chosen the vendor or agreed the price, the file is requisition demand. If the vendor column was filled with confidence, the buy may already be decided and belongs on an order.
  • Master data first. Material extensions, cost centers and project structures go in before the requisitions that reference them.
  • Agree the grouping. By requester, project or cost object, decided with purchasing, because it shapes both the buyer's work and the release totals.
  • Plan around MRP. Manual requisitions sit next to the requisitions that planning creates; run the file outside the MRP run so planners see one consistent picture.
  • Hand the numbers over. The requester needs the numbers to follow the demand, and the buyer needs to know the documents have arrived.

Making a template like this repeatable for a team (designers who build, operators who only run, a published template in the central library) is covered in Excel to SAP automation. How a requisition fits the rest of purchase-to-pay is in SAP process automation.

ME51N upload errors and the fix

PostNow.ai writes SAP's RETURN messages into the Run Log beside each requisition. BAPI_PR_CREATE often returns a summary line plus the detail behind it, so read past the first message. If a message is still unclear, AI Review explains it from SAP's messages and the field structure, without your cell values.

MessageWhat it meansFix
06 402 Purchase requisition number & createdSuccess. SAP KBA 3759785 describes systems that return BAPI 000 instead.Nothing. Save the NUMBER export to a column so the number arrives whichever message SAP sends.
BAPI 001 No instance of object type PurchaseRequisition has been createdA wrapper: the requisition was not created, and the reason is in the other linesRead the item-level messages below it in the Run Log
ME 083 Enter & &A required field is empty; the variables name itAdd the column, or set the X flag if the value was there
ME 034 / ME 046 plant not created for material / material not maintained by PurchasingThe material has no purchasing data for that plantExtend the material, then Retry Failed
ME 062 Account assignment mandatory for material &The material may not be requested to stockSet the category and its cost object, or correct the material
06 436 In case of account assignment, please enter acc. assignment data for itemA category is set but no PRACCOUNT line reached SAPMap PRACCOUNT, including SERIAL_NO and the X twin
ME 039 Delivery date is in the past / ME 078 outside the factory calendarThe date in the file does not fit SAP's date checksCorrect the dates, or confirm with purchasing whether the warning is acceptable
Success, but no requisition in ME53NSAP KBA 1943499 covers a BAPI that reports a number while the tables stay empty; in custom programs, SAP Community answers most often point to a missing BAPI_TRANSACTION_COMMITPostNow.ai's Run commits each successful call; open one number in ME53N after the pilot to confirm
Fixed vendor differs from the fileSource determination assigned another source (SAP KBA 1896111)Agree which source fields the file fills; check the source on the pilot

Message texts are SAP's short texts; your release may word some slightly differently, and whether a message is an error or a warning can depend on your system's message settings.

Free ME51N purchase requisition upload template

PostNow.ai publishes a free ME51N purchase requisition template: an H row per requisition and D rows for its items, three sample requisitions with stock, project, cost center and order items, a field guide that names the BAPI_PR_CREATE structure and field behind every column, and a note on the PRITEMX item-number trap. Open it in PostNow.ai to map and simulate it against your own system, or browse the other SAP materials management templates.

Frequently asked questions

How do I create purchase requisitions in bulk from Excel?
With PostNow.ai, put one header row per requisition (document type) and one detail row per item (material or short text, quantity, unit, delivery date, plant, purchasing group, account assignment) in a template mapped to BAPI_PR_CREATE, such as the free ME51N template. Validate checks the sheet offline, Simulate lets SAP check every requisition and rolls it back, and Run creates the requisitions and writes each requisition number back to its row.
Which BAPI creates a purchase requisition: BAPI_PR_CREATE or BAPI_REQUISITION_CREATE?
Use BAPI_PR_CREATE. It is the Enjoy BAPI behind ME51N, and according to SAP Note 1803189, BAPI_PR_CREATE and BAPI_PR_CHANGE are the successors of BAPI_REQUISITION_CREATE and BAPI_REQUISITION_CHANGE. SAP's FAQ Note 499627 adds that the older BAPIs do not cover all the functions of ME51N and ME52N.
Can ME51N be recorded for batch input?
SAP Note 217437 is titled "ME21N/ME51N: Batch input and CATT not possible", so SAP does not support batch input for ME51N. A recording of a simple requisition can work, but it relies on behaviour SAP does not promise to keep. For volume, use BAPI_PR_CREATE.
What does SAP purchase requisition automation cover?
It covers demand that already exists outside SAP, such as project lists, shutdown work packages, new-site equipment and indirect requests, raised as requisitions in one controlled run with SAP's own checks. The buyer still chooses the vendor and price at conversion, and SAP's release strategy still decides who approves the spend.
How does account assignment carry into the purchase order?
The account assignment category (K, F, P, A) goes in PRITEM-ACCTASSCAT and the cost object in a PRACCOUNT line with its G/L account. When the requisition is converted, both pass into the purchase order item, so a wrong cost center on the requisition becomes a wrong cost center on the order. Check them in Simulate.
Will a release strategy stop my uploaded requisitions?
It holds them until they are released. SAP determines the release strategy for BAPI_PR_CREATE as it does in ME51N (SAP KBA 1497235 lists both), and a requisition waiting for release is not offered for conversion to a purchase order. Tell the approvers how many documents are coming and check the valuation prices, because a value-based strategy reads them.
How do uploaded requisitions become purchase orders?
In SAP purchasing: a buyer creates the order in ME21N with reference to the requisition, assigns sources and creates orders in ME57, or lets ME59N create orders automatically for requisitions with an assigned source. Loading purchase orders directly from Excel is covered on the ME21N mass upload page.
How do I change many purchase requisitions at once?
SAP's mass-maintenance transaction MEMASSRQ changes selected fields across many requisitions. With PostNow.ai, the Mass Change module reads the requisitions into Excel, lets you edit them, shows old against new values for review and posts the rows you changed. Both are described on the SAP mass maintenance and SAP mass change pages.
Your demand file. SAP's purchasing rules.

Run your next ME51N mass upload from Excel

Map ME51N once, simulate every requisition, then create them and see each requisition number on its row.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Posts under your own SAP login