How to Create a Purchase Order with IDOCs in SAP |
Understanding IDOCsFirst things first—what exactly is an IDOC?An IDOC (Intermediate Document) is SAP’s standard data structure used for electronic data interchange (EDI) between SAP systems or between SAP and external systems. Think of it as a data container that flows from one system to another, ensuring structured communication. Why use IDOCs over manual processes? Because automation = efficiency. IDOCs let you automatically trigger actions (like creating a PO) without manual clicks. Prerequisites for PO Creation with IDOCsBefore we start configuring, make sure you’ve got:
Setting Up Partner Profiles (Transaction: WE20)The partner profile is where all the magic begins.For a vendor (partner type LI), you need to define the outbound parameters as follows:
Alternatively, if you’re working with the ORDERS05 IDOC type:
Message Determination ProcessHere’s the thing: you don’t want to manually create IDOCs every time you make a PO. That’s where message determination (aka output control) comes in.SAP can automatically send an IDOC when you create or change a purchase order. This requires proper setup in the message control framework. Configuration Path in SPROYou’ll need to head into customizing via SPRO to define how messages get triggered.Path:
Here you define your applications, output types, and assign condition records. Defining Application EFIn SAP speak, Application EF relates to purchase orders. It's the key area where output messages (like EDI notifications) are handled for POs.When setting this up:
Defining Output TypesWithin Application EF, the NEU output type is the classic setup for triggering IDOCs.There are two operations you’ll want to focus on: 1. PO Creation (Operation 1): Sends IDOC when PO
is initially saved
You can use the same NEU output type for both but ensure you flag the change message for the modification scenario. Assigning Message SchemasNow, schemas are the bridge between your documents and output messages.You’ll need to:
Configuring Message Control in WE20Back to WE20—this time, make sure the message control is set up correctly.
Mark the “Change Message” flag if you want to differentiate change scenarios. Verifying Output Configuration in the POAfter you’ve created your PO (via ME21N) or edited it (via ME22N), check the message control:1. Go to Header > Messages tab
Then, under “Further Data,” select “Send with periodically scheduled job” or “Send immediately,” depending on your setup. Save it. Triggering IDOC Manually with RSNAST00Need to push the IDOC manually? Use program RSNAST00 in SE38.Input the following:
Troubleshooting and DebuggingNot seeing the IDOC? Don’t panic—debug it.Use function module IDOC_OUTPUT_ORDERS or IDOC_OUTPUT_PORDCR1 depending on your setup. Set a breakpoint in SE37, then go back to ME22N, enter your PO, and trigger the output. Your debugger will catch it and let you step through the logic. This is a great way to see if your condition records, message types, or data are missing something. Advanced Tip: Custom Output ControlNeed more than the standard? You can enhance message determination logic via user exits like EXIT_SAPLEINM_002 for fine-tuned control over IDOC population.Also, monitor your IDOCs via:
Best Practices
ConclusionAutomating PO creation with IDOCs can save your business hours of manual work and reduce errors. Once you’ve got your partner profile, message control, and output types set up, the whole process becomes hands-free.Use this setup to integrate with suppliers, third-party procurement platforms, or internal systems in real-time. The flexibility and power of IDOCs make SAP an integration powerhouse—use it to your advantage! FAQs1. What’s the difference between PORDCR1 and ORDERS05?PORDCR1 is typically used in XML-based scenarios, especially with SAP PI/PO or middleware, while ORDERS05 is the classic IDOC for PO creation in EDI setups. 2. Can I automate PO changes using the same IDOC process?
3. How do I check if the IDOC was successfully created?
4. What are the common errors in WE20 setup?
5. How can I test IDOC output without sending to the
vendor?
|
![]() |
See Also Trigger an IDoc whenever a Purchase Order is Created Get help for your SAP MM problems
SAP Material Management Books
SAP Materials Management Tips
Best regards,
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|