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

Objective of this document to demonstrate the configuration steps in B2B Integration Cockpit for conversion of a Plain Fixed Length Flat file  to a XML Structure/File.

During creation of this document, got valuable inputs from:

  1. http://help.sap.com/saphelp_nw-b2b-addon103/helpdata/en/f7/841b9351844d67ae2ace9a02c94884/content.ht...
  2. http://scn.sap.com/community/b2b-integration/blog/2014/05
  3. http://wiki.scn.sap.com/wiki/display/TechTSG/Troubleshooting+Information+for+EDI-XML+Converters?orig...

The B2B Integration Cockpit is a central application that allows us to monitor and access business-to-business add-on from SAP NW PI environment.



This Document is mainly focus on Plain to XML conversion

The EDI content manager is an application that Export/Import, Generate XSD, View, Customize and Test conversion of EDI messages.

Requirement Description

Using conventional File Content Conversion we can’t handle File hierarchy greater than 3.


With B2B add-on Plain to XML conversion functionality, we can easily convert a multi-hierarchical flat file to a nested XML structure.


We have the below Flat file where first line first 3 character (HMI) is the pattern for Message Type (DeviceDetails).


  • Pattern “DH” for Record Type “DEVICE” ;
  • Pattern “PC” for Record Type “PPCON”;
  • Pattern “ND” for Record Type “NDISBCAL” ;
  • Pattern “EL” for Record Type “ELEC”



And we need the following nested XML structure:


DeviceDetails

..........HEADER

              ......

...…….DEVICE

              ......

…….…PPCON

              .....

……………..NDISBCAL

                  .......

………...........………ELEC

                              ..........

     

Configuration Steps

Step 1:             

To log in to the B2B Cockpit use the below link

http://<host>:<port>/b2bic

Below screen will appear which will ask your credential to login.





Once you have logged in, the screen that will appear is given below.



Step 2: From the above list of option click on the EDI Content Manager



The below screen will appear



We can see above that there are various options like Edifact, Eancom, Ansi X.12, Odette, Tradacoms, VDA and Plain. All these are required for conversion from the message format which is involved in the scenario to XML format or from XML format to the message format required.

In this document we will focus on Plain to XML conversion.

Step 3:

Go to Plain->Editor->Message Editor, like the screenshot below and then click Message Editor





On clicking the Message Editor we will get the below screen



We can see there are three buttons Create, Update and Delete

Create has the following option (as given in below screen shot) and is used to create a new message structure.




Update has the following option (as given in below screen shot) and is used to update/change any existing message structure, add inner set (sub segments) and add fields in the structure.



Delete has the following option (as given in below screen shot) and is used to delete Record Row, Message and Control Key.



First need to create a new message structure by creating a Control Key, Message and Set and then will update the message by adding fields and inner set. If required we can edit the message also.


Control key represents version and Control Key Association Table provides the information that which Integration Flow should use which Control Key (Version).

All standard content delivered by SAP is delivered under control key name "SAP".



We can create our own Control Key (Version) and we need to make an entry into Control Key scenario association table to enable runtime usage of this version corresponding to an integration scenario. By default all the fields are populated with “.* “.

Step 4: Creation of Control Key


Go to Create->Control Key and click Control Key



The below screen will appear



Provide Control Key name as DemoPlainToXML and Click the Create Button



Control Key is now created and it can be seen in the list of Control Key.




Step 5: Creation of Message

Under Control Key you can define multiple message type/message type with versions.

Go to Create->Message and click on Message.



Below screen will appear.



Here Name is “Name of the message type/message type with versions”

Starts With is “A pattern that denotes beginning of a message structure (can be filled with a regular expression)”

New Line is “Line Feed (Windows), Line Feed (UNIX), TAB and Space”.

Line Feed (Windows) is generally used when we are picking or dropping files from or to any Windows System. Similarly Line Feed (UNIX) is used when we are picking or dropping files from or to any Unix System.



Enable Customized New Line is used to enter a customized new line in hexadecimal format.


Strict Length check box is checked in case of Fixed Length file. For CSV file it will be unchecked.


Char Set is which Character Encoding should be used. e.g. UTF-8 or ISO-8859-15 etc.

Document Start is Starting line of the converted document (inserted during conversion) (e.g. <DeviceDetails>).


Document End is End line of the converted document (inserted during conversion) (e.g. </ DeviceDetails >)

We enter the following value to the fields and Click on Create Button.



Therefore now Control Key and Message is created. So in the message editor screen both the Control Key and the corresponding Message Type will appear.



Step 6: Creation of Set

One message type version may contain multiple Set (Record)

Go to Create->Set and click on Set.



The below screen will appear.



Name is Name of the Set (Record).


Starts With is a Pattern that will denote the beginning of a set/Record (can be filled with a regular expression).


Set Type is Type of the record “CS“(character-separated fields) “FF“(field with fixed length).


If we don’t want to populate any particular set in target XML then check the Check box Comment Set

We enter the following value to the fields and Click on Create Button.



We can see the set HEADER for the Message Type: DeviceDetails and Control Key: DemoPlainToXML.



Step 7: Creation of fields


Now under this HEADER set we will add required fields.

Select the set HEADER and then go to Update->Add Field and click Add Field



The below screen will appear



Name is “Name of the field”.


Length is “Length of the field”.


Orientation can be Left or Right oriented.

Fill Character can be 0, Space or TAB.

Suppose a field is of length 5 and Orientation is Right. Then if in actual, a data of length 3 comes and if Fill Character is 0 , in that case the data in the file should be like 00<Data of length 3>.Similarly if Fill Character is Space in that case there will be 2 Spaces in the front.


If we check the Check box for Enable Customized Fill Character, we will get the option “Customized Fill Character” where we can put Fill Character of our own choice.


We enter the following value to the fields and Click on Create Button





Now we can see one field under the Set HEADER



If we want to add a field above or below RecordID field then we have to choose the following option Add Field Below or Add Field Above accordingly. Remaining process for creating the field is same as given above.




In the similar fashion we will add:

  • Fields ID and Type under the Set HEADER.
  • We will create Set PPCON and add fields RecordID, EmergencyCreditLimit and EmergencyThresholdValue under it.
  • We will create DEVICE and add fields RecordID, DEVGUIID and POD under it.

Step 8: Creation of Inner Set

We will now create an Inner Set under the Set PPCON

Select the Set PPCON and then Go to Update->Inner Set and Click Inner Set.




The below screen will appear



We will select New, when we are creating a new Inner Set and will select Existing if we are reusing an existing one.

Below screenshot when we are selecting Existing option.



In this document we are creating a new Inner Set.

We enter the following value to the fields



The Inner Set is created under the Set PPCON



We can now add fields to it in the similar way as discussed before in this document.

Also we can add Inner Set under NDISBCAL in the same way. For that we have to select NDISBCAL and then go to Update->Add Inner Set.

We have created one Set MSGNAME with the option Comment Set checked. We will see that in the target side this particular Set will not be there.



Our entire message structure is now available.



In Second Part of the document we will discuss about how the conversion happened by Adapter Module. We will also learn how to locally test the conversion result, XSD generation and Module configuration in Communication Channel.


Second Part: B2B Integration Cockpit:- How To Convert Plain to XML Step by Step -Part II


3 Comments
Labels in this area