cancel
Showing results for 
Search instead for 
Did you mean: 

Nested structur for receiver file content conversion

Former Member
0 Kudos

Hello all,

i have the following problem to set up a nested XML-structure to an flatfile.

XML-Structure:

LtcRecords (root)

Header

Deduction

Trailer

Now i want to convert the Header,Deduction and Trailer values to an flatfile.

I tried it with a lot of possibilies. But without an result.

Recordset Structur: LtcRecords

LtcRecords.fieldNames: Header,Deduction,Trailer

Header.fieldFixedLengths: 1,10,5

Header.fieldNames:id,group_id,location_id

Deduction.fieldFixedLengths: 1,10,3

Deduction.fieldNames:id,group_id,product_code

Trailer.fieldFixedLengths: 1,10,5,3

Trailer.fieldNames:id,group_id,location_id,product_code

I hope somebody can help me with my wrong settings.

Many thanks

ilka

-


Attachments:

Source:

<?xml version="1.0" encoding="utf-8" ?>

<ns1:mt_Metlife0>

<LtcRecords>

<Header>

<id>A</id>

<group_id>0000700015</group_id>

<location_id>00002</location_id>

</Header>

<Deduction>

<id>D</id>

<group_id>0000700015</group_id>

<product_code>GPC</product_code>

</Deduction>

<Trailer>

<id>Z</id>

<group_id>0000700015</group_id>

<location_id>00002</location_id>

<product_code>GPC</product_code>

</Trailer>

</LtcRecords>

<LtcRecords>

<Header>

<id>A</id>

<group_id>0000700013</group_id>

<location_id>00005</location_id>

</Header>

<Deduction>

<id>D</id>

<group_id>0000700013</group_id>

<product_code>GPC</product_code>

</Deduction>

<Trailer>

<id>Z</id>

<group_id>0000700013</group_id>

<location_id>00005</location_id>

<product_code>GPC</product_code>

</Trailer>

</LtcRecords>

</ns1:mt_Metlife0>

Target:

A000070001500002

D0000700015GPC

Z000070001500002GPC

A000070001300005

D0000700013GPC

Z000070001300005GPC

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

I tried the same scenario successfully.

I had given the same input xml and got same output as u want.

The settings of my File Adapter is as follows:

Recordset Structure: LtcRecords,Header,Deduction,Trailer

Header.fieldFixedLengths: 1,10,5

Header.fieldNames:id,group_id,location_id

Deduction.fieldFixedLengths: 1,10,3

Deduction.fieldNames:id,group_id,product_code

Trailer.fieldFixedLengths: 1,10,5,3

Trailer.fieldNames:id,group_id,location_id,product_code

LtcRecord.fieldSeparator:'nl'

File Type: Text

File Encoding:UTF-8

Try with these settings u will definately get the output.

Regards

Arpit Seth

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi llka,

try using following content conversion:

Recordset structure : Header,Deduction,Trailer

Header.fieldFixedLengths = 1,10,5...

Deduction.fieldFixedLenghts = 1,10,3...

Trailer.fieldFixedLenghts = 1,10,5,3

Header.fixedLengthTooShortHandling = ignore

Deduction.fixedLengthTooShortHandling = ignore

Trailer.fixedLengthTooShortHandling = ignore

This worked for me.

Regards,

Sulakshana

Former Member
0 Kudos

Arpit, no that is not the solution. The result is an file with 0 kb.

Former Member
0 Kudos

Hi

Make ur settings as follows and then chk it

Recordset Structur: LtcRecords,Header,Deduction,Trailer

LtcRecords.fieldNames: Header,Deduction,Trailer

Header.fieldFixedLengths: 1,10,5

Header.fieldNames:id,group_id,location_id

Deduction.fieldFixedLengths: 1,10,3

Deduction.fieldNames:id,group_id,product_code

Trailer.fieldFixedLengths: 1,10,5,3

Trailer.fieldNames:id,group_id,location_id,product_code

LtcRecords.fieldSeperator:'nl'

Hope it helps.

Regards

Arpit Seth

Former Member
0 Kudos

Hi, the blog shows me the sender case!

How can i config the the "Recordset Name" and the "Recordset Structur"

for the receiver case?

thanks

ilka

Former Member
0 Kudos

In the file receiver comm.channel configuration, use <b>message protocol</b> as <b>File Content Conversion</b>

Then you will <b>Record Structure</b> in the content conversion parameters.

Add your parameters by clicking the + symbol in the table.

regards

SKM

Former Member
0 Kudos

check these blogs:

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter

Regards

Priyanka

Former Member
0 Kudos

Look at Venkat's blog

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

regards

SKM