Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

perform in script

Former Member
0 Likes
431

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

3 REPLIES 3
Read only

Former Member
0 Likes
407

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.

Read only

0 Likes
407

hi,

thanks for ur response. can u guide me how to conver that

Read only

0 Likes
407

use w_fkwrt = it_input_table-value.

Define w_fkwrt as character field 15 char