Skip to Content

File content conversion doubt

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!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    Oct 10, 2013 at 07:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 10, 2013 at 05:50 AM

    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,*

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2013 at 01:02 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Oct 10, 2013 at 06:13 AM

    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.


    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2013 at 09:19 PM

    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!!

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Oct 15, 2013 at 01:39 PM

    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 !!!

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 14, 2013 at 02:04 PM

    Hi guys,

    no one can help me?

    I thinking this is a bug. I will open a ticket at SAP.

    Thanks,

    Marcello

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 14, 2013 at 05:12 PM

    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,

    Add comment
    10|10000 characters needed characters exceeded