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

function module

Former Member
0 Likes
592

hey i used spell_amount FM for spell the amount when i used that i am getting incompatible error with export parameter, plz tell me how i maintain the charecterstics of my field in that case, plz help me out

(or)

i used another FM in that it is spelling ' rupee twenty five thousand and paise zero only' i want to delete ' and paise zero '

i want only 'rupees twenty five thousand only' for 25000. how to do this. plzz help me out

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
568

Better use this FM.

HR_IN_CHG_INR_WRDS.

or

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.

5 REPLIES 5
Read only

Former Member
0 Likes
569

Better use this FM.

HR_IN_CHG_INR_WRDS.

or

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

0 Likes
568

hey thanks for what you say if i use this again i am getting incompatible problem.

Read only

vinod_vemuru2
Active Contributor
0 Likes
568

Hi,

Check this. I am getting out put as Twenty five thousand.

DATA: l_word TYPE spell,

l_amount(10) TYPE c.

MOVE '25000.00' TO l_amount.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = l_amount

CURRENCY = 'IND'

  • FILLER = ' '

  • LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = l_word

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3

.

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 l_word-word.

Thanks,

Vinod.

Read only

Former Member
0 Likes
568
Read only

Former Member
0 Likes
568

YA I GOT ANSWER