‎2009 Nov 20 8:42 PM
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.
‎2009 Nov 21 7:43 AM
‎2009 Nov 20 9:09 PM
‎2009 Nov 21 4:14 AM
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.
‎2009 Nov 21 7:43 AM