Introduction

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 Tables Import .
  • To export selected Plain message types, choose Tables Export .

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:

2.1     B2B_PLA_CTRL_IF

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.

Field Description
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)
MESSAGETYPE Message type
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>)

Please note:

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.

2.2   B2B_PLA_CTRL_SETID

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.

Field Description
MESSAGETYPE Message type
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”)

2.3   B2B_PLA_CTRL_MSG

This table is used to control the message conversion and also the contexts.


Field Description
MESSAGETYPE Message type
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)

2.4   B2B_PLA_CTRL_FIELD

This table describes the structure of the record types and the fields.


Field Description
MESSAGETYPE Message type
SETTYPE Set type
FIELD_NAME Field name
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 Notes

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

Here are some extra links:

B2B- EDI Inbound -Step by Step Configuration

The new B2B Add-On for SAP NetWeaver Process Integration

SAP PI : EDI <> EDI-XML Conversion Test Tool

SAP PI: Using the B2BADDON EDI<>XML Convertor Modules – Basics

Installation and Deployment of SAP NetWeaver B2B Add-On in PI 7.11+

EDI-XML conversion in SAP B2B Add-on: Some known problems & solutions


To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply