cancel
Showing results for 
Search instead for 
Did you mean: 

Content conversion without delimiter and key fields

Former Member
0 Kudos

I am pretty new to XI, so it has been very challenging till now... (and someway I want to keep it that way) But this problem has kept me awake a couple of nights, so I will unleash it to the XI experts at SDN!

I have to read a legacy file (customers are ordering stuff) with the following content into XI. I finally found out you can use file content conversion to do the job, but I have only seen scenarios where people can use delimiters or key fields so far. I suppose XI can do this job as good as the others, but the question is how it has to be done! :-s

Do I have to use key fields? Or can I simply state there will be 1 header line, X order lines, 1 EOF line?

Sample content:

100207.310551

0107299700001

0108658400001

0109575600001

1200276500001

0109745600001

9999999999999

Header line containing the customer (100207) and the ticket number (300551) separated by a dot.

In this case 5 order lines containing material (8 digits, ex 01072997) and quantity (5 digits, ex 00001)

Line containing only 9's to indicate the end of the file has been reached.

Thanks in advance!

Sven

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks a lot for answering that fast!

Maybe I was not that clear about this, but besides the header line I don't have a delimiter and I don't have a key field for any of the records.

The output format I would like the sample legacy file to be converted to is the following:

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

<ns0:bestin xmlns:ns0="http://test.com">

<recordset>

<client>100207</client>

<ticket>310551</ticket>

<item>

<material>01072997</material>

<quantity>00001</quantity>

</item>

<item>

<material>01086584</material>

<quantity>00001</quantity>

</item>

<item>

<material>01095756</material>

<quantity>00001</quantity>

</item>

<item>

<material>12002765</material>

<quantity>00001</quantity>

</item>

<item>

<material>01097456</material>

<quantity>00001</quantity>

</item>

</recordset>

</ns0:bestin>

Former Member
0 Kudos

Hi Sven,

This FCC might help u..If your structure like ...

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

<ns0:bestin xmlns:ns0="http://test.com">

<recordset>

<header>

<client>100207</client>

<ticket>310551</ticket>

</header>

<item>

<material>01072997</material>

<quantity>00001</quantity>

</item>

<item>

<material>01086584</material>

<quantity>00001</quantity>

</item>

<item>

<material>01095756</material>

<quantity>00001</quantity>

</item>

<item>

<material>12002765</material>

<quantity>00001</quantity>

</item>

<item>

<material>01097456</material>

<quantity>00001</quantity>

</item>

</recordset>

</ns0:bestin>

then

RecordStructure----header,item

otherwise

RecordStructure----client,ticket,item

client.fieldFixedLengths----give length of client

ticket.fieldFixedLengths----

item.fieldFixedLengths----

client.fixedLengthTooShortHandling--Cut

ticket........same

item.....

client.addHeaderLine--0

ticket........same

item.....

recordsetStructureOrder---var

Cheers!

Samarjit

Message was edited by:

Samarjit Dey

Former Member
0 Kudos

Hi Sven,

Can u tell us what is your out put format?

Cheers!

Samarjit

Shabarish_Nair
Active Contributor
0 Kudos

100207.310551

0107299700001

0108658400001

0109575600001

1200276500001

0109745600001

9999999999999

can you find keyfields for your records ? then in that case we can read the file using FCC.

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

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

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns

/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

else you can read your file using record row option - /people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi