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

SAPScript converting numeric to word by using FM spell_amount

Former Member
0 Likes
508

hi,

I am using FM SPELL_AMOUNT to convert from numeric to word, but when i run the driver program, i get an exception TYPE CONFLICT WHEN CALLING FUNCTION MODULE.

Following is the syntax of function module call:-

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = wa-seatnum

*CURRENCY = ' '

*FILLER = ' '

LANGUAGE = 'EN'

IMPORTING

IN_WORDS = word

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

Please help

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
468

Hi,

Like any function module, the data type of your variables need to match the definition in the function module. So, either wa-seatnum or word need to be changed to have the same defintion as the function module.

The short dump will tell you which field is incorrect.

Regards,

Nick

3 REPLIES 3
Read only

Former Member
0 Likes
469

Hi,

Like any function module, the data type of your variables need to match the definition in the function module. So, either wa-seatnum or word need to be changed to have the same defintion as the function module.

The short dump will tell you which field is incorrect.

Regards,

Nick

Read only

Former Member
0 Likes
468

Hi Dhiraj,

Please check the type declarations of the fields which r passed to the parameters of the Function modules

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = wa-seatnum

*CURRENCY = ' '

*FILLER = ' '

LANGUAGE = 'EN'

IMPORTING

IN_WORDS = word

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

please try this

DATA:   result TYPE vbak-netwr,
          words TYPE spell.

     CALL FUNCTION 'SPELL_AMOUNT'
        EXPORTING
          amount    = result
          currency  = wa_tabl-waerk
          filler    = ' '
          language  = sy-langu
        IMPORTING
          in_words  = words
        EXCEPTIONS
          not_found = 1
          too_large = 2.

reward if helpful

raam

Read only

Former Member
0 Likes
468

HI,

Use the Function Module SPELL_AMOUNT to convert the integer into text.

DATA v_int TYPE i VALUE '1000'.

DATA words LIKE SPELL.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = words

.

WRITE words-word.

Regards,

Shiva.