‎2006 Aug 09 8:22 AM
hi to all
plz help me in this issue
i am using this function module for decimal seperator it is working fine for EUR currency but when other currencies like NL,ISK etc comes it is raising an exeption 203 .plz help me in in sloving this issue
hi sailatha this is the code
IF L_CURR EQ 'EUR'.
CALL FUNCTION 'AMOUNT_STRING_CONVERT'
EXPORTING
AMOUNT_STRING = AMOUNT
DCPFM = '2'
MLLN = 'M'
TSND = 'T'
WAERS = L_CURR
IMPORTING
AMOUNT = L_VALUE.
EXCEPTIONS
INVALID_TYPE = 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.
ELSE.
END OF INSERTION BY NTT 13-07-2006
CALL FUNCTION 'AMOUNT_STRING_CONVERT'
EXPORTING
AMOUNT_STRING = AMOUNT
DCPFM = '0'
MLLN = 'M'
TSND = 'T'
WAERS = CURR
IMPORTING
AMOUNT = L_VALUE.
EXCEPTIONS
INVALID_TYPE = 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.
ENDIF.
Thanks & Regards
Kiran kumar
Message was edited by: kiran kumar
‎2006 Aug 09 8:28 AM
‎2006 Aug 09 8:29 AM
‎2006 Aug 09 8:32 AM
check this function module( i copied from one of the SDN post, but doesnt remember the link)
REPORT YTEST no standard page heading .
data : tline like tline occurs 0 with header line,
SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
data amouno type p DECIMALS 5 value '5455555.65461'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = amouno
CURRENCY = 'USD'
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
WRITE : / 'Amount in Number: ',AMOUNO.
WRITE : / 'Amount in Word: ',SPELL-WORD, 'AND DECIMALS' , SPELL-DECWORD.
Result
*********************************************
Amount in Number: 5,455,555.65461
Amount in Word:
FIVE BILLIONS FOUR HUNDRED FIFTY-FIVE MILLION FIVE HUNDRED FIFTY-FIVE THOUSAND SIX HUNDRED FIFTY-FOUR
AND DECIMALS SIXTY-ONE
regards
srikanth
Message was edited by: Srikanth Kidambi
‎2006 Aug 09 8:35 AM
Hi,
You can use the FM <b>HRCM_AMOUNT_TO_STRING_CONVERT</b>.
Regards
vijay