Application Development 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: 

hex to char conversion problem

Former Member
0 Kudos

hi gurus,

please tell me what is wrong with this code.?

im getting dump whn i execute this prog.

im converting hex value to char value in unicode conversion program..

data: hex1 type x value '80'.

data: c1 type c .

CALL FUNCTION 'NLS_STRING_CONVERT_TO_SYS'

EXPORTING

lang_used = sy-langu

source = hex1

  • FROM_FE = 'MS '

IMPORTING

RESULT = c1

  • SUBSTED =

  • EXCEPTIONS

  • ILLEGAL_SYST_CODEPAGE = 1

  • NO_FE_CODEPAGE_FOUND = 2

  • COULD_NOT_CONVERT = 3

  • OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

write:/ c1.

2 REPLIES 2

Former Member
0 Kudos

It's because there is a type conflict in the function call....

The <b>source</b> type in the FM is XSTRING, whereas the <b>hex1</b> value which you are assigning is of type X.

<b>Type Mismatch leads to Short dump.</b>

Regards,

Pavan P.

Former Member
0 Kudos

Thxs