cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver file content conversion - Problem with empty line at the end

Former Member
0 Kudos

Hi dudes,

I am developing an RFC to FTP (.txt) scenario, but not able to achieve the file structure expected: just one field per row, and rows separated by a carriage return.

First of all I was using the File Content Conversion from the File Adapter, but the target third party was interpreting a strange character instead of the carriage return, even when I tried 'nl', '0x0A' and also '0x0D' as endSeparator parameter.

Then I implemented the module AF_Modules/StrictXml2PlainBean, due to which I could solve the problem of the strange character. But now I am getting an empty line at the end of the file, which is not expected to be received.

This is the basic target data type I am using:

<item maxOccurs="unbounded">

<DATA>...</DATA>

</item>

This is the configuration of the module AF_Modules/StrictXml2PlainBean:

singleRecordType = item

item.fieldSeparator = dummy (since there are no fields to separate)

I also tried with item.endSeparator = \r and item.endSeparator = \n, but then I get the strange character again. By the way, [SAP Library|http://help.sap.com/saphelp_nwpi71/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm] states that other special characters can be used as endSeparator, using the hexadecimal character code like this: \x<code>, but I couldn't insert any valid code (do you know how to insert a valid code?).

Please, let me know how can I remove this empty line at the end or avoid the strange characters.

Many thanks in advance,

Paco

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Have you tried NameA.fixedLengthTooShortHandling and set the value as Ignore.

Regards,

Akshay

Former Member
0 Kudos

Hi Akshay,

NameA.fixedLengthTooShortHandling is only valid in the File Content Conversion of the standard File Adapter (and I have the problem of strange characters with it). StrictXML2Plain module has a similar parameter called NameA.fieldLengthExceeded, anyway I have no troubles with the field content but with the endSeparator perhaps.

I have noticed that using any dummy NameA.fieldSeparator works fine building the file (except for the last empty line), since there is only one field mapped. NameA.fieldLengths = 1 and NameA.fieldLengthExceeded = ignore, get the same result.

Thanks,

Paco

Former Member
0 Kudos

Please try

item.endSeparator = '0x0D"0x0A'

0x0D --> Carriage return

0x0A --> NL line feed, new line

Former Member
0 Kudos

Hi Paco,

Did you try 0x20 (space) or 0x1b (escape) or 0x09 (horizontal tab).

Regards,

Akshay

Former Member
0 Kudos

Hi,

'0x0D"0x0A' (where message protocol is File Content Conversion) is returning strange character plus '0x0A'.

Other hexadecimal characters as space, backspace or tab are not useful for the result expected.

Does anyone know how to input a hexadecimal character for endSeparator in the module StrictXML2PlainBean (where message protocol used is File)?

Thanks,

Paco

Former Member
0 Kudos

Fransisco,

Try with '0x08' this is for backspace even though it prints lets it delete it and see.

See this for more info for hex:

http://web.cs.mun.ca/~michael/c/ascii-table.html

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Thanks for your prompt answer, but '0x08' is treated as a literal for endSeparator in the StrictXML2PLain module. I've tried \x08 (and others numbers/codes), \x0x08, \x008... with no success