• No results found

Exchanging Data with IDocs: Overview of the Process

In document Bit300 en Col54 Fv Part a4 (Page 43-52)

Data exchange using IDocs begins in the sender system when an intermediate document is created in IDoc format and ends when the data transported by the IDoc is posted in an application in the target system. In the process, certain stations are processed, which the sender and target systems each mark with status values.

Figure 23: The IDoc's Path and Status Values

• Regardless of how the IDoc was created, it is first saved to the sender system's database (status value 01).

• If all the information required for sending has been obtained from the recipient, then the IDoc receives the status “ready for dispatch” (status value 30).

• If the outbound partner profiles specify that the IDoc is to be transferred immediately to the port stored in the relevant message type, then the IDoc is sent and receives a corresponding status (status value 03). However, it is also possible to send multiple IDocs bundled together at a later time.

The IDoc is saved to the target system's database (status value 50).

• If all information about further processing is known, the IDoc can be transferred to the application (status value 64).

• If the inbound partner profiles specify that the IDoc is to be transferred to the application immediately, the target system attempts to post the IDoc data (status value 62). If the inbound processing is successful, the IDoc receives

BIT300 Lesson: Intermediate Documents

Figure 24: Generating a Master IDoc

The master IDoc is transferred to what is known as the ALE layer. The ALE layer is the ALE-specific part of the application program.

The ALE layer checks the distribution model to determine the recipient(s) of the message.

Figure 25: Recipient Determination in the ALE Layer

Next in the program's run, the sender system checks the outbound partner profiles for the message type used. For each recipient, a communication IDoc is created according to the basic type and is saved to the database.

In order to be able to send the communications IDoc to the recipient, the sender system uses the outbound partner profile to determine the port (in other words, the communication channel) via which the IDoc is to reach the target system.

Then the IDoc is converted into the format suitable for the port. This part of the program is also known as the communication layer.

Figure 26: Further Processing in the Communication Layer

The ALE layer can pass a communications IDoc directly to the communication layer. However, for performance reasons, it is often better to first save the IDocs to the database and then to process them collectively later. The partner profile determines whether a communications IDoc is sent to the port immediately or not until later.

Metaphorically speaking, the communications IDoc is like a letter that is to be sent

BIT300 Lesson: Intermediate Documents

Figure 27: Port Types

The port type tRFC is short for “transactional Remote Function Call”. The technology of the transactional RFC ensures that the recipient receives the document once and once only. If the recipient cannot be reached at the time of sending, the system attempts to establish the connection again at regular intervals.

The document is only deleted from the tRFC queue when it has reached the target system. In ALE scenarios, data transfer is via tRFC.

Not every partner system is able to interpret the RFC protocol. In EDI scenarios involving a converter, a file port is often used, for this reason. The IDoc is stored for this file port as a sequential file at the operating system level in such a way that the target system can access it. A corresponding path in the file system is entered in the port.

The IDoc is initially saved to the database in the recipient system.

Figure 28: Inbound Processing in the Recipient System

Depending on the defaults in the partner profiles, the IDoc is either transferred to the ALE layer immediately or not until later by a program for background processing.

The ALE layer uses the partner profile to determine a transaction code that controls how the IDoc is processed further. Generally speaking, the data is transferred to the application by a function module. However, a workflow could also be started instead.

BIT300 Lesson: Intermediate Documents

Exercise 2: Documentation for Basic Types

Exercise Objectives

After completing this exercise, you will be able to:

• Display documentation about basic types in mySAP ERP

Business Example

You want to use ALE to exchange data between two SAP systems and, by doing so, find out more about the technical implementation of ALE scenarios.

Task:

You want to learn about the structure of the MATMAS05 basic type, so that you can use the “Central Material Master Management” ALE scenario.

1. From the application menu, display the documentation for the basic type MATMAS05.

2. Find segment type E1MARMM (Material master units of measure) and display the structure. Which segment type is dependent on E1MARMM?

3. Change your user settings so that, in future, the link to the documentation for individual segment fields is displayed next to the link to the structure of the corresponding segment type.

Solution 2: Documentation for Basic Types

Task:

You want to learn about the structure of the MATMAS05 basic type, so that you can use the “Central Material Master Management” ALE scenario.

1. From the application menu, display the documentation for the basic type MATMAS05.

a) Select Tools → ALE → ALE Administration → Services → Documentation → IDoc Types and Segments.

b) In the Basic type field, enter MATMAS05 and select HTML Format . 2. Find segment type E1MARMM (Material master units of measure) and

display the structure. Which segment type is dependent on E1MARMM?

a) Segment type E1MARMM is dependent on segment type E1MARAM (Material master general data). Click on the Structure link below the status information about segment type E1MARMM to call a list of segment fields.

b) Segment type E1MARMM (Material master EAN code) is dependent on segment type E1MARMM.

3. Change your user settings so that, in future, the link to the documentation for individual segment fields is displayed next to the link to the structure of the corresponding segment type.

a) Choose Back to exit the HTML display.

b) In the transaction's menu, select Goto → User Settings, click on Display <-> Change , set the Documentation Output indicator and save your changes.

c) Check the changed setting by displaying the HTML display again:

you can now access a Documentation link which you can use to call information about the individual segment fields.

BIT300 Lesson: Intermediate Documents

Lesson Summary

You should now be able to:

• Explain and differentiate between the terms “basic type”, “master IDoc”

and “communications IDoc”

• Determine the details of basic types

• Describe the process from the creation of an IDoc in the sender system through to processing in the target system

In document Bit300 en Col54 Fv Part a4 (Page 43-52)