Sunday, December 26, 2010
Use function module SPELL_AMOUNT to convert an amount or number into words.
REPORT ZTEST_SPELL. DATA: LANGU LIKE SY-LANGU, CURRENCY LIKE PAYR_FI-WAERS VALUE 'USD', AMOUNT LIKE PAYR_FI-RWBTR VALUE '123456789.12', WA_SPELL TYPE SPELL. CALL FUNCTION 'SPELL_AMOUNT' EXPORTING AMOUNT = AMOUNT CURRENCY = CURRENCY FILLER = SPACE LANGUAGE = SY-LANGU IMPORTING IN_WORDS = WA_SPELL EXCEPTIONS NOT_FOUND = 1 TOO_LARGE = 2 OTHERS = 3. IF SY-SUBRC EQ 0. DATA:FULL_IN_WORDS TYPE STRING. CONCATENATE WA_SPELL-WORD 'dollors' 'and' WA_SPELL-DECWORD 'cents' INTO FULL_IN_WORDS SEPARATED BY SPACE. WRITE FULL_IN_WORDS. ENDIF.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
I wan not knowing this thing.
ReplyDeleteThanks a lot for wonderful knowledge contribution.