Skip to Content
0
Former Member
Sep 13, 2006 at 04:42 AM

How to call function module in SAPscript

309 Views

Hello Experties,

I hav a function Module 'ZIN_SPELL_AMOUNT'

to print amount in words that i want to call in SAPscript.I hav written the code in follwing manner

IN SAPSCRIPT WINDOW

Perform sub_amt in program ztestscript

/: USING &AMT&

/:CHANGING &AMT_WORD&

/:ENDPERFORM

IN ZTESTSCRIPT PROGRAM

REPORT ZTESTSCRIPT.

FORM sub_amt

TABLES in_par structure itcsy

out_par structure itcsy.

data : amt LIKE BSEG-WRBTR.

DATA : l_word TYPE string.

READ table in_par with key 'regud-WAERS'.

CHECK sy-subrc = 0.

amt = in_par-value.

CALL FUNCTION 'ZIN_SPELL_AMOUNT'

EXPORTING

P_NUMBER = amt

IMPORTING

AMTWORD = l_word

EXCEPTIONS

AMOUNT_NOT_ENTERED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ table out_par with key 'amt_word'.

out_par-value = l_word.

MODIFY out_par INDEX SY-TABIX.

ENDFORM. "sub_amt

BUT ABOVE CODE IS NOT WORKING .

SO PLZ ANYONE GUIDE ME FOR THE SAME,

THANKSS & REGARDS,

SADIK.