formula and automatically calculate the result. If used inside a report
program the formula can even contain variables which are replaced within a
sub-routine. The following code gives a little how-to-use example:
CALL FUNCTION 'EVAL_FORMULA'
EXPORTING
FORMULA = 'A+B'
PROGRAM = 'ZSB_TEST'
ROUTINE = 'GET_VAR'
IMPORTING
VALUE = e_value
FORM get_var USING value(name)
CHANGING value(value)
value(subrc).
CASE name.
WHEN 'A'.
value = 13.
WHEN 'B'.
value = 13.
WHEN OTHERS.
value = 0.
ENDCASE.
ENDFORM.
No comments:
Post a Comment