cancel
Showing results for 
Search instead for 
Did you mean: 

To print the total amount of purchase order into words in smartform....

Former Member
0 Kudos

Hi Abapers,

I had a requirement to print & display the total amount into words in purchase order smartfrom.

I tried with the function module, 'SPELL_AMOUNT'.....


     CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          = is_pekko-netwr
   CURRENCY        = is_ekko-waers
   FILLER          = 'space'
   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        = gs_spell
 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.

But after activating the form, the amount not displayed nor prints in word.

I want some suggestions and corrections to print & display the amount into words......

Thanks,

Dilip.B

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

DATA:gv_words TYPE spell.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = '1235.99'

CURRENCY = 'INR'

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = gv_words

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 : gv_words-word. "the table spell has word field

Make sure that the datatypes used are matching with the formal parmateres.

Answers (2)

Answers (2)

Former Member
0 Kudos

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = is_pekko-netwr

CURRENCY = is_ekko-waers

FILLER = SPACE

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = gs_spell

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.

I just changed the 'space' into SPACE......

and used &GS_SPELL-WORD& in text node to print in words..

former_member150733
Contributor
0 Kudos

Make sure

1.is_pekko-netwr and is_pekko-waers is having some values (try debugging)

2.gs_spell is exported. Include gs_spell in the Export parameter on the node you have written the code.

Former Member
0 Kudos

Hi Anish,

As u said, their are values in is_pekko-netwr & is_pekko-waers.,

gs_spell is also exported in export parameter on the node, where i wrote the code.

Thanks,

Dilip.B

Former Member
0 Kudos

Hi,

Check if the types of gs_spell are same in driver as well as smartform.

Also check if you have added the gs_spell in the text node