How does the data actually come from SAP to the IDoc?
You need a function module or another self-written program that creates the data to send.
If the triggering transaction supports customizable NAST messaging, then you can create a NAST message that supports ALE or IDoc. The link between the message and IDoc is defined via the process code in the partner profile WE20. Whenever the NAST message is processed it will make a call to ALE_PROCESSING in program RSNASTED or EDI_PROCESSING in program RSNASTED, which does the job for you and eventually will call the function module that fills the data hive.
If a program does not support messaging via NAST then you need to create the IDocs with your own routine and then call MASTER_IDOC_DISTRIBUTE. You can find more in-depth developer know-how in SAP R/3 Guide to EDI and Interfaces.
Dig Deeper on SAP ABAP
Related Q&A from Axel Angeli
An SAP user is receiving an error message while integrating SAP iDoc PORDCR1 for a purchase order. Continue Reading
SAP expert Axel Angeli explains how to update the "further dates" tab information in am SAP transaction through an SAP IDoc. Continue Reading
A SearchSAP.com reader wants to know how to create an SAP IDoc along with sales order details when sales orders are created, changed or cancelled. Continue Reading