on 10-06-2009 9:27 AM
Hi Abapers,
I had a requirement to print & display the total amount into words in purchase order smartfrom.
I tried with the function module, 'SPELL_AMOUNT'.....
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = is_pekko-netwr
CURRENCY = is_ekko-waers
FILLER = 'space'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = gs_spell
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.
But after activating the form, the amount not displayed nor prints in word.
I want some suggestions and corrections to print & display the amount into words......
Thanks,
Dilip.B
Hi,
DATA:gv_words TYPE spell.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = '1235.99'
CURRENCY = 'INR'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = gv_words
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 : gv_words-word. "the table spell has word field
Make sure that the datatypes used are matching with the formal parmateres.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = is_pekko-netwr
CURRENCY = is_ekko-waers
FILLER = SPACE
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = gs_spell
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.
I just changed the 'space' into SPACE......
and used &GS_SPELL-WORD& in text node to print in words..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure
1.is_pekko-netwr and is_pekko-waers is having some values (try debugging)
2.gs_spell is exported. Include gs_spell in the Export parameter on the node you have written the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.