‎2007 Jun 05 10:18 AM
hi all,
i need to display amount in words in medruck form i copied it to zpmedruck.
i am calling subroutine for this.
i developed code. wen i execute it is going to dump.tat w_fkwart is not correct number format and in this line move it_input_table-value to w_fkwrt
in script editor
/: PERFORM AMT_WORDS IN PROGRAM ZFORMWORDS
/: USING &KOMK-FKWRT&
/:CHANGING&WORD&
&WORD&
/:ENDPERFORM
REPORT ZFORMWORDS.
data : begin of it_input_table occurs 0.
INCLUDE STRUCTURE ITCSY.
data : end of it_input_table.
data :begin of it_output_table occurs 0.
INCLUDE STRUCTURE ITCSY.
data :end of it_output_table.
data : w_fkwrt like KOMK-FKWRT.
data : w_word(100) type c.
FORM AMT_WORDS tables input output.
IT_INPUT_TABLE[] = INPUT[].
IT_OUTPUT_TABLE[] = OUTPUT[].
READ TABLE it_input_table INDEX 1.
MOVE it_input_table-value to w_fkwrt.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = w_fkwrt
IMPORTING
AMT_IN_WORDS = w_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 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.
it_output_table-name = 'WORD'.
MOVE w_word to it_output_table-value.
MODIFY it_output_table INDEX 1.
output[] = it_output_table[].
ENDFORM.
canany body help me in this regard
thanks in advance
‎2007 Jun 05 10:21 AM
Field w_fkwrt is a Currency field but the input field u get from sapscript is string and hence convert this string to currency and pass it to the FM.
‎2007 Jun 05 10:25 AM
‎2007 Jun 05 10:27 AM
use w_fkwrt = it_input_table-value.
Define w_fkwrt as character field 15 char