Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FTP - How to send a UTF-8 .TXT File

Former Member
0 Kudos

Hi all,

I need to write an Interface which will send output as a ".TXT" File to a network location using FTP. I need to write this file in two formats -

1. Non-Unicode

2. Unicode UTF-8.

Could you please guide me out in this as to how it can be done.

Thanks,

Nitesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Nitesh,

To send an FTP file you will need to as the basis guy to open the FTP Port on the server.

With regards to format FTP is least bothered in which format the file is you will need to create the file in that format on the APP server.

To create the file in TXT / NON-Unicode press F1 on OPEN DATASET.

TEXT MODE ENCODING {DEFAULT|UTF-8|NON-UNICODE}

Effect:

The addition IN TEXT MODE opens the file as a text file. The addition ENCODING defines how the characters are represented in the text file. When writing in a text file, the content of a data object is converted to the representation entered after ENCODING, and transferred to the file. If the data type is character-type and flat, trailing blanks are cut off. In the data type string, trailing blanks are not cut off. The end-of-line marking of the relevant platform is applied to the transferred data by default. When reading from a text file, the content of the file is read until the next end-of-line marking, converted from the format specified after ENCODING into the current character format, and transferred to a data object.

To send the file.

http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+program+for+FTP+Transfer+of+Files+via+ABAP+Prog...

4 REPLIES 4

Former Member
0 Kudos

Hi Nitesh,

To send an FTP file you will need to as the basis guy to open the FTP Port on the server.

With regards to format FTP is least bothered in which format the file is you will need to create the file in that format on the APP server.

To create the file in TXT / NON-Unicode press F1 on OPEN DATASET.

TEXT MODE ENCODING {DEFAULT|UTF-8|NON-UNICODE}

Effect:

The addition IN TEXT MODE opens the file as a text file. The addition ENCODING defines how the characters are represented in the text file. When writing in a text file, the content of a data object is converted to the representation entered after ENCODING, and transferred to the file. If the data type is character-type and flat, trailing blanks are cut off. In the data type string, trailing blanks are not cut off. The end-of-line marking of the relevant platform is applied to the transferred data by default. When reading from a text file, the content of the file is read until the next end-of-line marking, converted from the format specified after ENCODING into the current character format, and transferred to a data object.

To send the file.

http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+program+for+FTP+Transfer+of+Files+via+ABAP+Prog...

0 Kudos

Hi yakub,

Thanks for your time to reply to my question. However I am familiar with writing a file to Appln Server in Unicode/Non-unicode. I just wanted to know if we need to write a File using FTP in Unicode/Non-Unicode formats, the only way is to write to AL11 and then move the files from there.

Thanks,

Nitesh.

0 Kudos

FTP could modify the file if you use ASCII mode, if you would like to transfer the file without any modification, you have to set in BINARY mode.

For example, try to make the two mode between Unix / Windows system ...

Regards

Fred

arindam_m
Active Contributor
0 Kudos

Hi,

I think the Application server is on UNIX. You can design External command and do the FTP using UNIX commands. External commands can be called in program using SXPG_COMMAND_EXECUTE & can be designed in SM69.

Help links:

http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a8023505211d189550000e829fbbd/content.htm

Cheers,

Arindam