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

Conversion from HEX to CHAR

Former Member
0 Likes
1,249

Hi all. I'm trying to use FM <b>STPU1_HEX_TO_CHAR</b> to convert a hexadecimal value (0B, or 11) to a character value.

This FM seems to be doing NOTHING for me! I've passed it every combination of 0B or 000B that I can think of. It returns in the CHAR field exactly what I passed it in the HEX field.

Has anyone used this FM with any luck?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,082

Hello,

try this exp if anyinfo plz buzz me .

data:

_c type c,

_i type i,

_l type i,

a type I,

_o type i,

t1_ type c,

a1 type c.

field-symbols : <n> type x.

field-symbols : <pn> type c.

field-symbols : <dn1> type x.

data : rn type i.

data : rn1(4) type c.

data : n type c.

describe field P_I_UPLOAD type _c.

if _c eq 'u'.

l = strlen( PI_UPLOAD ).

_i = _l div 2.

do _l times.

a = sy-index - 1.

a1 = P_I_UPLOAD+a(1).

assign a1 to <n> casting.

move <n> to rn.

move <pn> to rn1.

*if rn1+0(1) EQ '#'.

n = rn1+3(1).

A1 = n.

P_I_UPLOAD+a(1) = A1.

enddo.

endif.

Vasanth

5 REPLIES 5
Read only

Former Member
0 Likes
1,083

Hello,

try this exp if anyinfo plz buzz me .

data:

_c type c,

_i type i,

_l type i,

a type I,

_o type i,

t1_ type c,

a1 type c.

field-symbols : <n> type x.

field-symbols : <pn> type c.

field-symbols : <dn1> type x.

data : rn type i.

data : rn1(4) type c.

data : n type c.

describe field P_I_UPLOAD type _c.

if _c eq 'u'.

l = strlen( PI_UPLOAD ).

_i = _l div 2.

do _l times.

a = sy-index - 1.

a1 = P_I_UPLOAD+a(1).

assign a1 to <n> casting.

move <n> to rn.

move <pn> to rn1.

*if rn1+0(1) EQ '#'.

n = rn1+3(1).

A1 = n.

P_I_UPLOAD+a(1) = A1.

enddo.

endif.

Vasanth

Read only

Former Member
0 Likes
1,082

Hi,

Please check this FM.

NLS_STRING_CONVERT_TO_SYS ( Hex to Char)

NLS_STRING_CONVERT_FROM_SYS (Char to Hex)

Regards,

Ferry Lianto

Read only

0 Likes
1,082

Hi Ferry,

I'm passing this FM 000B for the value of 11 but it seems to want 3131 for the value of 11.

Can you shed any light on that?

Read only

0 Likes
1,082

I think it I'm not passing the right value in TO_FE. Any idea what you can pass here besides MS?

Read only

0 Likes
1,082

To any following this thread. I'm using the FM NLS_STRING_CONVERT_FROM_SYS to convert 000B. The system returns '##' as the result.

Any idea why I get double pounds instead of the correct value? (11).