Skip to Content
author's profile photo
Former Member

Regarding Scripts...

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:30 PM

    hi,

    use this FM.

    SPELL_AMOUNT.

    reward if helpful.

    Regards

    Azad.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:38 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:46 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:48 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:49 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded