2008 Feb 19 11:45 AM
Hi all,
Im tryin to display numbers in text format.
eg: 151 should be displayed as "One Hundred and Fifty One.
Is dhere any function module for the same.
Thnx,
pk
2008 Feb 19 11:48 AM
2008 Feb 19 11:48 AM
2008 Feb 19 11:52 AM
Hi,
Check the following program:
REPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT
Regards,
Bhaskar
2008 Feb 19 11:59 AM
Hi prashanth kishan,
See this example code
data w_word type SPELL.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = 123
CURRENCY = ' '
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = w_word
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write / w_word-WORD.
<REMOVED BY MODERATOR>
Mahi.
Edited by: Alvaro Tejada Galindo on Feb 19, 2008 5:32 PM
2008 Feb 19 11:59 AM
Hi Prashanth ,
You can use the " SPELL_AMOUNT " FM.
But for the Amount ,the value should be 151.00 (eg) irrespective of the currency mode you choose.
You have to specify the decimal part also.
Regards,
Chitra