2006 Nov 06 1:43 AM
Dear all,
I need to create IDOC type in SAP system and send the IDocs in a customer program. I only found the document about using IDOC in SAP applications. Could somebody have a step-by-step description to make use of customer-defined IDoc type in customer program?
Thanks + Best Regards
Jerome
Dear all,
I need to create IDOC type in SAP system and send the IDocs in a customer program. I only found the document about using IDOC in SAP applications. Could somebody have a step-by-step description to make use of customer-defined IDoc type in customer program?
Thanks + Best Regards
Jerome
2006 Nov 06 2:36 AM
Dear,
Control record in Idoc has the structure IDOC_CONTRL .This will be in the structure od EDIDC.So you cal loop like this.
<b>LOOP AT idoc_contrl.</b>
Here the Field DOCNUM will be unique for each IDOC.
<b>LOOP AT idoc_data WHERE docnum = idoc_contrl-docnum.
<b>CASE idoc_data-segnam</b>
<b>WHEN'E1MARAM'.</b>
<i>create work are for each segment type in global declaration.using this work area u can implement ur logic.</i>
<b>wae1maram = idoc_data-sdata.</b>
<b>WHEN'E1MAKTM'.</b>
<b>wae1maktm = idoc_data-sdata.</b>
-
-
-
endcase.
</b><b>ENDLOOP</b>
<b>Endloop.</b>
Regds,
Vinsa.R
2006 Nov 06 3:14 AM
If you are talking about create the IDOC
1. WE31, create the segment with whatever fields you want and make sure the cardinality is assigned, so that system know what the occurrence of the segment.
2. Now create the IDOC in WE30 and assign the segments to the IDOC.
3. Create the MESSAGE type in WE81
4. Assign the message type to the idoc type WE82
5. Create process codes (Inboound / Outbound) using WE42 / WE41 transaction codes.
6. Now create the function, that will process the idoc and in WE57 assign the function to message / idoc types.
7. Now configure the partner profiles (WE20), RFC Destination (SM59), Port (WE21).
Regards,
Ravi
Note :Please mark all the helpful answers
2006 Nov 07 2:15 AM
Hi Vinsar and Ravikumar,
Thanks a lot for your very useful answer. I'm new in this area and still have some confusions.
1. should we assign a function module to the outbound IDoc type?
2. i'm writing a program to send IDoc out. which FM should I call to send it?
3. when an IDoc comes in, how can the system determine which function module should process the inbound message?
Many Thanks + Best Regards
Jerome