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

CALL FUNCTION SPELL_AMOUNT

Former Member
0 Likes
1,399

Hello, i´m using call function spell_amount, but i receive an error when using a number betwen 101 and 199.

For example, when i use 123, the call function returns me '100 twenty three', when the correct would be 'one hundred and twenty three'.

Why happend that?

Thanks everybody.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,107

Hi,

Better use this FM.

HR_IN_CHG_INR_WRDS.

thanks

8 REPLIES 8
Read only

Former Member
0 Likes
1,108

Hi,

Better use this FM.

HR_IN_CHG_INR_WRDS.

thanks

Read only

Former Member
0 Likes
1,107

check one more time.. when i am checking in my system, i have passed 123 and pressed execute button it has returned me value as

000000000000123000 0 ONE HUNDRED TWENTY-THREE

Here, 000000000000123 is number

000 is Dec

0 is Cur

ONE HUNDRED TWENTY-THREE is word

or better use

HR_IN_CHG_INR_WRDS

Read only

Former Member
0 Likes
1,107

Are you passing the currency field also..

CURRENCY..also see the user settings...for what the decimal format in use

santhosh

Read only

Former Member
0 Likes
1,107

Hi Javier,

This is the code.Try this

DATA AMT_IN_NUM LIKE PC207-BETRG.

DATA AMT_IN_WORDS(100) TYPE c.

PARAMETERS: AMOUNT LIKE AMT_IN_NUM.

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = AMOUNT

IMPORTING

AMT_IN_WORDS = AMT_IN_WORDS

EXCEPTIONS

DATA_TYPE_MISMATCH = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

WRITE AMT_IN_WORDS.

Read only

Former Member
0 Likes
1,107

ok, this module function works, but i need euros and not rupees. Is there any way to change this?

Thanks again!

Read only

0 Likes
1,107

HI,

Try this function module CONVERT_TO_FOREIGN_CURRENCY

For forther help please go through the below link

hope this will help you...

Regards,

Kiran

Read only

Former Member
0 Likes
1,107

Maybe it's just late the answer, but it could help others:

There is a Table View (V_T015Z) that can be modified using the transaction SM30. Set your position in the register LANGUAGE = 'EN', UNIT = 'X', and Figure = '1' and replace the value of the field "Number in Words" from 100 to ONE HUNDRED.

Hope it is useful.

Read only

former_member182371
Active Contributor