Selection-Screen:

Result:

Codes:
report zanil.
* Job: Define button on selection screen.
tables: sscrfields.
data lv_result type i.
data lv_val type string.
* Parameters
parameters: p_val1 type i obligatory.
parameters: p_val2 type i obligatory.
selection-screen function key 1.
initialization.
move ‘Sum Values’ to sscrfields–functxt_01.
at selection–screen.
if sscrfields–ucomm eq ‘FC01’.
lv_result = p_val1 + p_val2.
lv_val = lv_result.
message lv_val type ‘S’.
return.
endif.
