2009 Jan 30 4:46 AM
Hi Expert,
How to convert file format to Unicode while transfering text file on to FTP Server.
I have requirement to transfer text file from SAP to FTP server in perticulat file format.SAP system generate file by default in ANSI format but my client requirement is Unicode or UTF .Is there any FM or class ,logic for same.
Thanks,
Hi Expert,
How to convert file format to Unicode while transfering text file on to FTP Server.
I have requirement to transfer text file from SAP to FTP server in perticulat file format.SAP system generate file by default in ANSI format but my client requirement is Unicode or UTF .Is there any FM or class ,logic for same.
Thanks,
2009 Jan 30 4:56 AM
HI,
you can use the below classes.
CL_ABAP_CONV_IN_CE : Reading binary data
CL_ABAP_CONV_OUT_CE : exporting binary data
CL_ABAP_CONV_X2X_CE : reading and exporting binary data and changing the format
hope they may useful...
Regrds...!
2009 Jan 30 5:18 AM
Hi,
Try this Code to convert data as per the UTF format...
DATA: conv TYPE REF TO cl_abap_conv_out_ce,
convin TYPE REF TO cl_abap_conv_in_ce,
l_data TYPE string,
record_length TYPE i,
l_buffer TYPE xstring.
FIELD-SYMBOLS: <x_data1> TYPE c,
<x_data2> TYPE string,
<x_data3> TYPE xstring.
ASSIGN p_data TO <x_data1> CASTING.
ASSIGN l_data TO <x_data2> CASTING.
<x_data2> = <x_data1>.
conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8'
endian = 'L'
ignore_cerr = 'X'
replacement = '#' ).
CALL METHOD conv->write( data = l_data ).
* CALL METHOD CONV->WRITE( DATA = CL_ABAP_CHAR_UTILITIES=>CR_LF ).
l_buffer = conv->get_buffer( ).
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
encoding = 'UTF-8'
endian = 'L'
ignore_cerr = 'X'
replacement = '#'
input = l_buffer
RECEIVING
conv = convin.
CALL METHOD convin->read
IMPORTING
data = l_data.
CALL METHOD conv->reset.
<x_data1> = <x_data2>.
2009 Jan 30 7:59 AM
Hi ,
Thanks for reply ,My requirement is to change file format not file contain ...
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |