IDoc Part 4: Outbound IDocs, Distribution Model and Reprocessing
Lessons are open to try during our launch period. Some advanced content may move to Pro later. AI practice limits apply separately.
Create and send outbound IDocs: ALE distribution model (BD64) for master data and transactional messages, partner profile outbound parameters (receiver port, basic type, transfer immediately vs collect), MASTER IDOC DISTRIBUTE, status 30/03/02, RSEOUT00 and resending.
In this lessonShow sectionsHide sections
Visual overview
Expert visual walkthrough
Outbound IDocs, Distribution Model and Reprocessing
IDoc · Chapter-specific technical teaching map
Integration path
Change / output
Dispatch config
IDoc creation
Partner receipt
Tutor's chapter takeaway
Create and send outbound IDocs: ALE distribution model (BD64) for master data and transactional messages, partner profile outbound parameters (receiver port, basic type, transfer immediately vs collect), MASTER_IDOC_DISTRIBUTE, status 30/03/02, RSEOUT00 and resending.
In a real project
Material master changes were not reaching the warehouse system. WE02 showed hundreds of MATMAS IDocs in status 30: the partner profile was set to "collect IDocs", but the RSEOUT00 job had been deleted during a system copy…
Watch out for
• Collect mode without an RSEOUT00 job (IDocs stuck in 30). • Missing distribution model entries for ALE message types. • Treating status 03 as "processed by receiver". • No COMMIT after MASTER_IDOC_DISTRIBUTE. • Resending…
The situation: a real project scenario
Material master changes were not reaching the warehouse system. WE02 showed hundreds of MATMAS IDocs in status 30: the partner profile was set to "collect IDocs", but the RSEOUT00 job had been deleted during a system copy.
After rescheduling RSEOUT00 every 10 minutes and sending the backlog through BD87, the warehouse received the data. The team added "status 30 older than 1 hour" to their IDoc monitoring alerts.
Explanation
Part 3 covered inbound IDoc processing. Now the other direction: SAP sending data out.
Outbound IDocs are created by applications (output control, change pointers, ALE programs like BD10) or by custom code with MASTER_IDOC_DISTRIBUTE. Output control, reached through NACE with medium 6 for EDI or A for ALE, generates IDocs such as an order confirmation (ORDRSP) or an invoice (INVOIC) — the mechanics of this are covered further in Part 7.
Change pointers, maintained through BD21, drive master data distribution and are also covered in Part 7. Direct send programs exist for specific object types: BD10 for materials, BD12 for customers, BD14 for vendors. And custom programs can trigger distribution directly by calling MASTER_IDOC_DISTRIBUTE.
The distribution model, maintained in BD64, defines which message types go from which sender to which receiver logical system (ALE) — a model view holds the sender logical system, the receiver logical system, the message types involved, and optional filters, such as restricting distribution to plant 1000 only.
Once defined, the model needs to be distributed to the receiving system, and partner profiles can be generated directly from it. This model is required for ALE master data distribution specifically; EDI driven through output control relies on partner profiles alone, without needing a distribution model.
On the partner profile side, in WE20, the outbound parameters for a receiver partner and message type define the receiver port (set up in WE21), the basic type, and the output mode — whether IDocs transfer immediately or get collected for later. Partner profile outbound parameters define receiver port, basic type and "transfer IDoc immediately" or "collect IDocs" (sent later by RSEOUT00). For output-control-driven IDocs specifically, the message control tab also needs the application, output type and process code — for example V1, BA00, SD10.
The status sequence for an outbound IDoc typically runs: 01, created; then 30, ready for dispatch, if it was collected rather than sent immediately; then 03, passed to the port successfully. Status 30 means "ready for dispatch" — the IDoc has not left SAP yet. Status 03 means passed to the port, not that the partner processed it.
Status 02 means an error occurred passing the IDoc to the port — commonly an RFC destination issue — and is worth checking in SM58 or at the port itself. Where ALE audit or acknowledgements are in use, statuses like 12 or 41 can confirm that the IDoc was actually received or processed on the other side.
For sending and resending: RSEOUT00, scheduled as a background job, sends any IDocs sitting in status 30 waiting to be collected and dispatched. BD87 is the status monitor, and lets status 30 or 02 IDocs be reprocessed once the underlying port issue is fixed. Resending an IDoc that has already gone out — whether by copying it in WE19 or triggering the application's output again — should always be agreed with the receiving side first, to avoid creating duplicates on their end.
As an exercise, display a model view and its message types in BD64, check the outbound parameters for a partner in WE20 — its port, basic type and mode — and send a material using BD10 in a test system, following its status through WE02. By the end you should be able to configure, send and monitor outbound IDocs.
Code example
* ===== Custom outbound IDoc with MASTER_IDOC_DISTRIBUTE =====REPORT zidoc_send_custom. DATA: ls_control TYPE edidc, lt_data TYPE STANDARD TABLE OF edidd, ls_data TYPE edidd, lt_comm TYPE STANDARD TABLE OF edidc, ls_comm TYPE edidc, ls_seg TYPE z1projhdr. " own segment (WE31) START-OF-SELECTION.* ===== Step 1: control record (receiver determined via partner profile) ===== ls_control-mestyp = 'ZPROJECT'. " own message type (WE81) ls_control-idoctp = 'ZPROJECT01'. " own basic type (WE30) ls_control-rcvprt = 'LS'. " logical system ls_control-rcvprn = 'EXTSYS_100'. * ===== Step 2: data records ===== ls_seg-projid = 'PRJ-2026'. ls_seg-descr = 'Warehouse extension'. ls_data-segnam = 'Z1PROJHDR'. ls_data-sdata = ls_seg. APPEND ls_data TO lt_data. * ===== Step 3: create and distribute ===== CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' EXPORTING master_idoc_control = ls_control TABLES communication_idoc_control = lt_comm master_idoc_data = lt_data EXCEPTIONS error_in_idoc_control = 1 error_writing_idoc_status = 2 error_in_idoc_data = 3 sending_logical_system_unknown = 4 OTHERS = 5. IF sy-subrc <> 0. ROLLBACK WORK. WRITE: / 'IDoc creation failed, sy-subrc =', sy-subrc. ELSE. COMMIT WORK. " IDocs are dispatched after commit LOOP AT lt_comm INTO ls_comm. WRITE: / 'IDoc', ls_comm-docnum, 'status', ls_comm-status. ENDLOOP. ENDIF. * ===== Send collected IDocs (status 30): program RSEOUT00 as job =====Watch out
Common mistakes
- Collect mode without an RSEOUT00 job (IDocs stuck in 30).
- Missing distribution model entries for ALE message types.
- Treating status 03 as "processed by receiver".
- No COMMIT after MASTER_IDOC_DISTRIBUTE.
- Resending IDocs without agreement (duplicates at receiver).
Do this
Best practices
- Maintain BD64 and generate partner profiles consistently.
- Choose immediate vs collect deliberately and schedule RSEOUT00.
- Monitor status 30/02 regularly.
- Commit after creating custom IDocs.
- Agree resend procedures with receivers.
In the interview
Interview angle
Questions: "How are outbound IDocs created?", "What is the distribution model?", "IDocs stuck in status 30 — why?"
Strong answer: output control, change pointers (BD21), send programs (BD10), custom MASTER_IDOC_DISTRIBUTE + COMMIT; BD64 defines sender/receiver/message types for ALE; WE20 outbound: port, basic type, immediate or collect; status 30 waits for RSEOUT00, 03 passed to port, 02 port error; reprocess via BD87.
Practice this lesson
Quick check
0 of 3 questions attempted
Question 1 of 3
Outbound IDocs are in status 30. What does this mean?
Question 2 of 3
In the ALE distribution model (maintained via BD64), what is the primary function of a 'filter object' attached to a distribution model entry?
Question 3 of 3
Distribution model is defined in:
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1When would you still use IDoc instead of OData or modern APIs in S/4HANA?
2After a system restart, outbound IDocs to a partner stayed in status 30 and 02. How do you recover without sending duplicates?
Try a related Code Lab
This published exercise covers the same SAP topic. Apply the ideas in a hands-on scenario, then return to review your answers.
Open: Custom Segment Added at Wrong Hierarchy →See it in code
Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.
Was this lesson helpful?
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
- BD12Send Customer Master via ALE
- MASTER_IDOC_DISTRIBUTEGeneric ALE outbound IDoc distribution function module
- SM58Transactional RFC Monitor
- WE21Port Definition for IDoc Interfaces
- BD14Send Vendor Master Data via ALE
- BD64ALE Distribution Model Maintenance
- WE19IDoc Test Tool
- BD87IDoc Reprocessing
- BD10Send Material Master via ALE IDoc
- WE02IDoc Display and Status Analysis
- BD21Create IDocs from Change Pointers
- WE20WE20 Partner Profile Maintenance
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.