Application Development and Automation 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: 
Read only

Convert file format into UTF-8 while generating text file on FTP server

Former Member
0 Likes
2,441

Hi Expert,

I have the requirement to generate text file store it in FTP server and file format should be in UTF-8.

ABAP Development is completed but text file format generate in ANSI which not acceptable by client.For generating text file and store it on FTP server by using standard function module FTP_R3_TO_SERVER ,but in this function module there is no any parameter option like CODEPAGE for file format conversion. Is there any method or any function module to convert file format to UTF-8 and directly transfer or store it on FTP server.

<<removed_by_moderator>>

Thanks ,

Edited by: Vijay Babu Dudla on Jan 28, 2009 12:48 AM

Hi Expert,

I have the requirement to generate text file store it in FTP server and file format should be in UTF-8.

ABAP Development is completed but text file format generate in ANSI which not acceptable by client.For generating text file and store it on FTP server by using standard function module FTP_R3_TO_SERVER ,but in this function module there is no any parameter option like CODEPAGE for file format conversion. Is there any method or any function module to convert file format to UTF-8 and directly transfer or store it on FTP server.

<<removed_by_moderator>>

Thanks ,

Edited by: Vijay Babu Dudla on Jan 28, 2009 12:48 AM

3 REPLIES 3
Read only

Sm1tje
Active Contributor
0 Likes
1,270

what about function module TREX_TEXT_TO_UTF8 from function group TREX_UTIL.

Read only

Former Member
0 Likes
1,270

Thanks Micky for reply,

When I used FM TREX_TEXT_TO_UTF8 ,it convert text file containent into UTF-8 which not readable and text file format is shows in ANSI not in UTF-8 . Is there any other method that text file format type will convert to UTF-8 .

Regards,

Read only

Former Member
0 Likes
1,270

I have come across the same issue. Try calling the FTP_COMMAND function module to make it go into ASCII mode before your FTP the file, like this:


data: result type table of text with header line.

call function 'FTP_COMMAND'
    exporting
      handle        = hdl
      command       = 'ascii'
    tables
      data          = result
    exceptions
      tcpip_error   = 1
      command_error = 2
      data_error    = 3.

  call function 'FTP_R3_TO_SERVER'
    exporting
      handle         = hdl
      fname          = docid
      character_mode = 'X'
    tables
      text           = gt_your_table .