cancel
Showing results for 
Search instead for 
Did you mean: 

FCC for fixed length delimited file

Former Member
0 Kudos

Hello experts,

I have to pick up a .txt file from source directory that is basically a fixed length delimited file,',' being the delimiter.SAP help says:

NameA.fieldSeparator

■       If you made an entry for fieldFixedLengths, the extra length of the separator is taken into account, but no further consistency checks are performed.

This at least suggests that the fixed length delimited file can be converted to XML in file adapter by specifying both fieldSeparator and fieldFixedLengths parameters. Has anyone tried this ?

Thanks,

Monika

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

use field separator or Fixed lenght, dont try to use both and it is not recommended and you will face many issues if there is no value in flat file.

my suggestion is use field separator to convery yur text document to xml using File adapter FCC.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Raja and Sagarika for your replies.

My file will look like below:

ABC   ,123,   ,DEF

GHI    ,456,   ,JKL

So, to pick up this file, should I go for fieldSeparator = ','.

Regards,

Monika

naveen_chichili
Active Contributor
0 Kudos

Hi Monika,

Yes you are correct ...your fieldSeparator will be ','(comma).

Rgds,

Naveen.

Former Member
0 Kudos

Thanks Naveen. So if I go ahead with fieldSeparator parameter, then the fixed length fields that are coming with spaces or if no field is coming, then there are spaces, these will be taken care of ?

Regards,

Monika

iaki_vila
Active Contributor
0 Kudos

Hi Monika,

...So if I go ahead with fieldSeparator parameter, then the fixed length fields that are coming with spaces...

No problem with spaces but you must have the separator, your comma, always. In this mode the FCC doesn't count the fields length. For example: " Field1 ,  Field3   ,     , Field2 "

or if no field is coming

If you want to say for example "Field1,,,Field2" or "Field1,   , Field2,   ", there is no problem, but you need the commas, of course.

I  remind you that you can read the parameters behaviour in http://help.sap.com/saphelp_nwpi711/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/frameset.htm and for my own experience is not bad idea to do a dummy example and you go changing the parameters and checking the results.

Regards.

Former Member
0 Kudos

Hi Monika,

Go ahead and use both parameters, ur config will work

Thanks

Amit Srivastava

Former Member
0 Kudos

Thanks Inaki, Yes, this should work cause in case of fieldSeparator parameter, field length is not taken into account. I had not come across such structure till now, so was looking if anyone has.

Regards,

Monika

Former Member
0 Kudos

Thanks Amit!! SAP documentation says so that we can use both the parameters, first will try using only field.Separator and see the behavior in case of leading/trailing spaces or spaces when fields are missing, if this works (should work since field length will be ignored), then good, else will try using both the parameters.

Regards,

Monika

Former Member
0 Kudos

Hi Monica,

I think you Can't use both the parameters, 'fieldSeparator' & 'fieldFixedLengths'.

If you are using 'fieldFixedLengths' then you can use 'endSeparator' inplace of 'fieldSeparator'.

Please find the thread http://scn.sap.com/message/8495404 which may be helpful for you.

Best Regards,

Sagarika