2006 Jun 21 6:45 PM
Dear All,
I am working on bank Check, I need to print the amount value in Words. Amount field ®UD-SWNES&, I need to print this amount in words.
I mean to say that, regud-swnes = 1000.69, I have to print this as One Thousand and 69/100. please advice me, how Can I do that.
Thanking you.
with kind Regards
Venkat.
Dear All,
I am working on bank Check, I need to print the amount value in Words. Amount field ®UD-SWNES&, I need to print this amount in words.
I mean to say that, regud-swnes = 1000.69, I have to print this as One Thousand and 69/100. please advice me, how Can I do that.
Thanking you.
with kind Regards
Venkat.
2006 Jun 21 6:53 PM
Probably you can split it at the decimal point and pass the digits before the decimal to SPELL_AMOUNT and then decide how many digits are there after the decimal and then write it appropriately.
Search regud-swnes for '.'.
var1 = regud-swnes+0(sy-fdpos).
Now call the spell amount for var1.
var2 = regud-swnes+sy-fdpos(2).
Now you should be able write it.
Regards,
Ravi
2006 Jun 21 6:58 PM
HI,
Split the amount in to two variable i.e, var1 and var2 at '.' and print the var1 using FM SPELL_AMOUNT and then display var2 according to your requirement.
2006 Jun 21 6:58 PM
Use FM spell_amount, this one exports structure SPELL in your case with:
WORD = One Thousand
DECWORD = sixty nine
Regards.
2006 Jun 21 6:59 PM
hi venkat,
split the command at decimal and u can design ur code for 69/1000.for displaying 1000 u can use the fm 'SPELL_AMOUNT'.
sample:
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.
reward if helpful.
regards,
keerthi.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |