cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - File Content Conversion

mf_haq
Active Participant
0 Kudos

Hi Experts,

I'm using the SAP File Adapter with File Content Conversion to convert | (pipe) delimited records into XML.

Below FCC parameters used in SENDER FILE adapter configuration.

Record.fieldSeparator = |

Record.endSeparator = 'nl'

Record.fieldNames = Indicator|StockItemCode|Warehouse|OtherWarehouse|TransactionDate|StockBatchNumber|BatchExpiryDate|Quantity|TransactionType|ReasonCode|Reference|SystemReference|Zone

Test Data in NFS IN UTF-8 format:

D|300002572|LG||11/10/2013|C300023|08092014|2|Y|GP10|0080040018|720860|K

Eoor in Communication channel:

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 3 according to structure 'row':java.lang.Exception: ERROR in configuration / structure 'row.': More elements in file csv structure than field names specified!

As per the above error we can understant that csv contains more values than fields specified in channel. But we cross checked many times on fileds specified and values in csv ...result same. Please share some idea on this error

Info: Where as we tried same fields and same values with COMMA (,) separated and it's working absolutely fine.

Regards,

MFH

Accepted Solutions (0)

Answers (4)

Answers (4)

ambrish_mishra
Active Contributor
0 Kudos

Hi,

>>>>>>>>>>>>Record.fieldNames = Indicator|StockItemCode|Warehouse|OtherWarehouse|TransactionDate|StockBatchNumber|BatchExpiryDate

I think field names here should be seperated by comma.

You will specify the delimiter like -------- Record.fieldSeparator = |

Hope it helps!

Ambrish

Former Member
0 Kudos

Hi,

Correct syntax to use Record.fieldNames is field names separated by , (commas).

eg. use below parameter:

Record.fieldNames = Indicator,StockItemCode,Warehouse,OtherWarehouse,TransactionDate,StockBatchNumber,BatchExpiryDate,Quantity,TransactionType,ReasonCode,Reference,SystemReference,Zone

Hope it will work for you.

Cheers.

Sudeep


baskar_gopalakrishnan2
Active Contributor
0 Kudos

> More elements in file csv structure than field names specified!

Few cents.. See whether you specified field names all of them that is coming in the file . Also you did not have any typo mentioning field names with respect to field that you specified in the xml structure.  Please check that area first...

0 Kudos

Hi,

When you are sending file as .csv with pipe delimited, the complete record is considered as 1 field. Correct me if i am wrong. Hence, above error.

Sending the file as .txt with pipe delimited will work absolutely fine.

Regards,

Pranay

mf_haq
Active Participant
0 Kudos

Hi All,

Thanks for all inputs. I have tried in different ways with .csv and .txt extensions.

My requirement is have to picked up PIPE (|) delimited file using file adapter.

FYI - The same STRUCUTRE & TEST DATA working fine with COMMA (,) values. But the same STRUCUTRE & TEST DATA'S giving below error with PIPE delimited values.

Error:

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 1 according to structure 'row':java.lang.Exception: ERROR in configuration / structure 'row.': More elements in file csv structure than field names specified!

Regards,

MFH

ambrish_mishra
Active Contributor
0 Kudos

Hi MFH,

check my post...:)

Ambrish

Muniyappan
Active Contributor
0 Kudos

Hi,

You have to separate the field names by comma as mentioned by others.

if possible check this.

Regards,

Muniyappan.