Amount Conversion

<< Click to Display Table of Contents >>

Navigation:  All About ABAP Technique > English > Function Module Examples Code >

Amount Conversion

Objective

Knowledge using SAP Standard Function Module for amount conversion

Support

 

Contributor

Albertus Reinandang ( reinandang@yahoo.com )

 

SPELL_AMOUNT : Spell Out Numbers

 

Example :

REPORT  ztest_fm501 NO STANDARD PAGE HEADING LINE-SIZE 1023.
 
PARAMETERS: p_amount LIKE bseg-wrbtr,
            p_curr   LIKE bkpf-waers DEFAULT 'IDR',
            p_langu  LIKE sy-langu DEFAULT sy-langu.
 
 
START-OF-SELECTION.
  DATA : lw_words LIKE spell.
 
  CALL FUNCTION 'SPELL_AMOUNT'
   EXPORTING
     amount          = p_amount
     currency        = p_curr
*   FILLER          = ' '
     language        = p_langu
 IMPORTING
   in_words        = lw_words
* EXCEPTIONS
*   NOT_FOUND       = 1
*   TOO_LARGE       = 2
*   OTHERS          = 3
            .
  WRITE : p_amount CURRENCY p_curr COLOR 1' = ',
          lw_words-word COLOR 2.