Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to use spell_amount funcation modules

Former Member
0 Likes
3,439

hello ABAP gurus,

I want to know how to use spell_amount function modules?

Regards

Maruthi

hello ABAP gurus,

I want to know how to use spell_amount function modules?

Regards

Maruthi

3 REPLIES 3
Read only

Former Member
0 Likes
2,664
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = amouno
CURRENCY = 'USD'
* FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3

.

Check

http://www.sap-img.com/fu001.htm

<b>Reward if it helps</b>

Regards,

Santosh

Read only

Former Member
0 Likes
2,664

Hi Maruthi,

Please check this sample codes.

report ztest01.
 
data: words type spell.
 
call function 'SPELL_AMOUNT'
 exporting
    amount          = '100000'
*   CURRENCY        = ' '
*   FILLER          = ' '
*   LANGUAGE        = SY-LANGU
  importing
    in_words        = words.
 
if words-word = 'ONE HUNDRED THOUSAND'.
  words-word = '1 LAKH'.
endif.
  
write:/ words-word.

Also you can use FM HR_IN_CHG_INR_WRDS.

report ztest02.
 
data: words(50) type c.
 
call function 'HR_IN_CHG_INR_WRDS'
     exporting
          amt_in_num   = '100000'
     importing
          amt_in_words = words.
  
write:/ words.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
2,664

Hi

pls find this example.


DATA: amount TYPE i,
      language TYPE sy-langu,
      in_words TYPE spell.

amount = '100'.
language = sy-langu.

CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
    amount    = amount
    language  = language
  IMPORTING
    in_words  = in_words
  EXCEPTIONS
    not_found = 1
    too_large = 2
    OTHERS    = 3.
    
WRITE in_words-word.