Skip to Content
author's profile photo Former Member
Former Member

XI 3.0 File Content Conversion of Complex Input File

I’m trying to send a semicolon separated complex flat file to XI 3.0 using the file adapter and file content conversion.

When I create a simple conversion it works fine, for example:

Input file data like:

1000000251;Jim Smith;0000010860;Jones

Document Name: Debmas_msg

Document Namespace: http://sap.com/xi/FiletoDebmas

Recordset Name: Debmas_msg

Recordset Structure: Debmas_STR,1

Records per Message: 1

Name Value

Debmas_STR.fieldSeparator ;

Debmas_STR.fieldnames kunnr, Name, parnr, parnr_lastname

Debmas_STR.processFieldNames fromConfiguration

This gives the following Inbound Payload MainDocument.

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

- http://sap.com/xi/FiletoDebmas">

- <Debmas_msg>

- <Debmas_STR>

<kunnr>1000000251</kunnr>

<Name>Jim Smith</Name>

<parnr>0000010860</parnr>

<parnr_lastname>Jones</parnr_lastname>

</Debmas_STR>

</Debmas_msg>

</ns:Debmas_msg>

However, I need a complex Inbound Payload MainDocument like the following:

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

- http://sap.com/xi/FiletoDebmas">

<kunnr>1000000251</kunnr>

<Name>Jim Smith</Name>

- <Contact>

<parnr>0000000726</parnr>

<parnr_lastname>Smith</parnr_lastname>

</Contact>

- <Contact>

<parnr>0000010860</parnr>

<parnr_lastname>Jones</parnr_lastname>

</Contact>

</ns:Debmas_msg>

<b>When I try to create a complex conversion my file never gets polled</b>.

Here is an example of my complex conversion:

Document Name: Debmas_msg

Document Namespace: http://sap.com/xi/FiletoDebmas

Recordset Name: Debmas_msg

Recordset Structure: Debmas_STR, 1, Contact, *

Records per Message: 1

Name Value

Debmas_STR.fieldSeparator ;

Debmas_STR.fieldnames kunnr, Name, Contact

Debmas_STR.processFieldNames fromConfiguration

Contact.fieldSeparator ;

Contact.fieldnames parnr, parnr_lastname

Contact.processFieldNames fromConfiguration

My input file would look like:

1000000251;Jim Smith;

0000000726;Smith

0000010860;Jones

OR

1000000251;Jim Smith;0000000726;Smith;0000010860;Jones

I'd prefer the multi-line input file, but can live with the single line version. However, currently I can't get either to work.

Obviously I’m not setting up my complex conversion correctly. Any help would be appreciated.

Thanks,

Jeff

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 05, 2005 at 12:02 PM

    When you check the Adapter Monitor:

    http://<YourHost>:<YourPort>/AdapterFramework

    you will find the problems in your configuration easily.

    In your example the conversion cannot work, as you have no key fields to distinguish between the different lines.

    If your file would look like

    10;1000000251;Jim Smith;

    20;0000000726;Smith

    20;0000010860;Jones

    you could add the parameters

    Key Field Name: ID

    Key Field Type: String

    and

    Debmas_STR.fieldSeparator ;

    Debmas_STR.fieldnames ID,kunnr,Name,Contact

    Debmas_STR.keyFieldValue: 10

    Contact.fieldSeparator ;

    Contact.fieldnames ID,parnr,parnr_lastname

    Contact.keyFieldValue: 20

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Stefan, that worked.

      My File adapter configuration is now:

      Document Name: Debmas_msg

      Document Namespace: http://sap.com/xi/FiletoDebmas

      Recordset Name: Debmas_msg

      Recordset Structure: Debmas_STR, 1, Contact, *

      Records per Message: 1

      Key Field Name: ID

      Key Field Type: String

      Name Value

      Debmas_STR.fieldSeparator ;

      Debmas_STR.fieldNames ID,kunnr, Name

      Debmas_STR.processFieldNames fromConfiguration

      Debmas_STR.keyFieldValue 10

      Contact.fieldSeparator ;

      Contact.fieldNames ID,parnr, parnr_lastname

      Contact.processFieldNames fromConfiguration

      Contact.keyFieldValue 20

      This gives me the exact payload I need.

      Also thanks for the information on the Adapter Monitor. After I originally made the changes you suggested, I had a space at the end of my Contact.FieldSeparator parameter. In the Adapter Monitor I got the message "Parameter 'Contact_STR.fieldFixedLengths' or 'Contact_STR.fieldSeparator' is missing". I don't know how I would have found that without the Adapter Monitor.

      Thanks,

      Jeff

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 07:41 AM

    Hi Jeff

    Try to setup the file adapter configuration based on these lines. It works fine for me with the multiline file structure you have mentioned.

    conversion specific settings

    for mode=FILE2XMBWITHSTRUCTURECONVERSION

    xml.recordsetStructure=row,1,column,1

    xml.recordsetName=BLAH

    xml.recordsetsPerMessage=*

    xml.documentSkipFirstRows=1

    xml.row.fieldSeparator=;

    xml.column.fieldSeparator=;

    xml.documentName=BLAH

    xml.documentNamespace=http://sap.com/xi/CMDM

    xml.structureTitle=BLAHBLAH

    xml.row.fieldNames=AAA

    xml.column.fieldNames=BBB,CCC

    Regards

    Venu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.