08-21-2007 3:26 PM
Hi,
I want to display the amount in words for a value in a layout. Which function module should be called & is there any possibility of calling that functional module from sap script?
Regards,
Varadharajan.S
08-21-2007 3:30 PM
08-21-2007 3:30 PM
08-21-2007 3:38 PM
SPELL_AMOUNT is the function module, but you cannot call it directly from the SAPscript. You will need to either call it from your print program (if you are able to change it) before the form is created or call a subroutine from the SAPscript and call the FM from that subroutine. How to call a subroutine from SAPscript is covered in the online help and by many threads in this forum.
Regards,
Nick
08-21-2007 3:46 PM
HI Vara,
SPELL_Amount is FM. I beleive you have to use this as a perform statement and create a small include program.
Regards
Venkat
08-21-2007 3:48 PM
Hi,
In the driver program we need to call the function module to convert amount in to the words. Go to Se38 click on pattern at function module give the function module name 'SPELL_AMOUNT' after that fill the required attributes.
Ex :-
call function 'SPELL_AMOUNT'
exporting
amount = komk-fkwrt
currency = komk-waerk
filler = ' '
language = nast-spras
language = 'E'
importing
in_words = text
exceptions
not_found = 1
too_large = 2.
Reward points if it is useful....
Thanks & Regards,
Vasudeva Rao.
08-21-2007 3:49 PM
see this sample code
ABAP function to convert Number to Words
*
The function allows you to covert easily from numbers to words.
*
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,
srinivas
<b>*reward for useful answers*</b>
08-21-2007 3:54 PM
Hi Vara,
I have just gone through the old question in this forum.
Saquib Khan has answered me the same question, his answer was very helpful to me.
<b>Find the FM "FM : SPELL_AMOUNT" in print program and see in which variable its populating ... are you working on International Payment Medium - Check (with check management) RFFOUS_C ?
If yes variable name is "SPELL"</b>
So bottom line is, you variable &SPELL&, If you are using RFFOUS_C print program.
Thanks Khan, once gain.
Regards
Venkat