Building the Metadata files for the IDoc parser

SAP application clients connect across the WebSphere MQ Enterprise Transport. The messages sent to and received from SAP applications are processed by the IDoc parser, which requires a metadata file to interpret the data correctly. This section documents how to build the metadata file provided with the IDoc parser. Note that an example prebuilt version of the metadata file is provided in SupportPac IA0F. Use the following procedure to create the metadata of the required IDoc data:

  1. Logon to a SAP system
  2. Run the supplied transaction we60 that extracts the IDoc data as a C header file:
    1. For 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. Select C-header from the Documentation menu.
    4. Enter the filename for the output from the transaction when prompted.

Formatting the output without the SupportPac

This section documents how to use the IDoc parser without SupportPac IA0F. Use the following procedure to create the metadata of the required IDoc data:

  1. Use the supplied perl script hdrfiddle.pl to ensure that the output file form SAP you created is of the correct format to import into the MRM domain.
  2. In the workbench use this file as the source for importing a message set into WebSphere Business Integration Message Broker. See Importing file systems into the workbench for information on how to import structures into the MRM.
  3. Carry out the following procedure in the Message Domain menu:
    1. In the Parser field select MRM. The name of the message set appears, prefixed with the subset name, for example matmas02.
    2. Overwrite MRM in the Parser field with IDOC.
    3. Delete the subset name.
When structures have been imported and defined in the MRM domain, each segment of the IDoc can be created as a message component of this new message set. To create a message component you must associate the component with its compound type.
Note: You might have to add the compound types you have imported to the workbench's workspace before you can create the appropriate message component for your segment.

Formatting the output for import to the MRM domain

  1. Use the supplied perl script hdrfiddle.pl, also supplied in SupportPac 1A0F, to ensure that the output file form SAP you created is of the correct format to import into the MRM domain
  2. In the workbench use this file as the source for importing a message set into WebSphere Business Integration Message Broker. See Importing file systems into the workbench for information on how to import structures into the MRM domain.
When structures have been imported and defined in the MRM domain, each segment of the IDoc can be created as a message component of this new message set. To create a message component you must associate the component with its compound type.
Note: You might have to add the compound types you have imported to the workbench's workspace before you can create the appropriate message component for your segment.

Modeling the IDoc in the MRM domain

When you have imported the C structure into WebSphere Business Integration Message Broker, you have a number of MRM types. Each type represents a definition of an IDoc segment.

  1. Create a message set for your object, for example matmas02, and set its Custom Wire Format identifier to CWF.
  2. Create messages under this message set for all the segments that the IDoc parser needs to handle. Each message name should be the name of the segment it represents and be in capital letters. For example:
    Message Type
    E2MARMM e2marmm_1_type
  3. For each of the elements associated with each message, that is, segment of the IDoc, you might have to change the padding character to that of a space. This is because an IDoc is padded with spaces. For example, a model of a SAP segment in WebSphere Business Integration Message Broker called E2MAKTM001:
    E2MAKTM001 Message name to WebSphere Business Integration Message Broker, segment name in SAP
    msgfn First element name to WebSphere Business Integration Message Broker, field name in SAP
    spras Second element name
    maktx Third element name
    spras_iso Fourth element name
    fill954 Fifth element to make the size of this element up to 1000 characters
  4. From the Message Set panel of the workbench, select the element fill954 of the message E2MAKTM001, select the Custom Wire Format tab, and change the padding character to a space.
Start of change

Accessing fields of the IDoc using ESQL

To access a specific field within a specific IDoc segment, specify the name of the message segment and, to access a specific field of that segment after the sdatatag, code MRM to, and then the field name of the segment required.
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';     
End of change