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

Convert CHAR or STRING to DEC

Former Member
0 Likes
1,043

I want to convert a string or char length 9 into the Data-Typ DEC length 6 and 2 decimal places.

Source-Example for CHAR:

34,45 in HEX 33342C343520202020

Regards

Ulf

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
888

You could try this.



report zrich_0001 .
 
data: p type p decimals 2.
data: s type string.
 
s = '34,45'.
translate s using ',.'.
p = s .
 
write:/ p.
 


Regards,

Rich Heilman

5 REPLIES 5
Read only

ferry_lianto
Active Contributor
0 Likes
888

Hi,

Please try this FM HRCM_STRING_TO_AMOUNT_CONVERT.

Regards,

Ferry Lianto

Read only

0 Likes
888

ha, this function really works..

thanks a lot..

Read only

Former Member
0 Likes
888

Welcome to SDN. Please chek this FM

CONVERT_FROM_CHAR_SORT_RFW

Hope it helps.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
889

You could try this.



report zrich_0001 .
 
data: p type p decimals 2.
data: s type string.
 
s = '34,45'.
translate s using ',.'.
p = s .
 
write:/ p.
 


Regards,

Rich Heilman

Read only

0 Likes
888

Ohhh myyy God,

Rich, thanks!! ... I don't see the differenz between '.' and ',' ...

Regards.

Ulf