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: 

Function Module to convert Hexa to Char

Former Member
0 Kudos

Hi,

In ECC the Unicode does not allow a write statement between Different data type, namely between a Hexa and a Char type. The Hexa has to be converted into char! Could anyone please tell me if any function Module exists for the same,

Or, is there any other solution to go around it!

FM's "<b>STPU1_HEX_TO_CHAR</b>" & "<b>/AIN/EPC_HEX_TO_CHAR</b>" do not work.

Points will surely be awarded!

Thanks in Advance.

Regards,

Divaker

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

Try to use cl_abap_char_utilities

aRs

7 REPLIES 7

former_member194669
Active Contributor
0 Kudos

Hi,

Try to use cl_abap_char_utilities

aRs

Former Member
0 Kudos

You can use attributes of class <b>cl_abap_char_utilities</b>

e.g

data: v_horz_tab(1) type c,

v_cr(1) type c.

for Horizontal tab : use v_horz_tab = cl_abap_char_utilities->horizontal_tab.

for Carriage Return : use v_cr = cl_abap_char_utilities->cr_lf..

u can use many more...

BYTE_ORDER_MARK_LITTLE

BYTE_ORDER_MARK_BIG

BYTE_ORDER_MARK_UTF8

CHARSIZE

ENDIAN

MINCHAR

MAXCHAR

HORIZONTAL_TAB

VERTICAL_TAB

NEWLINE

CR_LF

FORM_FEED

BACKSPACE

SPACE_STR

SPACE_STR_LANGU

Reward if useful..

Regards

Prax

Former Member
0 Kudos

Hi,

Try FM HR_RU_CONVERT_HEX_TO_STRING.

Regards,

Nicolas.

Former Member
0 Kudos

Hi Timothy,

to conver to hexa to char

AIN_EPC_HEX_TO_CHAR

HR_RU_CONVERT_HEX_TO_CP

HR_RU_CONVERT_HEX_TO_STRING

To convert to hexa to dec

FITP_UTIL_CONVERT_HEX2DEC

other wise

First transfer this hex values into fieldsymbol (Casting Type X) than transfer the value from that fieldsymbol to another fieldsymbol( Casting type Char.). than transfer this fieldsymbol to a character type.

<b>Reward pts if found usefull :)</b>

regards

Sathish

Former Member
0 Kudos

In CL_ABAB_CHAR_UTILITES which method do i use?

As i said before

<b>AIN_EPC_HEX_TO_CHAR</b> does not work...

And these FM's do not exist in our Domain!

<b>

HR_RU_CONVERT_HEX_TO_CP

HR_RU_CONVERT_HEX_TO_STRING

</b>

Is there any other way guys!

Tnx..

Divaker

Former Member
0 Kudos

Well I found out the solution for this and it is as such...

You can use the class method " <b>CL_ABAP_CONV_IN_CE=>UCCP</b>" and convert the hexa to a char and then use it.

Thanks to all who have replied.

Regards,

Divaker

0 Kudos

hi timoothy,

can you please tell me how did you use the above mentionesd class method .I am un able to convert 'FF06010102028000343130320000000063010000121F9D021D331F030303230F90606065C00642187C183C19FC185CD74254AE028BB28029468E7510C17D5033' this hexa decimal value to text.

Please help