This topic contains sections marked as revised for this release

WebSphere Message Brokers
File: ac20030_
Writer: Bill Oppenheimer

Task topic

This build: July 31, 2007 21:19:18

Building the message model for the IDOC parser

To build the message model for the IDOC parser, obtain the IDoc, model the IDoc, and use ESQL to access the fields of the IDoc.

To transform SAP IDoc data, model the segment data of the IDoc in WebSphere Message Broker.

The messages that are sent to, and received from, SAP applications are processed by the IDOC parser, which requires a message model to interpret the data correctly. This topic describes how to build the message model. SupportPac™ IA0F provides, as an example, a prebuilt version of a message model.

Obtaining the IDoc

Create an import file of the required IDoc data for the Message Brokers Toolkit.
  1. Log on to a SAP system.
  2. Run the supplied transaction we60, which extracts the IDoc data as a C header file.
    1. In ObjectName, select the IDoc type of interest; for example, MATMAS02.
    2. Select the version of the record type. A version 4 IDoc is type 3.
    3. Click C-header in the Documentation menu.
    4. When prompted, enter a file name for the output from the transaction. The C representation of the IDoc is saved to this file.
  3. Use the Perl script hdrfiddle.pl, which is supplied in SupportPac IA0F, to ensure that the format of the output file that you have created is correct for importing into the Message Brokers Toolkit.

Modeling the IDoc

Create your message model.

  1. Switch to the Broker Application Development perspective.
  2. Use the New Message Set Project wizard to create a message set for your IDoc (for example, matmas02), and to create a Custom Wire Format (CWF) physical format.
  3. Use the Message Set editor to change the message set Message Domain property to IDOC.
  4. Use the New Message Definition File From ... wizard to import a prebuilt model of the overall IDoc. This model includes definitions of the DC and DD segments. Select the file idoc.xsd. For information about using the New Message Definition File From wizard, see 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. Specify the following settings:
    • 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 wizard, see Importing from C.
  6. Rename each message to be the name of the segment that it represents. The name must be in uppercase characters. For example, for a segment called E2MARAMM, name the message E2MARAMM.

Add the message set to a broker archive (bar) file and deploy the bar file to a broker execution group. The IDOC parser uses the MRM parser to parse the IDoc segments that you have defined.

The Message Domain property, the message set name, and the Custom Wire Format name, are used when you create a message flow to process an IDoc. These names appear as the values of the Message Domain, Message Set, and Message Format properties, respectively, of an MQInput node. Do not supply a Message Type property on the MQInput node because the IDOC parser uses the contents of the SAP-defined IDoc DD field segnam to provide the name of the message.

Accessing fields of the IDoc using ESQL

Use the ESQL editor Content Assist to fill in the SAP-defined fields of the IDoc.

After the sdatatag tag in an ESQL statement, the next tag is MRM, which you must enter manually, followed by the field name that is to be manipulated. Specify the name of the field within the message segment here, not the name of the message segment.

For example, the following code sets the segment name of the IDoc:

SET OutputRoot.IDOC.DD[I].segnam  = 'E2MAKTM001';
The following example sets the msgfn field within the E2MAKTM001 segment:
SET OutputRoot.IDOC.DD[I].sdatatag.MRM.msgfn = '006';     
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:19:19

ac20030_ This topic's URL is: