Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

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-o...

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.

FieldDescription
IF_INDEXIndex of a line (normally the next number in the list)
S_PARTYSender partner, can also be filled with wildcard character (.*)
S_SERVICESender service can also be filled with wildcard character (.*)
R_PARTYReceiver partner, can also be filled with wildcard character (.*)
R_SERVICEReceiver service can also be filled with wildcard character (.*)
ACTION_NAMESPACENamespace of the adapter can also be filled with wildcard character (.*)
ACTION_NAMEName of the converter can also be filled with wildcard character (.*)
DIRECTIONDirection of the channel
PATTERNBeginning of the message structure (can be filled with a regular expression)
MESSAGETYPEMessage type
NEWLINELine separator of the record types (e.g #0D#0A)
STRICT_LENGTHFixed field length, “Y“ or “N“
CHARSETCharacter set (e.g. ISO-8859-15)
PLA_CTRL_KEYTable key for the dependent Plain conversion tables and the default is “1“
DOCUMENTSTARTStarting line of the converted document (inserted during conversion) (e.g. <doc>)
DOCUMENTENDEnd 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.

FieldDescription
MESSAGETYPEMessage type
INDEXSequence of the occurring record types in the message
PATTERNStarting character of the record type which can be used to clearly determine the record type
SET_NAMEName of the record type
SET_TYPEType of the record type “CS“ (character-separated record type) “FF“ (record type with fixed field length)
FIELDSEPERATORField 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.


FieldDescription
MESSAGETYPEMessage type
STATUS_CURRENTCurrent status – context the table entry refers to (starting context – must already be created by a previous record)
SET_NAMEName of the record type
STATUS_NEWNew status (new context for record)
SET_ACTIONAction 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.


FieldDescription
MESSAGETYPEMessage type
SETTYPESet type
FIELD_NAMEField name
FIELD_INDEXSequence of the fields in the record type (Always start numbering from 0)
FIELD_LENGTHLength of the field
FILL_CHARFill character for the field (#20 corresponds to a blank character or #30 to a zero)
ORIENTATIONOrientation 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


1 Comment
Labels in this area