Building the message model for the IDOC parser

The ALE IDoc messages that are sent to, and received from, SAP applications by using the WebSphere® MQ Link for R3, can be processed by the IDOC parser, which requires a message model to interpret the data correctly. This topic describes how to build the message model.

Before you begin

The IDOC domain is deprecated. To develop new message flows, use the MRM domain with a TDS physical format when you want to process SAP ALE IDocs that are sent to the integration node by SAP R3 clients across the WebSphere MQ link for R3.

Obtaining the IDoc

About this task

Create an import file of the required IDoc data for the IBM® Integration Toolkit.

Procedure

  1. Log on to an SAP system.
  2. Run the supplied transaction we60, which extracts the IDoc data as a C header file.
    1. In Basic Type, select the IDoc type of interest; for example, MATMAS02.
    2. Leave the Control, Data, and Status check boxes cleared.
    3. Select the Record types version. A version 4 IDoc is type 3.
    4. Press F7 to display a C representation of the IDoc.
    5. Select System > List > Save > Local file.
    6. Click unconverted.
    7. When prompted, enter a file name and directory for the output from the transaction.
      The C representation of the IDoc is saved to this C header file.

What to do next

Tip: The exported C header can be imported into the IBM Integration Toolkit without any further manual processing.

Modeling the IDoc

About this task

Create your message model.

Procedure

  1. Switch to the Integration Development perspective.
  2. Use the New Message Set wizard to create a message set for your IDoc. Select binary data as the data to use. This option creates a message set with a Custom Wire Format (CWF) physical format, and presets the Default message domain property to MRM.
  3. Use the Message Set editor to change the Default message domain property to IDOC.
  4. Use the New Message Definition File wizard to import a prebuilt model of the ALE IDoc message structure.
    To start the wizard, click File > New > Message Definition File From. When the wizard opens, select IBM supplied message, then SAP ALE IDoc. This SAP ALE IDoc prebuilt model includes definitions of the DC and DD segments. The resulting message definition file is called ale_idoc.mxsd. For information about using the New Message Definition File wizard, see Message Sets: Importing from IBM supplied messages.
  5. Use the New Message Definition File wizard, or the mqsicreatemsgdefs command, to import the C representation of the IDoc into the new message set.
    To start the wizard, click File > New > Message Definition File From.
    Specify the following settings:
    • Select C Header file.
    • Set Select the pre-processing option to apply to SAP ALE IDoc. If this option is not specified, the import of the C header fails. If this option is specified, the message prefix preference is ignored.
    • Create messages for the segments that appear in the IDoc.
    • Use the String Encoding option to import character arrays as fixed-length strings.
    • Use the Padding Char for String option to make space ( ) the padding character that is used.
    For information about using the New Message Definition File From C Header File wizard, see Message Sets: Importing from C.

Using the IDoc message model

About this task

You can now use your message model to help you to construct a message flow that processes instances of your IDoc message. You can use ESQL or Java™ to access the fields of the IDoc. You cannot use graphical maps to access the fields of the IDoc because the IDOC domain is not supported by the mapping editor.

When you set the properties of the MQInput node that is to receive your IDoc from the WebSphere MQ Link for R3, the Message Domain property must be IDOC, the Message model property must be the name of the message set, and the Message Format property must be the name of your Custom Wire Format. You do not need to set a Message Type property on the MQInput node because it is not needed by the IDOC parser.

When your message flow is complete, add the message set and the message flow to a BAR file and deploy the BAR file to an integration node integration server.

When an IDoc is received by the MQInput node, the IDOC parser processes the SAP-defined elements in the DC, then, for each DD, processes the SAP-defined elements, and calls the MRM parser to process the user-defined segment data, as described by your exported IDoc, using the CWF physical format. The MRM parser knows the Message Type property to use for the user-defined segment, because it is obtained from the SAP-defined DD field segnam by the IDOC parser.

Tip: SupportPac IA0F contains a more detailed description of the steps involved in building the IDoc message model. You can ignore utilities IDocHeaderTweak and IDocMsgSetTweak because that processing has been incorporated into the New Message Definition File From C Header File wizard.