cancel
Showing results for 
Search instead for 
Did you mean: 

file content conversion

Former Member
0 Kudos

hi ,

in an o/b scenario the o/p is of type xml with the following structure

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

- <ns0:Output_MT xmlns:ns0="http://www.xxx.com">

- <Record>

<BranchCode>001</BranchCode>

<ItemCode>45</ItemCode>

<TransactionDate>002</TransactionDate>

<Quantity>3</Quantity>

<UnitRate>1</UnitRate>

<Amount>2121</Amount>

</Record>

</ns0:Output_MT>

i need this to be in a CSV format ... so the following values are given

Record set structure Record

Record.fieldFixedLengths 10

Record.fieldSeparator ,

the transaction is shown as successful in moni but file is not getting formed

the following error log is found in the receiver adapter monitoring

"Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '45')', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '45')', probably configuration error in file adapter (XML parser error)'"

can you please identify the problem & is this following value to be given for this case ? Record.endSeparator 'nl'

Accepted Solutions (1)

Accepted Solutions (1)

former_member192295
Active Contributor
0 Kudos

HI,

According your source structure you have more then one fields but target ur mentioned only one variable, i think it is problem.

follow below conversion

Source Strucutre:

<BranchCode>001</BranchCode>

<ItemCode>45</ItemCode>

<TransactionDate>002</TransactionDate>

<Quantity>3</Quantity>

<UnitRate>1</UnitRate>

<Amount>2121</Amount>

Target FCC Conversion

RECORD.fieldFixedLengths 3,2,3,1,1,4

RECORD.fieldNames branchcode,itemcode,transactiondate,quality,unitrate,amount

RECORD.endSeparator 'nl'

ignoreRecordsetName 'true'

Above one will work

Former Member
0 Kudos

hi nallam ,

can u please tell what am i supposed to give in record set structure ?

please explain what is the concept involved in this ?

former_member192295
Active Contributor
0 Kudos

HI,

Recordset strucutre as RECORD,*

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Vivek,

Yes, you have to give the Record.endSeparator 'nl'

Along with that, Record.fieldSeparator 'nl' and Record.addHeaderLine 0

This will work.

Yuga

Former Member
0 Kudos

i now get the o/p as

*Invalid at the top level of the document. Error processing resource 'file:///C:/Documents and Settings/kartii/csvtest20080...

001,45,002,3,1,2121*

as i gave the feild seperator as ","

but what is the use of giving

Record.addHeaderLine 0 & Record.endSeparator 'nl'

and why am i getting the first few lines ?

is it because its not in a xml structure and iam using a web browser to view it?

Edited by: vivek on Aug 12, 2008 11:15 AM

Former Member
0 Kudos

Hi,

>> Record.addHeaderLine 0 says that whether your text file has a header line or not.

>> Record.endSeparator 'nl' - after the end of each record it adds the new line character.Suppose if you have two or three sets of record after the end of each record set it will add an newline character.There should be an end separater to differentiate the record sets.

Yuga

Former Member
0 Kudos

Hi,

u want the out put as CSV file,so there is no need to give Record.fieldFixedLengths 10.

remove that and add Recor.fieldSeparator 'nl'.

Regards,

Sreedhar Goud

Former Member
0 Kudos
Former Member
0 Kudos

As per ur structure

Recorset structure - Record

u r right.

But when FieldfixedLengths is specified field separator is not needed.Further u have to specify length for all the fields.

Former Member
0 Kudos

Field Seperator is not required . as yours is Fixed Field Lengh.