Skip to Content
0

SFTP to SFTP FlatFile PassThru Receiver Adapter encoding Issue

Sep 01, 2017 at 10:31 AM

177

avatar image
Former Member

Hi Sdner's,

Scenario: SFTP to SFTP FlatFile PassThru

Input FlatFile Encoding: UCS-2 LE BOM

Expected output FlatFile Encoding: ANSI

I am using MessageTransformbean and TextCodepageConversionBean in receiver SFTP adapter but file is getting altered. NULL spaces and CRLF were added to file.

PFA ouput file generated.

Please advice if any fix/alternate solution ?

PI Version: 7.5 Single Stack, SP-05, Windows installation, Java Ver- 1.8.0_144

output.txt (37.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Raghuraman S Sep 01, 2017 at 10:58 AM
0

Can you please share the source file which is in UCS-2 LE BOM format.

when I try this it notepad and convert to ANSI I am getting some other characters

??1�0�1� �8�8�8�8�8�8�8�8�4� �0�0�0�0�0�0�1�4�5�1�7�0�8�0�7�0�9�0�0�1�0�9�4�1�0�1�D�I�N�E�R�S� �T�R�A�C�S� �F�A�S�T� �E�N�T�R�Y�O�P�E�N�T�E�X�T� �
�

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Raghu,

PFA...Input file

input.txt (37.4 kB)
0
avatar image
Former Member Sep 01, 2017 at 11:04 AM
0

Hi Raghu,

PFA...Input file.


input.txt (37.4 kB)
Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hello Kiran,

AFAIK its because of encoding to ANSI, when I try in Notepad++ the same is happening.

0
Former Member

Hi Raghu,

Yes even I feel the same. wondering if any fix for this req or any alternate solution for this ?

0

Hello Kiran,

I am not sure as ANSI might not support this specific characters.

Since the target is also file why there is a specific requirement of converting to ANSI?

0
Former Member

Hi Raghu,

I think because of some legacy system dependency they need target flat file encoding in ANSI.

Also I've tried below stuff but still no luck :-(

1. SFTP-->SFTP Pass Thru (not working the ANSI file is getting generated but with null spaces and which is not correct file format)

  • Not working ANSI generating with null spaces and which is not correct file format)

2. SFTP(FlatToXML)-->Java Map(Converting XML encoding frm UCS-2 LE BOM to ANSI)-->MM(To Sort out the empty lines)-->SFTP(XMLToFlat)

  • Some special chars are appending to beginning of file due to which messages failing @mapping level, I’ve tried handling special chars in MM but still messages are failing at runtime….but when I try executing the payload in MM test tab it is working fine :-(

Getting below error(This error I am getting after Sender SFTP Adapter converts FlatFile to XML):-

  • BaseRuntimeException: An invalid XML character (Unicode: 0x0) was found in the element content of the document., org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 115; An invalid XML character (Unicode: 0x0) was found in the element content of the document

3. Flow1= SFTP-->NFS(Pass Thru) & Flow2= NFS-->SFTP(Pass Thru).

  • Not working ANSI generating with null spaces and which is not correct file format)

My Observations:-

1. SFTP Sender Adapter is appending special to file chars in Pass Thru/Non-Pass Thru.

2. SFTP Receiver adapter is adding null spaces to target ANSI file generated in Pass Thru/Non-Pass Thru.

3. Even I’ve tried doing SFTP-->SFTP Pass Thru without changing any encoding in PI but still file is getting appended with some special chars.

I feel this is something SFTP Adapter Bug which needs to be raised with SAP ?

0
Ambrish Mishra Sep 24, 2017 at 02:56 PM
0

Hi Kiran,

Try to avoid plan2XML conversion at the sender. Apply UTF-8 encoding on the sender side and do java mapping to arrive at dynamic file name and then covert encoding to ASCII in the receiver.

Hope it works!

Ambrish

Share
10 |10000 characters needed characters left characters exceeded