Hi Praveen,
Please follow below sample code which is used for amount in words for invoive(VF03).
REPORT ZINV_SUBROUTINE1.
DATA: result TYPE STRING ,
gv_amt TYPE spell.
DATA : full_in_words type string.
FORM GET_AMT TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
READ TABLE IN_PAR WITH KEY name = 'KOMK-FKWRT'.
*replace ALL OCCURRENCES OF ',' in in_par-value WITH ''.
*CONDENSE in_par-value NO-GAPS.
if sy-subrc is INITIAL.
result = in_par-value.
endif.
* ***----USE FM SPELL_AMOUNT and take ammount in words in gv_amt
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
* AMOUNT = 'KOMK-FKWRT'
AMOUNT = result
CURRENCY = ' INR'
* FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = gv_amt
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
CONCATENATE gv_amt-WORD 'or' gv_amt-decword
INTO full_in_words
SEPARATED BY space.
ENDIF.
OUT_PAR-NAME = 'full_in_words'.
OUT_PAR-VALUE = full_in_words.
*MOVE full_in_words TO OUT_PAR-VALUE.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
For SAPscript:
Our Code in SAPscript:
SU Final amount,,,,,,,,,,,,,,,,&KOMK-FKWRT(I13)& (KOMK-FKWRT GIVES TOTAL VALUE)
/: DEFINE &FULL_IN_WORDS& = ''
/: PERFORM GET_AMT IN PROGRAM ZINV_SUBROUTINE1
/: USING &KOMK-FKWRT&
/: CHANGING &FULL_IN_WORDS&
/: ENDPERFORM
SU AMOUNT IN WORDS,,&full_in_words&
Thanks &Regards,
Raju Rapelli