Using "SPELL AMOUNT" function to convert amounts in ABAP

You can use the standard function module SPELL_AMOUNT in ABAP to convert numeric amounts into their corresponding word representations. This is particularly useful for financial documents, checks, and reports where amounts need to be displayed in written form.

To access and explore this function module, use Transaction code SE37 (Function Builder) ?

Spell Amount

Click on the Search icon and select Function module SPELL_AMOUNT ?

Spell Amount

Key Parameters

The SPELL_AMOUNT function module accepts several important parameters ?

  • AMOUNT ? The numeric amount to be converted
  • CURRENCY ? The currency code (e.g., USD, EUR, INR)
  • LANGUAGE ? The language for text conversion (e.g., EN, DE, FR)
  • IN_WORDS ? The output parameter containing the amount in words

Example

Here's how to use the SPELL_AMOUNT function module in your ABAP code ?

DATA: lv_amount TYPE p DECIMALS 2 VALUE '1234.56',
      lv_currency TYPE waers VALUE 'USD',
      lv_language TYPE sy-langu VALUE 'E',
      lv_in_words TYPE spell.

CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
    amount   = lv_amount
    currency = lv_currency
    language = lv_language
  IMPORTING
    in_words = lv_in_words.

WRITE: / 'Amount:', lv_amount, lv_currency,
       / 'In Words:', lv_in_words.

The output would display the numeric amount followed by its textual representation, such as "One Thousand Two Hundred Thirty Four and 56/100 Dollars".

Conclusion

The SPELL_AMOUNT function module provides a standardized way to convert numeric amounts into written words, supporting multiple currencies and languages for international business applications.

Updated on: 2026-03-13T19:17:42+05:30

941 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements