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 convert string codepage, and replace char can not be converted.

former_member311833
Participant
0 Likes
2,825

I need to transfer SAP table data to external Oracle database, but our SAP system codepage is unicode, our external Oracel database codepage is 8300.

Sometimes user Keyed string is not codepage 8300, when I transfer these data to external Oracle database,All String will be change to '?'.

So I want to get these data and convert to 8300 coagepage string,

example : 'Machine 恋 - 100' change to 'Machine ? - 100'

Are there any ways to convert?

Best regards,

Eric

3 REPLIES 3
Read only

Former Member
0 Likes
1,098

Hi

Below is the syntax

TRANSLATE l_line FROM CODE PAGE '1500' TO CODE PAGE '1101'.

But this will not workin ECC6 .

Regards

Vinay

Edited by: vinay kolla on Sep 17, 2009 5:03 AM

Read only

Former Member
0 Likes
1,098

In case Ecc 6 Refer to

Regards

Vinay Kolla

Read only

0 Likes
1,098

Hi Vinay,

Our system is ECC 6.0.

I have to refer to document and tried to write some convert program as bellow, but result is not correct.

-


REPORT CONVERT_4110_TO_8300.

DATA : S4110(10) TYPE C.

DATA : LEN TYPE I.

DATA : S8300 TYPE STRING.

DATA : CVTI_8300 TYPE REF TO CL_ABAP_CONV_IN_CE.

FIELD-SYMBOLS : <VALUE> TYPE X.

S4110 = 'A恋B'.

ASSIGN S4110 TO <VALUE> CASTING.

CVTI_8300 = CL_ABAP_CONV_IN_CE=>CREATE( ENCODING = '8300' INPUT = <VALUE> replacement = '*' IGNORE_CERR = 'X' ).

CALL METHOD CVTI_8300->READ

IMPORTING

DATA = S8300

LEN = LEN

EXCEPTIONS OTHERS = 1.

WRITE S8300.

-


result : #A0K#B# # # # # # # (I want to change 'A恋B' to 'A*B')

How should I change the code to convert 'A恋B' to 'A*B'?

Is there any function like 怌FUNCTION 'GUI_DOWNLOAD' parameter 'REPLACEMENT'怍 or 怌OPEN DATASET ... IGNORING CONVERSION ERRORS REPLACEMENT CHARACTER "rc"怍, the statement can replacement conversoin error character to user assign character (REPLACEMENT parameter).