$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
SAPintermediateNew

SAP MM Purchase Order

Share

Create and manage purchase orders with BAPI_PO_CREATE1

Works with OpenClaude

You are an SAP Materials Management (MM) specialist. The user wants to create and manage purchase orders using the BAPI_PO_CREATE1 function module in SAP.

What to check first

  • Verify your SAP system connection is active and user has MM authorization objects (C_EBAN_CRE, C_EINKAUFSORG)
  • Confirm vendor master data exists in SAP (transaction XK01 or table LFA1)
  • Check that plant and purchasing organization are valid in customization (SPRO > IMG > Materials Management)

Steps

  1. Populate the BAPI_PO_CREATE1 import parameter po_header with document type (e.g., 'NB' for standard PO), purchasing organization, vendor number, and currency
  2. Fill po_headerx table with field update indicators (set to 'X' for each header field being populated)
  3. Populate po_items table with item-level data: material number, plant, quantity, unit of measure, net price, and delivery date
  4. Fill po_itemsx table with 'X' flags for all item fields being set
  5. Call BAPI_PO_CREATE1 with the prepared tables
  6. Check return messages in the RETURN table for errors (type 'E' or 'W')
  7. If successful, capture the po_number returned and call BAPI_TRANSACTION_COMMIT to persist changes
  8. Handle exceptions and rollback with BAPI_TRANSACTION_ROLLBACK if return contains errors

Code

REPORT z_create_purchase_order.

DATA: ls_po_header     TYPE bapipoheader,
      ls_po_headerx    TYPE bapipoheaderx,
      lt_po_items      TYPE TABLE OF bapipoitem,
      lt_po_itemsx     TYPE TABLE OF bapipoitemx,
      lt_return        TYPE TABLE OF bapiret2,
      ls_item          TYPE bapipoitem,
      ls_itemx         TYPE bapipoitemx,
      lv_po_number     TYPE bapipo-po_number,
      lv_index         TYPE sy-tabix.

"*** PO Header Data ***
ls_po_header-doc_type     = 'NB'.        "Standard PO
ls_po_header-purch_org    = '1000'.      "Purchasing Organization
ls_po_header-vendor        = '0000100002'. "Vendor Number
ls_po_header-purch_group   = '001'.      "Purchasing Group
ls_po_header-currency      = 'USD'.      "Currency
ls_po_header-doc_date      = sy-datum.

"*** Header Update Indicators ***
MOVE 'X' TO ls_po_headerx-doc_type,
           ls_po_headerx-purch_org,
           ls_po_headerx-vendor,
           ls_po_header

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategorySAP
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
sapmmpurchase-order

Install command:

curl -o ~/.claude/skills/sap-mm-purchase-order.md https://clskills.in/skills/sap/sap-mm-purchase-order.md

Related SAP Skills

Other Claude Code skills in the same category — free to download.

Want a SAP skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.