cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script(calling FM to spell the amount in words)

Former Member
0 Kudos

Hi Friends,

I am getting error in calling a function module(HR_IN_CHG_INR_WRDS : To spell the amount in words) to a script form.It is giving a dump message : "Conversion type error".

Could you guide me with small example ?

I will reward for usefull responses.

Pls. treat it as urgent.

Thx in Adv.

Bobby

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

According to me, for scripts you might be using a subroutine pool for the conversion.

In subroutine pool all the values trapped are in char format.

Thus after reading the value to be converted from script, assign it to the variable of 'CURR' type. then pass that variable into the function module you mentioned.

Hope it will solve your problem.

Reward points if useful.

Thanks,

Parul.

Former Member
0 Kudos

Hi

execute this code .

REPORT ZCOVERTION.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '23.45'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD ,'and', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

CURRENCY = PWAERS

FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

ENDFORM. " SPELL_AMOUNT

Hope this will solve ur problem

Thanks

sreelakshmi

sreelatha_gullapalli
Active Participant
0 Kudos

hi

call the function module SPELL_AMOUNT

Also try this thread.

hope it will help you,

regards,

sreelatha gullapalli

former_member609120
Contributor
0 Kudos

Check the type of the parameters you are passing, returning to the function module..they should match with the type sepcified in the function module..

Also at times, in the amount field , or . dont match..I suggest for the amount field removes all occurences of , or . then pass to the FM for getting amount in words

Former Member
0 Kudos

U can use

SPELL_AMOUNT

Reward if useful

Former Member
0 Kudos

hi,

Use FM SPELL_AMOUNT .....


 CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = v_total1
currency = val3
* FILLER = ' '
language = sy-langu
IMPORTING
in_words = wa_spell
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3