Skip to Content
0

FTP to FIle Scenario in SAP PI

Aug 10, 2017 at 01:32 PM

209

avatar image

HI Experts,

I am having one simple scenario File to File ( FTP --> PI --> ECC ), I did pass through scenario, which was working fine.

Here the problem with file content which we are receiving in ECC from FTP server i.e , file content in FTP server looks like as mentioned below.

ex :

9780043012239,369

but when the file is placing in ECC system, every line is ending with # symbol, which causing problems to us,

ex :

9780043012239,369#

I tried file type formats in receiver file type "Text " with the format " ISO-8859-1" but no luck.

Can any one help me to solve this issue ??

Thanks in advance.

Best, Shiva

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Manoj K Aug 10, 2017 at 04:32 PM
2

There's nothing wrong with your file. That is how it get displayed in ECC AL11 Unix OS, you can see the same discussion here.

Br,

Manoj

Show 6 Share
10 |10000 characters needed characters left characters exceeded

Hi Manoj ,
Any solution for this? the link which you provided is not having solution.

Best , Shiva

0

Shiva,

The Reason why you see "#" is because of the Carriage return CR which is not a valid character in Unix OS where as if the same file is uploaded in windows then you see there is no such character.

Below is the screenshot of the file in UNIX OS which has line feed character as CRLF when seen in notepad++:

Below is the screenshot of the file in UNIX OS which has line feed character as LF when seen in notepad++:

So ideally the characters which are not understood by UNIX OS are displayed as #.

So here are the workaround by which you can handle/remove this character :

1.Ask ABAP'er to ignore this # character while whatever operation he/she is performing on this file.

2.Ask the third party whoever is placing file in FTP server to have Line Feed as just LF and not CRLF.

3. If you want to handle this in PI then you need to do it via FCC where the <records>.endSeparator as '0x0A' while placing file in AL11 which is hexa value for LF.

Br,

Manoj

1.png (2.5 kB)
3.png (2.3 kB)
crlf.png (3.4 kB)
lf.png (3.1 kB)
1

Hi Manoj ,

Thanks for your detailed explanation, it's clear to understand as well.

This issue should solve through PI only and the problem is we don't have any structure (no ESR objects created ), it is just file bypass scenario. So I can't use content conversion.

So please suggest me if it possible through any adapter module configuration or by using file encoding format in File adapter?

Note : If file is placed in ECC application with ASCII format, issue should solved , I tried file encoding format with (

US-ASCII) but no luck.

Best , Shiva

0

Shiva,

You dont need ESR objects :

1.In sender channel Create Plain to XML via FCC/MTB using some dummy message type and dummy field . Read the complete line as one field just using endSeparator.

2.In Reciever channel convert back that xml into plain using just endSeprator = '0x0A'.

If you need further assistance please attach a file which is having this issue.

Br,

Manoj

0

I attached a screen for FTP server file which placed manually which shows none of "#" symbol but while placing file through PI system it is generating "#" symbol for each line.

0

Hi Manoj ,

Sorry for the delay in response.

I tried to create structure in ESR as per input file records, then in ID level I tried to to use FCC on both sides with endseparator '0x0A'.

Now file in application server looks fine.

Thanks for your support .


Best , Shiva


0
Andrzej Filusz Aug 10, 2017 at 04:08 PM
0

Hi Shiva,

The end of line is different on Windows and Unix systems.

1. Windows systems: CRLF (a carriage return - 13 / 0x0D, a line feed - 10 / 0x0A),

2. Unix systems: LF (a line feed - 10 / 0x0A) .

So if 'end of line' code is not converted, then you see strange additional characters at the end of each line.

Do you have a content conversion? Do you use 'endSeparator' property with the proper value ('0x0D''0x0A' or '0x0A')?

Best Regards,

Andrzej

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

Hi Andrzej,

Thanks for your response, no I am not using any conversion, it's simple file to file scenario without mapping.

Best , Shiva

0
Raghuraman S Aug 10, 2017 at 02:25 PM
0

Hello shiva,

Can you download the file from AL11 and check it locally.

I believe this should probably display error in AL11 directory.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Raghu,

I checked the file by downloading into my system, it shows space for each line (in notepad++) .Please suggest something for this.

Best , Shiva

0

Can you please share the screenshots

0
avatar image
Former Member Aug 10, 2017 at 02:48 PM
0

Are you using ASCII mode for your FTP connection? If not, please try and see if that resolves your issue.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Patrick ,

I tried ASCII format as well in receiver cahnnel as file encoding format but still "#" sysmol exists in receiver side.Can you please suggest ?

Best , Shiva

0
Former Member

If you configure ASCII mode in both the sender and the receiver channel, I believe that your issue would disappear provided that it's related to the line break character that is different between Unix and Windows systems. In case it doesn't, I saw that Manoj has already provided a slightly more complex suggestion using a dummy conversion in the adapter, which will definitely address line break issues.

1

Hi Patrick,

I tried both side same option ASCII format but no luck, anyhow issue was solved by creating structure in ESR and tried the content conversion.

Thanks .

Best , Venkatesh

1