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 string to currency

Former Member
0 Likes
13,286

Hi all I have a string and I want to convert it to currency type field.

Example :

STRING = '11243.56'.

convert to :

CURRENCY = '112,43.56'.

Thanks in advance.

Hi all I have a string and I want to convert it to currency type field.

Example :

STRING = '11243.56'.

convert to :

CURRENCY = '112,43.56'.

Thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
4,617

Hi,

Did you check this thread??

Have a look at this search result also.

https://www.sdn.sap.com/irj/scn/advancedsearch?query=convertstringtocurrency&cat=sdn_all

Thanks

Nitesh

Read only

0 Likes
4,617

I did but could not get it?

can u explain how to do that?

Read only

Former Member
0 Likes
4,617

Hi Rock,

Check this code snippet. Hope it will clarify your doubt.

DATA: num TYPE p DECIMALS 2.

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'

EXPORTING

string = '45454545455.00'

decimal_separator = '.'

thousands_separator = ','

IMPORTING

betrg = num .

IF sy-subrc <> 0.

ENDIF.

WRITE num left-justified.

Let me know if there is any issue.

Thanks

Nitesh

Read only

Former Member
0 Likes
4,617

Solved