on 10-09-2013 11:35 PM
Hi everybody!
I have a doubt here in a file content conversion.
I tried to convert a text file to a xml, and I made all the steps to create it.
But, in some cases the conversion occurs in a wrong way.
The file adapter read a text file that has some lines with 240, 400 or 500 positions.
In 240 posistions the conversion is ok. But in lines with 400 and 500 positions the line is broken before the end of the string.
The record set properties are this:
record set structure = Line,1
Line.fieldFixedLengths=999999999
Line.fieldNames=arquivo
ignoreRecordsetName=true
Line.fieldContentFormatting=nothing
has anyone ever experienced this?
Thanks!!
Hi MArcello,
try
Line.endSeparator = 'nl'
if you want to read line with variable length then you no need to define
"Line.fieldFixedLengths=999999999"
check following for mor details
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys!
I found the problem!!
I was seeing my text file in note pad... and has a 'invisible' broken line...
I copied and paste in a pure text editor and I saw the problem.
Thanks for all !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Iñaki,
I put Line.keepIncompleteFields=yes as you mentioned.
But, my problem persist.
Have you ever manipulated a text file with more than 400 positions?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
no one can help me?
I thinking this is a bug. I will open a ticket at SAP.
Thanks,
Marcello
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hellow again!
I tried your suggestions but didn´t works again.
For exemple, the text file is like this:
01REMESSA01COBRANCA 00000000000000264760******* 290713 MX0000544 000001 1
.
.
.
And the adapter file convert like the image bellow.
Note that last number 1 is in line, but in convertion, this number appears in another field. Has you can see in image. The end of line is a <ENTER> and don´t have a field separator.
It´s happens when the line has 400 or 500 positions, when the line has 240 positions it´s works fine.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcello,
The parameter Line.keepIncompleteFields should have the value YES:
From help.sap documentation:
NameA.keepIncompleteFields
This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.
- If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.
This is the default.
- If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.
Regards.
Hi guys,
the lines has the same size. But sometimes we have a file with 240 pos, 400 pos or 500 positions.
And the field separator is <ENTER>.
I tried the Line.endSeparator = 'nl', but didn´t works.
Have any suggestions??
Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcello,
For Enter key use '0x0D'
Also try Iñaki's suggestion to use NameA.keepIncompleteFields YES
NameA.keepIncompleteFields
This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.
○ If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.
This is the default.
○ If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.
You use this parameter to control the behavior of the conversion routine for the last field in a structure.
Use the NameA.missingLastFields parameter to define the behavior at runtime when the structure contains less fields in total that specified in NameA.fieldFixedLengths.
Hope it helps!
Ambrish
Hi Marcello,
Don't you have a field separator?, it's not a good idea to work with fieldfixedlenght and your lines are not with the same length. Try to use the property keepIncompleteFields = TRUE
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcello
Look like your text file will have multiple lines in it but in content conversion you have specified the occurrence only 1.
Please change the occurrence to *
record set structure = Line,*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.