cancel
Showing results for 
Search instead for 
Did you mean: 

HEX to CHAR conversion in ECC 6.0

Former Member
0 Kudos

Hi All,

We have upgraded the client system from 4.6C to ECC 6.0. In one of the program the code was as below:

c_code1(1) TYPE x VALUE '23',

c_code2(1) TYPE x VALUE 'E1'.

i_uml-uml = c_code1.

APPEND i_uml.

i_uml-uml = c_code2.

APPEND i_uml.

LOOP AT i_uml INTO w_char.

SEARCH i_rab_tab FOR w_char.

IF sy-subrc = 0.

MOVE 'X' TO w_found.

EXIT.

ENDIF.

ENDLOOP.

Here c_code1 and c_code2 are declared as hex and assigned 23 and E1. These codes are moved to itab i_umi. These valuse are assigned to w_char.

When assigned to w_char, the hex value of 23 is converted to '#' and E1 is converted to 'ä'.

Above logic is working in 4.6 but not working in ECC 6.0. The conversion of HEX to char is not working in 6.0. In ECC 6.0, when hex number 23 is assigned to w_char, it takes value as '2'.

Please suggest me how can I make it work in ECC.

Thanks in advance.

regards,

Gaurav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

check and use the below code, it works fine.

c_code1(1) TYPE x VALUE '23',

c_code2(1) TYPE x VALUE 'E1'.

data: cnt_code type c,

cnt_code1 type c.

call method CL_ABAP_CONV_IN_CE=>UCCP

exporting

UCCP = c_code1

receiving

char = cnt_code.

call method CL_ABAP_CONV_IN_CE=>UCCP

exporting

UCCP = c_code2

receiving

char = cnt_code1.

i_uml-uml = cnt_code.

APPEND i_uml.

i_uml-uml = cnt_code1.

APPEND i_uml.

LOOP AT i_uml INTO w_char.

SEARCH i_rab_tab FOR w_char.

IF sy-subrc = 0.

MOVE 'X' TO w_found.

EXIT.

ENDIF.

ENDLOOP.