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: 

How to convert the text field into currency field

Former Member
0 Kudos

Hi,

I have an requirement to converting the text field into currency.

If I convert directly it gives dump.

If I convert this to Numeric means it takes the decimals also as whole value.

Is there any FM to convert the text field into Currency field.

Please advice me.

Thanks in advance.

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

HI Sabari,

try using the function module: HRCM_STRING_TO_AMOUNT_CONVERT

REgards,

Ravi

Former Member
0 Kudos

hi

use

<b>PSSV_TEXT_INTO_FIELD_CURRENCY</b>

plz reward helpful posts

Former Member
0 Kudos

Hi,

Check this FM: <b>PSSV_TEXT_INTO_FIELD_CURRENCY</b>.

Thanks and Regards,

Bharat Kumar Reddy.V

0 Kudos

Hi,

I am on an SRM sytem, which unfortunately does not have th FM: PSSV_TEXT_INTO_FIELD_CURRENCY.

But I also need to transfer a string value like '12,99' to a field with type curr.

Can i Do that manually, or is there another FM?

I have already checked code with write to or pack/unpack.

But without success yet.

Something like this:

DATA: g_str(11) type c.

DATA: g_p type p.

WRITE '12,99' TO g_str CURRENCY 'EUR'.

is no use for me. Finally I need to move g_str to my curr-field, which causes st22.

also: PACK g_str to <curr-field or g_p> dumps.

Help appreciated.

regards, matthias

0 Kudos

ok - found a workaround. If the given input number uses '.' istead of ',' I can do direct convert from string to curr.

thnx anyway,

matthias

0 Kudos

try this code....

definitely it will work

data:V_AMOUNT TYPE STRING VALUE '23,45,.90',

V_AMOUNT1(20) TYPE C,

V_NETWR LIKE REGUD-SWNES.

replace all occurences of ',' in v_AMOUNT with space.

CONDENSE v_AMOUNT NO-GAPS.

WRITE V_AMOUNT TO V_AMOUNT1 DECIMALS 2.

V_NETWR = V_AMOUNT1.