Extra notes on configuring the Plain Message Format of the B2B add-on
This document is intended to provide extra information on the B2B adapter that SAP has supplied. It gives extra insight on how the tables are structured and should be filled avoiding common errors and easing the general use of B2B add-on.
The main focus will be on the plain to XML and XML to plain converter, but this will also be usable to customizing the other converters like EDIFACT and ANSI X12.
Our experience is based on SAP PI 7.31.
The original SAP Configuration document can be found on: Configuring the Plain Message Format – SAP NetWeaver Process Integration, business-to-business add-on 1.0 – SAP Library
Configuring the Plain Message Format is needed when you want convert XML to a plain message format or vice versa. An example of this would be an interface with a custom build system which provides a message in a plain text format but needs to be interfaces to SAP.
Configuring the Plain Message Format
1 Editing Tables
- To perform actions such as editing the table, inserting a new row, deleting selected rows, or exporting selected rows from the table of a Plain message type, choose Edit button at the bottom of the screen.
- To browse and import contents in Plain message, choose .
- To export selected Plain message types, choose .
Import and export of tables are only used for transporting from Development to QA/Test/Production environments. The files created from an export cannot be edited in any other software.
Remember the following points when configuring the adaptor:
- When using a regular expression, the wildcard character is .* [period star]
- Use ‘^’ before the pattern when it does not start with a wildcard
Here are some examples:
Pattern starting with SET, eg. [SETUP, SETALL, SETTING]
– use ^SET.*
Pattern containing ‘AA’ eg. [AABCDE, DDDAA, BCAAC]
– use .*AA.*
- Remember to always start FIELD_INDEX numbering with 0
2 Plain tables
Plain Java accesses tables with different functions:
This table manages single interfaces via which the key to be used (PLA_CTRL_KEY) is determined. This key can also be used to develop, in addition to cross-interface standard conversion rules, interface-specific versions of conversion rules.
This is the main table that must be configured and also gives the direction of the conversion that must take place. The PATTERN field must contain a recognizable pattern (preferable form the first line of the source file) and the DOCUMENTSTART and DOCUMENTEND field contains the start and end line of the target document.
|IF_INDEX||Index of a line (normally the next number in the list)|
|S_PARTY||Sender partner, can also be filled with wildcard character (.*)|
|S_SERVICE||Sender service can also be filled with wildcard character (.*)|
|R_PARTY||Receiver partner, can also be filled with wildcard character (.*)|
|R_SERVICE||Receiver service can also be filled with wildcard character (.*)|
|ACTION_NAMESPACE||Namespace of the adapter can also be filled with wildcard character (.*)|
|ACTION_NAME||Name of the converter can also be filled with wildcard character (.*)|
|DIRECTION||Direction of the channel|
|PATTERN||Beginning of the message structure (can be filled with a regular expression)|
|NEWLINE||Line separator of the record types (e.g #0D#0A)|
|STRICT_LENGTH||Fixed field length, “Y“ or “N“|
|CHARSET||Character set (e.g. ISO-8859-15)|
|PLA_CTRL_KEY||Table key for the dependent Plain conversion tables and the default is “1“|
|DOCUMENTSTART||Starting line of the converted document (inserted during conversion) (e.g. <doc>)|
|DOCUMENTEND||End line of the converted document (inserted during conversion) (e.g. </doc>)|
MESSAGE_TYPE: This is your own identifier for the message type. This name will be used in all tables to identify which tables setting are applicable for the message.
PATTERN: must be a unique pattern with which the source message can be identified. For a flat file, it will make your life much easier if there is a unique header line that can be used to identify the message. For XML as source, make sure you use a good first tag to uniquely identify the message.
This table is required for identifying the message record type through use of the pattern. The content of the tables will only be accessed when converting Plain-Text to XML.
|INDEX||Sequence of the occurring record types in the message|
|PATTERN||Starting character of the record type which can be used to clearly determine the record type|
|SET_NAME||Name of the record type|
|SET_TYPE||Type of the record type “CS“ (character-separated record type) “FF“ (record type with fixed field length)|
|FIELDSEPERATOR||Field separator for CS record types (empty if above field is set to “FF”)|
This table is used to control the message conversion and also the contexts.
|STATUS_CURRENT||Current status – context the table entry refers to (starting context – must already be created by a previous record)|
|SET_NAME||Name of the record type|
|STATUS_NEW||New status (new context for record)|
|SET_ACTION||Action for forming the record structure. “C“ stands for the field structure. (|REPEAT for multiple lines)|
This table describes the structure of the record types and the fields.
|FIELD_INDEX||Sequence of the fields in the record type (Always start numbering from 0)|
|FIELD_LENGTH||Length of the field|
|FILL_CHAR||Fill character for the field (#20 corresponds to a blank character or #30 to a zero)|
|ORIENTATION||Orientation of the field (“L“ = left-aligned, “R“ = right-aligned)|
3.1 Naming of fields/structures
Always try to keep the names descriptive of the data and structure. At this stage there must be no intelligence built into the naming because it is only file format conversion.
When changing any data or performing any action like saving, always scroll down completely in browser to check if there are any java error messages. This will give you some indication of what went wrong if you entered data but do not see it back when you clicked on save. You can also check the error messages on this list from Roshi Vijaywargiya : Troubleshooting Information for EDI-XML Converters – Technology Troubleshooting Guide – SCN Wiki