cancel
Showing results for 
Search instead for 
Did you mean: 

Content conversion at JMS sender communication channel

Former Member
0 Kudos

Hi friends,

I have to convert fixed length flat structure to xml message.Therefor i have to do content conversion at the JMS sender comm channel.Can someone please explainthe procedure?

data in the queue would be like as follows.

9999000000124646q12233appej500rc11147822zord

Accepted Solutions (1)

Accepted Solutions (1)

former_member537867
Active Contributor
0 Kudos

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

You can use all the parameters fo content conversion in JMS adapter with the usage of adapter module

Refer step by step guide

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652...

use message protocol as NFS and put Conversion Module in module list before the adapter module;

For a reference, check this blog: /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework

The conversion module is the StrictXML2PlainBean.

Thanks

Swarup

former_member537867
Active Contributor
0 Kudos

Hi Manikandan,

The structure conversion can handle files containing rows with different structures. In

each row there is a key field to identify the structure. The rows with identical key fields of

course have identical structures.

Let us assume that we have a sample file with four rows. Each row has a two-byte key

field; the first row has a second field with ten bytes; the structure of the second and third

rows is the same and comprises two additional fields with three bytes each; the last row

has a second field with five bytes:

AA1234567890

BBABCABC

BBXYZXYZ

CC12345

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.documentNamespace http://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

In xml.recordsetStructure, you add a name for each different structure followed by the

number of occurrences or an asterisk for unbounded occurrences. For each structure

name, you configure the structure separately in a separate namespace such as

xml.NameA.fieldNames and so on.

If your source file is a CSV file, replace each xml.XXX.fieldFixedLengths with

xml.XXX.fieldSeparator.

the result of this conversion looks like this:

<ns:MyDocument xmlns:ns="http://xi.com/test">

<MyRecordset>

<NameA>

<MyKey>AA</MyKey>

<field-nameA>1234567890</field-nameA>

</NameA>

<NameB>

<MyKey>BB</MyKey>

<field-nameB1>ABC</field-nameB1>

<field-nameB2>ABC</field-nameB2>

</NameB>

<NameB>

<MyKey>BB</MyKey>

<field-nameB1>XYZ</field-nameB1>

<field-nameB2>XYZ</field-nameB2>

</NameB>

<NameC>

<MyKey>CC</MyKey>

<field-nameC>12345</field-nameC>

</NameC>

</MyRecordset>

</ns:MyDocument>

Regards,

Vinod.