Skip to Content
0
Former Member
Jan 17, 2008 at 10:15 AM

script

17 Views

Hi,

i tried to display amount in words with using itcsy structure. because

my driverprogram is standard one. i writeen code but i am getting dump and i am not getting value in i_oupar table i am pasting my cod ebellow

PROGRAM ZSPELLAMOUNT.

FORM SPELL_AMOUNT TABLES I_INTPAR STRUCTURE ITCSY

I_OUTPAR STRUCTURE ITCSY.

DATA:I_PAYR TYPE TABLE OF PAYR,

WA_PAYR TYPE PAYR.

DATA: WA_RWBTR TYPE RWBTR.

  • DATA: WA_ZBUKR TYPE DZBUKR.

DATA: WORD TYPE string.

DATA: wa_ZNME1 TYPE DZNME1.

READ TABLE i_intpar WITH key name = 'payr-ZNME1'.

IF i_intpar-value co'0123456789'.

UNPACK i_intpar-value TO wa_znme1.

else.

wa_ZNME1 = i_intpar-value.

endif.

select rwbtr znme1 from payr

into corresponding fields of table i_payr

where znme1 = wa_znme1.

*LOOP AT I_PAYR INTO WA_PAYR.

READ TABLE i_PAYR INTO wa_PAYR WITH KEY RWBTR = WA_RWBTR.

*ENDLOOP.

READ TABLE I_OUTPAR WITH KEY NAME = 'WA-RWBTR'.

WRITE WA_RWBTR TO I_OUTPAR-VALUE.

CONDENSE i_outpar-value NO-GAPS.

  • CALL FUNCTION 'SPELL_AMOUNT'

  • EXPORTING

  • AMOUNT = WA_RWBTR

  • CURRENCY = ' '

  • FILLER = ' '

  • LANGUAGE = SY-LANGU

  • IMPORTING

  • IN_WORDS = WORD

  • EXCEPTIONS

  • NOT_FOUND = 1

  • TOO_LARGE = 2

  • OTHERS = 3

  • .

    • APPEND ipayr_final.

  • 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 i_outpar WITH KEY 'IPAYR-RWBTR'.

    • WRITE WORD TO i_outpar-value.

    *

    • CONDENSE i_outpar-value NO-GAPS.

    MODIFY i_outpar INDEX sy-tabix TRANSPORTING value.

    ENDFORM.