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

Using HRCM_STRING_TO_AMOUNT_CONVERT

Former Member
0 Likes
4,276

Hi,

I want to assign char field value to currency field. I am doing like this,

DATA: W_AMT TYPE string,

AMT LIKE TRLS_FLOW_ALV-POSITION_AMT .

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'

EXPORTING

string = W_AMT

DECIMAL_SEPARATOR = '.'

THOUSANDS_SEPARATOR = ','

WAERS = 'HUF'

IMPORTING

BETRG = AMT . "converting into currency field

And then assigining AMT to ITAM-Currency field. It's giving dump.

Please help me this I need to send to Internal table which is passed to ALV.

Thank you.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
2,018

3 REPLIES 3
Read only

prasenjit_sharma
Active Contributor
0 Likes
2,018

Hi,

Use WRITE .. TO... instead of MOVE.

Regards

Prasenjit

Read only

former_member225631
Active Contributor
0 Likes
2,018

The following code works fine.

parameter str1(21).

data:str type string, betrg type maxbt.

str = str1.

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'

EXPORTING

string = str

DECIMAL_SEPARATOR = '.'

THOUSANDS_SEPARATOR = ','

WAERS = 'INR'

IMPORTING

BETRG = betrg

EXCEPTIONS

CONVERT_ERROR = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

kesavadas_thekkillath
Active Contributor
2,019