- File Content Conversion In Sap Pi At Receiver Free
- File Content Conversion In Sap Pi Receiver
- What Is Sap Pi 7.0
Hi Karthik, In Receiver file adapter. message protocol select the option file content conversion from teh drop down menu. After that at the end you can see the Content Conversion Parameters in that give your root name in the place of Recordset Structure. Jul 24, 2008 1) If the Sender is sending the.txt or.csv etc files means we use Content conversion at Sender file adapter inorder to convert that formt into xml. Why because XI can understand only xml format. 2) in the other case if it is Idoc-File means, and the File requires.txt or.csv format file to be generate at their end means, we use Content.
Skip to end of metadataGo to start of metadataXI 3.0 SP9 provides a new function in the Adapter Framework. You can now use aconversion module in the various adapters, which enables you to convert XML files to flatstructures and the other way around.This guide shows you example configuration files. It does not describe all possibleparameters. For more information, see the online documentation.
In the Adapter Framework, all adapters are developed as modules. These modules canbe combined with other standard or user-defined modules. In the communicationchannel configuration, you can use theModuletab page to enter additional modules foreach receiver or sender channel.In SP9, there is a standard moduleMessageTransformBean for specific conversionroutines, particularly in the JMS adapter. You can use this module in sender and receivercommunication channels.For sender channels, you can choose either a simple transformation to handle files inwhich all rows have the same structure, or a more complex transformation for files inwhich the rows can have different structures.For receiver channels, you can only use the simple transformation.All transformations can handle comma-separated-value (CSV) structures or structureswith fixed field length. The options are very similar to the FCC adapter.
The first step for each configuration is to add the conversion module to thecommunication channel.Open the communication channel, select theModuletab page, and add the conversionmodule to the provided JMS adapter modules as follows:
Module Sequence in the Sender Channel
No. | Module Name | T | Module Key |
---|---|---|---|
1 | localejbs/SAP XI JMS Adapter/ConvertJMSMessageToBinary | L | ReceiveMsg |
2 | localejbs/SAP XI JMS Adapter/ConvertBinaryToXMBMessage | L | ConvertMsg |
3 | localejbs/AF_Modules/MessageTransformBean | L | Plain2XML |
4 | localejbs/CallSapAdapter | L | ForwardToMS |
Module Sequence in the Receiver Channel
No. | Module Name | T | Module Key |
---|---|---|---|
1 | localejbs/AF_Modules/MessageTransformBean | L | XML2Plain |
2 | localejbs/SAP XI JMS Adapter/ConvertMessageToBinary | L | CallJMSService |
3 | localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService | L | Exit |
The names of the module keys are only examples. You can choose any name. However,for the parameter configuration you must refer to the module key name you haveassigned to the module MessageTransformBean.Make sure that you do not enter any spaces after parameter names or values in yourconfiguration, especially after copying values to the configuration from text files.The field length for the parameter values is only 256 bytes; this may mean you have touse short names for the XML field names. (With SP12 there is no restriction any more)
3.1 Example of a Simple Conversion in a Sender Communication Channel
Let us assume that we have a very simple file structure containing three fields with threebytes each, and a sample file with two rows:
Example
This leads to the following entries in the module configuration of the module processor:
Module Key | Parameter Name | Parameter Value |
---|---|---|
Plain2XML | Transform.Class | com.sap.aii.messaging.adapter.Conversion |
Plain2XML | Transform.ContentType | text/xml;charset=utf-8 |
Plain2XML | xml.conversionType | SimplePlain2XML |
Plain2XML | xml.processFieldNames | fromConfiguration |
Plain2XML | xml.documentName | MyDocument |
Plain2XML | xml.documentNamespace | http://xi.com/test |
Plain2XML | xml.structureTitle | MyTitle |
Plain2XML | xml.fieldNames | field-name1,field-name2,field-name3 |
Plain2XML | xml.fieldFixedLengths | 3,3,3 |
The result of this conversion looks like this:
If you have a CSV file, you use the parameterxml.fieldSeparator(with parameter value',') instead ofxml.fieldFixedLengths.
3.2 Structure Conversion in a Sender Communication Channel
The structure conversion can handle files containing rows with different structures. Ineach row there is a key field to identify the structure. The rows with identical key fields ofcourse have identical structures.Let us assume that we have a sample file with four rows. Each row has a two-byte keyfield; the first row has a second field with ten bytes; the structure of the second and thirdrows is the same and comprises two additional fields with three bytes each; the last rowhas a second field with five bytes:
The configuration for the conversion could look like this:
Module Configuration
Module Key Parameter Name Parameter Value
Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
Plain2XML Transform.ContentType text/xml;charset=utf-8
Plain2XML xml.conversionType StructPlain2XML
Plain2XML xml.processFieldNames fromConfiguration
Plain2XML xml.documentName MyDocument
Plain2XML xml.documentNamespacehttp://xi.com/test
Plain2XML xml.recordsetName MyRecordset
Plain2XML xml.recordsetStructure NameA,1,NameB,*,NameC,1
Plain2XML xml.keyFieldName MyKey
Plain2XML xml.keyFieldType CaseSensitiveString
Plain2XML xml.NameA.fieldNames MyKey,field-nameA
Plain2XML xml.NameA.fieldFixedLengths 2,10
Plain2XML xml.NameA.keyFieldValue AA
Plain2XML xml.NameB.fieldNames MyKey,field-nameB1,field-nameB2
Plain2XML xml.NameB.fieldFixedLengths 2,3,3
Plain2XML xml.NameB.keyFieldValue BB
Plain2XML xml.NameC.fieldNames MyKey,field-nameC
Plain2XML xml.NameC.fieldFixedLengths 2,5
Plain2XML xml.NameC.keyFieldValue CC
Inxml.recordsetStructure,you add a name for each different structure followed by thennumber of occurrences or an asterisk for unbounded occurrences. For each structurename, you configure the structure separately in a separate namespace such asxml.NameA.fieldNamesand so on.If your source file is a CSV file, replace eachxml.XXX.fieldFixedLengthswithxml.XXX.fieldSeparator.
The result of this conversion looks like this:
3.3 Simple Conversion in a Receiver Communication Channel
For a receiver channel, only the simple conversion is available. The XML structure of thesource file has to follow the same structure as the result of the SimplePlain2XMLconversion:
<resultset>
<row>
<column-name1>ABC</column-name1>
<column-name2>12345</column-name2>
<column-name3>My Text</column-name3>
</row>
<row>
<column-name1>XYZ</column-name1>
<column-name2>67890</column-name2>
<column-name3>This Text is too long</column-name3>
</row>
</resultset>
Module Configuration
ModuleKeyParameter Name Parameter Value
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.conversionType SimpleXML2Plain
XML2Plain xml.addHeaderLine 0
XML2Plain xml.fieldFixedLengths 3,5,10
XML2Plain xml.fixedLengthTooShortHandling Cut
The result of this conversion looks like this:
ABC12345My Text
XYZ67890This Text
If you want to create a CSV file, use parameterxml.fieldSeparatorinstead ofxml.fieldFixedLengths.Note: The names of the tags are examples. You can choose any name you like. As thetags are not identified by name, you have to assure that no tag is missing.
3.4 Structure Conversion in a Receiver Communication Channel
In a receiver communication channel, we want to map an XML file to a complex plain filewith different lines. The XML structure of the source file has to follow the same structureas the result of the SimplePlain2XML conversion:
<resultset>
<row>
<NameA>
<field-nameA1>1234567890</field-nameA1>
<field-nameA2>XYZ</field-nameA2>
</NameA>
</row>
</row>
<row><NameB>
<field-nameB1>ABC</field-nameB1>
<field-nameB2>DEF</field-nameB2>
<field-nameB3>GHI</field-nameB3>
File Content Conversion In Sap Pi At Receiver Free
</NameB>
</row>
</row>
<row><NameB>
<field-nameB1>OPQ</field-nameB1>
<field-nameB2>RST</field-nameB2>
<field-nameB3>UVW</field-nameB3>
</NameB>
</row>
</row>
<row>
<NameC>
<field-nameC>12345</field-nameC>
</NameC>
</row>
</resultset>
</row>
</resultset>
Module Configuration
Module Key | Parameter Name | Parameter Value |
---|---|---|
XML2Plain | Transform.Class | com.sap.aii.messaging.adapter.Conversion |
XML2Plain | Transform.ContentType | text/plain;charset=utf-8 |
XML2Plain | xml.conversionType | StructXML2Plain |
XML2Plain | xml.addHeaderLine | 0 |
XML2Plain | xml.recordsetStructure | NameA,NameB,NameC |
XML2Plain | xml.NameA.fieldFixedLengths | 3,3 |
XML2Plain | xml.NameA.fixedLengthTooShortHandling | Cut Sims 4 space cc. For now, you have to stare in your in-game phone while traveling to another destination. Don’t worry, you have plenty of things to do here. |
XML2Plain | xml.NameB.fieldFixedLengths | 3,3,3 |
XML2Plain | xml.NameC.fieldFixedLengths | 5 |
The result of this conversion looks like this:
123ABCABCDEFGHIOPQRSTUVW12345
If you want to create a CSV file, use parameterxml.NameA.fieldSeparatorinstead ofxml.fieldFixedLengths.
File Content Conversion In Sap Pi Receiver
The tag names NameA, NameB, and NameC are just examples; you can choose anynames for the tags, but you must make sure that the structure is identical.
NOTE: You can also use the .endSeparator parameter to control the line termination behavior similar to the function by the same name in the FCC adapter.
What Is Sap Pi 7.0
N.B., this is the content from the How To guide - 'How to Use the Content Conversion Module with the XI 3.0 J2EE JMS Adapter' which is no longer available on SDN.