Content Conversion (Pattern/Random content in input file)


SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

Content Conversion (Pattern/Random content in input file)

Content Conversion (Pattern/Random content in input file)

The scenario deals with the content conversion so as to extract all the data in an input file wherein the content may follow a pattern or content is random.

The Data type is shown as below:

image
Note: During the creation of data type the header, hbatch, body , tbatch and trailer are created at the same level and a recordset creation is ignored.

Here it can be noted that header and trailer have their occurrences as 1 while the hbatch, body and tbatch are 0 to unbounded. In this case the pattern noticed is that the header and trailer comes once and within it hbatch, body and tbatch occur. The body comes repeating in between an hbatch and tbatch. The sample file below will throw more light.

The sample file:

0112345010101

021111112222

03100001111112222

03100011111212223

041000011111

021231116722

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

03100781119012332

041005611001

059453287699

In the Integration directory, the following has to be mentioned at the configuration of the communication channel.

image image

The recordset name is optional. Even though it is mentioned, it can be ignored by the statement ignoreRecordsetName = true . In the recordset structure, the occurrence for trailer has to be set to ‘ * ‘. The recordsets per message is set to ‘ * ‘. This specifies the number of recordsets to be grouped together in a message. All recordsets are thus included in the XML message.

The output XML thrown to XI for further processing is as shown below:

image

image
Suppose the trailer occurrence is mentioned as 1 (as in the data type created ) then the output XML would not have the complete data as in the input file, rather only the final hbatch, body and tbatch occurring before the trailer would be included in the message.

The output XML after content conversion would be then as follows for the same input file:
image

NOTE: In case, whole of the file follows a random content then all you need to change is the occurrence (make all the nodes as 0 – unbounded) during the creation of data type. At the communication channel configuration, the number of substructures need to be mentioned as * for the sequence.

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 fcc2file senario, file2file senario, idoc senario step by step, sap mdm tutorials, sap pi training, SAP XI. Bookmark the permalink.

Leave a Reply

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