on 08-12-2008 9:15 AM
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'
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Field Seperator is not required . as yours is Fixed Field Lengh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.