File Content Conversion for Unequal Number of Columns


SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

File Content Conversion for Unequal Number of Columns

Now consider this scenario, the input flat file is in the following format.

  • Books, CD, Video, Games
  • CD, Games, DVD
  • DVD, CD, Video, Games, Books
  • Books
  • CD, DVD

The input file has different number of column fields in every row. In the first row it has 4, then, 3 then 5, then 1 and finally it has 2.

We have to convert this, as an output file in which every item should be placed in the corresponding itemset. The output file has the following format.

 

Books

CD

Video

Games

 

 

CD

Games

DVD

 

 

DVD

CD

Video

Games

Books

 

 

Books

 

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

 

CD

DVD

 

 

Here is the structure of the Input data type and the Output data type in the Design part.

Input Data type

image

Output Data type

image

Create the corresponding Message Types and Message Interfaces.

Now we will see the Message mapping.

Message Mapping

image

In the mapping to do this conversion we need a user-defined function.

User-Defined Function

Finally create the Interface Mapping also.

 

In the Configuration part, both the Sender and Receiver Communication channels will use File adapter.

 

In the Sender Communication channel, we have to choose the Message Protocol as File Content Conversion and also fill the Content Conversion Parameters as shown in the following picture.

 

image

And also add the following columns in the Content Conversion Parameters. These columns are sufficient to do this conversion.

 

image

Then do the remaining Confiuration part for executing this scenario.

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
PDF24    Send article as PDF   
This entry was posted in sap pi tutorials and tagged . Bookmark the permalink.

One Response to File Content Conversion for Unequal Number of Columns

  1. Ravi says:

    Very Great blog its lot of information about SAP XI

Leave a Reply

Your email address will not be published. Required fields are marked *