Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Customer IDOC

former_member343107
Participant
0 Likes
576

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

3 REPLIES 3
Read only

Former Member
0 Likes
537

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

Read only

Former Member
0 Likes
537

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

Read only

0 Likes
537

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