Processing and Monitoring Inbound iDocs with Application Interface Framework

Objective

After completing this lesson, you will be able to use SAP Application Interface Framework for processing and monitoring inbound IDocs in various scenarios.

Inbound IDoc Processing

In this unit, we look at various SAP Application Interface Framework scenarios for IDoc processing. Each scenario applies different aspects of the SAP Application Interface Framework capabilities, adapting to various processing and monitoring needs. This summary outlines the scenarios to be demonstrated in this unit.

Scenario 1: Monitor Existing IDocs

SAP Application Interface Framework can monitor and handle errors in existing IDocs and apply the mass changing function to rectify commonly occurring errors.

Scenario 2: Process IDoc Function Module

IDocs can be processed using the SAP Application Interface Framework by calling the IDoc function module in an action.

Scenario 3: Process BAPI/Function Module

IDocs can also be processed using the SAP Application Interface Framework by calling a BAPI or function module in an action.

Scenario 4/5: Process ALE and Writing Index Tables

Process IDocs with ALE, and use enabler to write index tables for enhanced processing capabilities.

Note

The SAP Application Interface Framework provides tools for monitoring existing IDocs within the system, including error detection and the utilization of the mass changing function for common recurring errors.

The IDoc segments are single structures in the DDIC, and we have special transactions that tell the system how these structures form a special IDoc Message Type. Unfortunately that means the IDoc structures already in the system cannot be used for SAP Application Interface Framework Interfaces. An interface needs one root structure for the RAW structure and one structure for the SAP structure. SAP Application Interface Framework helps you to create these structures from IDoc Types.

Prerequisites to Process IDocs in SAP Application Interface Framework

  • Every SAP Application Interface Framework interface requires corresponding source and destination DDIC structures.
  • An IDoc basic type cannot be used directly as a source/destination structure for an SAP Application Interface Framework IDoc interface.
  • Create a DDIC structure that is identical to the IDoc basic type used in the interface.

IDoc Generation Report

An IDoc basic type can be large. Creating a DDIC structure that corresponds to the basic type can be difficult, especially if extensions have to be considered for the IDoc. The SAP Application Interface Framework generation report creates or updates the required structure for a basic type.

You can open the generation report via the transaction code /AIF/IDOC_GEN. The report can:

  1. Create the required DDIC structure for a basic type (with or without extensions).
  2. Update existing DDIC structures for a basic type (with or without extension) in the basic type.
  3. Generate interfaces for a specific IDoc scenario; Maintain a message and basic type for the generated interface.
illustration of the steps described in the text, create, update and generate.

By understanding these elements, you can effectively use the SAP Application Interface Framework functionality for IDoc processing and monitoring, ensuring accurate data handling and streamlined processes. In the next lesson, let's explore in more detail each of the scenarios.

Scenario 1: Monitor Existing IDocs

This scenario is purely for monitoring purposes, with the standard ALE functions handling the processing of IDocs. No alterations to the IDoc interface are necessary. IDocs can be monitored in SAP Application Interface Framework, requiring a basic interface specifically for the IDocs under surveillance. In IDoc scenario 1, existing IDocs can be monitored within the monitoring and error handling transaction without SAP Application Interface Framework affecting their processing. This scenario applies only the monitoring capabilities provided. As SAP Application Interface Framework is not involved in processing, no index tables are created, resulting in SAP Application Interface Framework retrieving IDoc data for display in the Data Messages view from the IDoc control records.

To implement SAP Application Interface Framework IDoc scenario 1, the following steps must be followed:

Process diagram showing the four steps of scenario 1. They're explained in the following text.
  1. Create a DDIC structure from the basic type.
  2. Define the SAP Application Interface Framework interface.
  3. Assign the message type and basic type to the interface.
  4. (Optional) Maintain recipients for alerting and interface monitoring.

All necessary steps for scenario 1 (steps 1–3) can be completed using the IDoc generation report without manual intervention. When configuring a scenario 1 IDoc interface, specify the interface engines as follows:

  • Application Engine: IDoc
  • Persistence Engine: IDoc
  • Selection Engine: IDoc Control Records
  • Logging Engine: IDoc Status Records

If the generation report generates the interface, the engines are preset accordingly.

Scenario 2: Process IDoc Function Module

In scenario 2, data from an IDoc undergoes processing in SAP Application Interface Framework before the standard IDoc processing function is executed within an action. This scenario supports the utilization of checks, value mappings, alerting functionality, and the Interface Monitor.

The standard ALE function is triggered from within an SAP Application Interface Framework action. Monitoring and error handling are conducted through SAP Application Interface Framework Monitoring.

The steps required to process an IDoc via the SAP Application Interface Framework processing function are:

  1. Create a DDIC structure from the basic type.
  2. Define the SAP Application Interface Framework interface.
  3. Assign the message type and basic type to the interface.
  4. Maintain IDoc customizing.
  5. Create checks, values mapping, and so on.
  6. Define and assign an action that calls standard ALE function.
  7. (Optional) Maintain recipients for alerting and interface monitoring.
Process diagram showing the six steps of scenario 1, as explained in the previous text.

Steps 1–3 for scenario 2 can be executed via the IDOC generation report. All other steps have to be done in SAP Application Interface Framework or standard customizing.

  1. The SAP Application Interface Framework function module needs to be assigned to the basic type and message type used in the IDoc (transaction WE57).
  2. An inbound process code is required. The SAP Application Interface Framework processing function module needs to be assigned to the process code (transaction WE42).
  3. The process code in the partner profiles is changed to the process code maintained for the SAP Application Interface Framework processing function module (transaction WE20).

To use the IDoc scenarios 2 and 3, you need to change the standard IDoc Customizing. If the generation report is used to create the interface, the engines are already set accordingly for the interface.

