09-19-2008 1:44 PM
Hi Abapers,
I want to display amount field as word format. I am using Spell_word FM.
But, the problem is, I don't know how to use this FM internal table records.
FORM SUB_GET_OUPUT .
CLEAR W_VBRK.
LOOP AT T_VBRK INTO W_VBRK.
W_OUTPUT-VBELN = W_VBRK-VBELN.
W_OUTPUT-FKART = W_VBRK-FKART.
W_OUTPUT-FKDAT = W_VBRK-FKDAT.
W_OUTPUT-KUNRG = W_VBRK-KUNRG.
W_OUTPUT-XBLNR = W_VBRK-XBLNR.
W_OUTPUT-NETWR = W_VBRK-NETWR.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = W_VBRK-NETWR
CURRENCY = SY-WAERS
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = W_OUTPUT-NETWR
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.
W_OUTPUT-ERDAT = W_VBRK-ERDAT.
CLEAR W_VBRP.
READ TABLE T_VBRP INTO W_VBRP WITH KEY VKORG_AUFT = W_VBRK-VKORG.
W_OUTPUT-MATNR = W_VBRP-MATNR.
W_OUTPUT-WERKS = W_VBRP-WERKS.
W_OUTPUT-POSNV = W_VBRP-POSNV.
W_OUTPUT-ARKTX = W_VBRP-ARKTX.
W_OUTPUT-VRKME = W_VBRP-VRKME.
W_OUTPUT-FKIMG = W_VBRP-FKIMG.
W_OUTPUT-NETWR = W_VBRP-NETWR.
W_OUTPUT-VKORG_AUFT = W_VBRP-VKORG_AUFT.
This is example code.
Please help me in this regard.
Advance thanks
Regards
Sai
09-19-2008 1:50 PM
Hi Sai,
The code to get amount in spell is correct but I am not sure how you declared W_OUTPUT-NETWR variable.
You need to create this has of type SPELL structure in order to get the value in words.
Thanks,
Vinay
09-19-2008 1:50 PM
Hi Sai,
The code to get amount in spell is correct but I am not sure how you declared W_OUTPUT-NETWR variable.
You need to create this has of type SPELL structure in order to get the value in words.
Thanks,
Vinay
09-19-2008 1:52 PM
Hi Sai babu..,
The problem with this function module occurs always due to passing of parameters..,
Plz refer program RF_SPELL once..,
Then you will get grip on this function module.., then you can solve your problem easily.
Thanks,
Naveen.I
11-06-2008 9:00 AM