Application Development 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: 

Regarding Scripts...

Former Member
0 Kudos

Hi,

I want to display the amount in words for a value in a layout. Which function module should be called & is there any possibility of calling that functional module from sap script?

Regards,

Varadharajan.S

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

use this FM.

SPELL_AMOUNT.

reward if helpful.

Regards

Azad.

6 REPLIES 6

Former Member
0 Kudos

hi,

use this FM.

SPELL_AMOUNT.

reward if helpful.

Regards

Azad.

Former Member
0 Kudos

SPELL_AMOUNT is the function module, but you cannot call it directly from the SAPscript. You will need to either call it from your print program (if you are able to change it) before the form is created or call a subroutine from the SAPscript and call the FM from that subroutine. How to call a subroutine from SAPscript is covered in the online help and by many threads in this forum.

Regards,

Nick

Former Member
0 Kudos

HI Vara,

SPELL_Amount is FM. I beleive you have to use this as a perform statement and create a small include program.

Regards

Venkat

Former Member
0 Kudos

Hi,

In the driver program we need to call the function module to convert amount in to the words. Go to Se38 click on pattern at function module give the function module name 'SPELL_AMOUNT' after that fill the required attributes.

Ex :-

call function 'SPELL_AMOUNT'

exporting

amount = komk-fkwrt

currency = komk-waerk

filler = ' '

language = nast-spras

language = 'E'

importing

in_words = text

exceptions

not_found = 1

too_large = 2.

Reward points if it is useful....

Thanks & Regards,

Vasudeva Rao.

Former Member
0 Kudos

see this sample code

ABAP function to convert Number to Words

*

  • The function allows you to covert easily from numbers to words.

*

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

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

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', 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

regards,

srinivas

<b>*reward for useful answers*</b>

Former Member
0 Kudos

Hi Vara,

I have just gone through the old question in this forum.

Saquib Khan has answered me the same question, his answer was very helpful to me.

<b>Find the FM "FM : SPELL_AMOUNT" in print program and see in which variable its populating ... are you working on International Payment Medium - Check (with check management) RFFOUS_C ?

If yes variable name is "SPELL"</b>

So bottom line is, you variable &SPELL&, If you are using RFFOUS_C print program.

Thanks Khan, once gain.

Regards

Venkat