Step 4: Maintain IDoc Customizing

For a scenario 2 IDoc interface, you have to specify the interface engines as follows:

  • Application Engine: IDoc
  • Persistence Engine: IDoc
  • Selection Engine: SAP Application Interface Framework Index Tables
  • Logging Engine: SAP Application Interface Framework Application Log

Scenario 3: Process BAPI/Function Module

To use SAP Application Interface Framework IDoc scenario 3, the following steps are required:

  1. Create a DDIC structure from basic type.
  2. Define the SAP Application Interface Framework interface. Add SAP structure.
  3. Assign message type and basic type to the interface.
  4. (Optional) Create checks, values mappings, and so on.
  5. Define and assign an action to call a BAPI or customer function.
  6. (Optional) Maintain recipients for alerting and Interface Monitor.
Process diagram showing the six steps for scenario 3, as described in the previous text.

Step 1–3 for scenario 3 can be executed via the IDOC generation report. All other steps are completed in SAP Application Interface Framework Customizing. The SAP structure in the interface must be maintained.

For a scenario 3 IDoc interface, you have to specify the interface engines as follows:

  • Application Engine: IDoc
  • Persistence Engine: IDoc
  • Selection Engine: SAP Application Interface Framework Index Tables
  • Logging Engine: SAP Application Interface Framework Application Log

If the generation report is used to create the interface, the engines are already set accordingly for the interface.

This scenario is nearly identical to scenario 2. Instead of the ALE functions, a BAPI or other function is called in the SAP Application Interface Framework action. Monitoring is done via SAP Application Interface Framework Monitoring and Error Handling.

With scenario 3, the data from an IDoc is processed using the Application Interface Framework before the IDoc processing is started from within an action. The processing can be done in a function module, a BAPI, and so on. In this scenario, you can use checks, value mappings, and alerting. Also, the Interface Monitor can be used.

The main difference between scenario 2 and 3 is that a structure mapping is required for scenario 3. Since a BAPI or other function is called, the source structure differs from the destination structure, which makes a structure mapping necessary.

In scenario 2, the standard ALE function is called, therefore, the source and destination structure are identical and can be mapped with the Move Corresponding function in the easiest case.

Screenshot of the interface that shows the highlighted difference between the configuration

Scenario 4: Process ALE and Writing Index Tables

Scenario 4 is, like scenario 1, a pure monitoring scenario. In comparison to IDoc scenario 1, you can use some advanced features of the SAP Application Interface Framework. You can use alerting, interface-specific index tables, and interface-specific selection screens. If a recipient was specified, the IDocs can also be displayed in the Interface Monitor.

Processing of the IDocs is done by the standard ALE functions. In contrast to scenario 1, the SAP Application Interface Framework Enabler is called to write index tables and statistics and to trigger alerts. Monitoring is done via SAP Application Interface Framework Monitoring and Error Handling.

The IDoc enabler determines the interface based on the settings in SAP Application Interface Framework customizing. If a corresponding interface is found, index table entries can be written and alerts are created. If a corresponding interface is not found, the ALE processing continues as usual. IDocs without an assigned SAP Application Interface Framework interface continue processing uninterrupted.

The SAP Application Interface Framework Enabler logs the IDoc status changes to the Standard Single Index table, your Single Index Table, or Multi Index Tables, enabling access to all Index Table features, such as recipient assignment.

Implicit call of SAP Application Interface Framework Enabler for Docs: If the implicit enabler call is available, the IDoc standard processing calls the Enabler when the status of an IDoc changes.

What Happens when the Enabler is Installed? If the processed IDoc has a corresponding interface, the relevant information is written into the tables. After the update of the SAP Application Interface Framework tables, the normal IDoc processing continues. If the processed IDoc has no corresponding SAP Application Interface Framework interface, no information is written to the SAP Application Interface Framework tables. Processing continues without an update of the SAP Application Interface Framework tables.

Note

Note: An SAP Application Interface Framework interface with the generated IDoc Structure as RAW and SAP Structure is a prerequisite.

To use SAP Application Interface Framework IDoc scenario 4, the following steps are required:

  1. Create a DDIC structure from basic type.
  2. Define an SAP Application Interface Framework interface.
  3. Assign message type and basic type to the interface.
  4. (Optional) Create index tables.
  5. (Optional) Maintain recipients for alerting and Interface Monitor.
Scenario process showing the five steps as outlined in the previous text.

Step 1–3 for scenario 4 can be executed via the IDOC generation report. All other steps have to be done in SAP Application Interface Framework customizing.

For a scenario 4 IDoc interface, you have to specify the interface engines as follows:

  • Application Engine: IDoc
  • Persistence Engine: IDoc
  • Selection Engine:SAP Application Interface Framework Index Tables
  • Logging Engine: SAP Application Interface Framework Application Log Engine

If the generation report is used to create the interface, the engines are already set accordingly for the interface.

For a scenario 5 IDoc interface, you have to specify the interface engines as follows:

  • Application Engine: IDoc
  • Persistence Engine: IDoc
  • Selection Engine: SAP Application Interface Framework Index Tables
  • Logging Engine: : iDoc status records

Importing IDocs into the system and processing them to the Index tables helps you find IDocs that posted with an error for different recipients, making monitoring easier than in the IDoc Transactions.

If the enabler scenario is set up for an IDoc, only IDocs are displayed that have been created after the enabler scenario was set up. If existing IDocs should be displayed in the interface, you can import them via transaction /AIF/IDOC_IMPORT.

You can import:

  • Specific IDocs by IDoc number
  • IDocs by message or basic type
  • Docs from a specific time range
Screenshot of the SAP Application Interface Framework IDoc import

Log in to track your progress & complete quizzes