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

How to set Open Data set encoding to ANSI Code??

Former Member
0 Likes
5,755

Dear Expert,

I used OPEN DATASET to output data to file from SAP.

But the default encoding is UTF-8.

Is there any way i can convert the encoding to ANSI?

Regards

Here is part of my code below:

OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT gt_dfiebw.

CONCATENATE

gt_dfiebw-acc1

gt_dfiebw-acc2

gt_dfiebw-acc3

gt_dfiebw-vendor

gt_dfiebw-invre

gt_dfiebw-pdat

gt_dfiebw-curcy

gt_dfiebw-payat

gt_dfiebw-descp

gt_dfiebw-fax

gt_dfiebw-addr1

l_addr3 INTO o_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

TRANSFER o_string TO file.

ENDLOOP.

CLOSE DATASET file.

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,717

Hello,

What exactly do you mean by "encoding to ANSI"?

BR,

Suhas

Read only

Former Member
0 Likes
1,717

Thanks.

I changed MODE ENCODING DEFAULT. to MODE ENCODING non-unicode.

then the encoding changed to ANSI.

Read only

0 Likes
1,717

Hi Lee,

Try this fm CALL FUNCTION 'EPS_OPEN_OUTPUT_FILE'

It has a text mode flag

I am not very clear of your requirement .

Read only

0 Likes
1,717

Hi Lee,

You can have a look into this module also

CONVERT_ITF_TO_ASCII

Thanks