If you wish to present the users with a pop-up calculator you can do so by the following function module.
FITRV_CALCULATOR
Once this function module is executed a small calculator appears on the screen. The user can then perform the desired calculations and the resulted is obtained in the export parameter.Please find the example below.
REPORT ZEX_CALCULATOR .
Parameters: p_ival(10).
Data: d_oval(200).
CALL FUNCTION 'FITRV_CALCULATOR'
EXPORTING
INPUT_VALUE = p_ival
CURRENCY = 'USD'
START_COLUMN = '10'
START_ROW = '10'
IMPORTING
OUTPUT_VALUE = d_oval
EXCEPTIONS
INVALID_INPUT = 1
CALCULATION_CANCELED = 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:/ 'The Result is = ', d_oval.
Parameters: p_ival(10).
Data: d_oval(200).
CALL FUNCTION 'FITRV_CALCULATOR'
EXPORTING
INPUT_VALUE = p_ival
CURRENCY = 'USD'
START_COLUMN = '10'
START_ROW = '10'
IMPORTING
OUTPUT_VALUE = d_oval
EXCEPTIONS
INVALID_INPUT = 1
CALCULATION_CANCELED = 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:/ 'The Result is = ', d_oval.
No comments:
Post a Comment