Application Development 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: 

about idoc

Former Member
0 Kudos

can anyone provide step by step idoc programming in abap with explaination

both inboound and outbound

and also terms used in idoc like message type why they were used etc

1 REPLY 1

Former Member
0 Kudos

Hi Vijay,

IDoc Definition:An intermediate document (IDoc) is a container for exchanging data between R/3, R/2 and non-SAP systems.

Use:

ALE uses IDoc to exchange data between logical systems. Non SAP-systems can use IDoc as the standard interface for data transfer. IDoc are created by message types and (object) methods when data is to be distributed.

Structure:

An IDoc represents a configuration of an IDoc type that determines the IDoc structure. An IDoc consists of a header, several data segments and status records.The functions of the individual elements of an IDoc are as follows:

The contents, structure, sender, receiver and current status of the IDoc are defined in the IDoc header.

Each data segment contains a standard header consisting of a sequential segment number, a description of the segment type and a 1000 character long string field containing the actual data of the segment. The status records show the history of the processing steps applied to the IDoc so far. The structure of the IDoc is recorded in the SAP System. The structure definition covers the

following: The segment sequence. Hierarchical relationships between segments are possible. The number of times a segment can occur is specified for each segment, as is whether the segment is a mandatory segment or an optional segment. The fields cont ained in a segment. In the example shown above the IDoc contains a header segment that has to be the first segment of the message.

Thereafter there must be at least one additional item. The following conditions apply:

Each item must be followed by at least one sub-item and at most 99

Up to 9999 text segments can appear after an item's sub-items (optional)

The last segment in a message must be an accumulation segment (ACCUM)

An IDoc can only contain character fields.

Modeling Distribution:

Purpose:

To implement the distribution of business application processes and functions using ALE you need to construct a logical Distribution Model of the whole system. Within the framework of this configuration customers can specify what applications are to run on what systems and what messages are to be exchanged between the applications .

Distribution Model:

Definition: The distribution model describes the ALE message flows between logical systems.

Use:

You can specify the relationships between logical systems, message types, BAPIs and filters inthe distribution model. Applications and the ALE layer use the model to determine the receivers and to control data distribution.

Structure:

In the distribution model you can specify the messages to be sent to a logical system. You can also define requirements for message content and dispatch in the Filters. The distribution model consists of one or more views that you can define. With more complex distribution tasks you can assign business sub-areas or groups of logical systems to separate views. To ensure correct functioning the relevant views of the distribution model must be available in all the logical systems involved in ALE. You can find the functions for distributing views in Customizing for ALE.

Creation of Custom IDOc type and message Type

First Create Partner Profile(WE20 Tcode) and Port Definition in WE19 Tcodes.

take the Basis help to create them.

1.First create segments in WE31 Tcode with the required dataelements

2.Create the Basic Idoc Type in WE30

release the Segments and IDOC type.

3.Create Message type in We81

4.Assign the message type to IDOC type in WE82 T code

5.Create the process code in We41 (for Outbound) WE42 (for Inbound)

6.Create A fun module in SE37 starting with ZIDOC_OUTPUT_.. by copying some Inbound (for Inbound) Outbound Fun module

7.Create Workflow setting if needed ..

8. Assign the fun module to Idoc Type, Message Type and WF object (if it is there)

9.Define setting for fun module in BD51

10.In BD51 Define the settings for Fun module..

10.Assign the Processs Code to Fun mod`ule

Outbound:

Step 1. Application document is created when transaction is saved.

2. Message control is invoked.

3. Messages are processed by system.

4. Messages are Edited (if desired).

5. Output (ALE / EDI) is checked

6. Validate against Message control record from Partner Profile

7. Application Document is saved.

8. Entry NAST table is created for every selected output program

along with Medium & Timing.

9. Check for Process Immediately .

If (yes)

Determine Processing Program from TNAPR Table.

ELSE

Execute RSNASTED Program.

10. Read Partner Profile to determine Process Code.

11. Process Code points to the Function Module & Invoked.

12. IDoc is generated.

13. Check for ALE Request.

if (Yes)

Perform Filters, Conversions, Version Changes etc.

Else.

IDoc is stored in DATABASE.

INBOUND:

Step 1. EDI Subsystem creates an IDoc file from EDI Messages

2. Subsystem calls Functional Module EDI_DATA_INCOMING from startRFC program.

3. Data in Control Record is validate against the Partner Profile.

4. IDoc is generated in Database and syntax check is carried out.

5. IDoc file is deleted once file read.

6. Event PROCESSSTATE REACHED is triggered in Idoc Object Workflow.

7. Check for Process Immediately.

If NO

Execute RBDAPP01 Program

Else

Read Process Code from Partner Profile

Process Code Points to Function Module

Application Document Posted.

ALE/ IDOC Links

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://www.sappoint.com/abap/ale.pdf

http://www.sappoint.com/abap/ale2.pdf

http://www.sapgenie.com/sapedi/idoc_abap.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm

http://www.allsaplinks.com/idoc_sample.html

http://www.sappoint.com/abap.html

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://www.allsaplinks.com/idoc_sample.html

http://www.allsaplinks.com/idoc_sample.html

http://www.allsaplinks.com/

http://www.sap-img.com/

http://www.sappoint.com/abap.html

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://expertanswercenter.techtarget.com/eac/knowledgebaseCategory/0,295197,sid63_tax296858_idx0_off...

http://sap.ittoolbox.com/documents/popular-q-and-a/extending-a-basic-idoc-type-2358

http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7eee43d711d1893e0000e8323c4f/frameset.htm

ALE/ IDOC/ XML

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://www.thespot4sap.com/Articles/SAP_XML_Business_Integration.asp

http://help.sap.com/saphelp_srm30/helpdata/en/72/0fe1385bed2815e10000000a114084/content.htm

<b>Reward Points if useful</b>

Regards

Gokul