Skip to Content
avatar image
Former Member

Nested structur for receiver file content conversion

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 24, 2005 at 01:37 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2005 at 07:36 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2005 at 08:05 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Aug 23, 2005 at 04:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 23, 2005 at 08:15 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 24, 2005 at 11:28 AM

    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

    Add comment
    10|10000 characters needed characters exceeded