Method PROCESS_SPECIFIC
Use
The PROCESS_SPECIFIC method implements the specific behavior of the runtime class according to the settings imported in Method INITIALIZE.
Only the main parts of the source text of the PROCESS_SPECIFIC method are mentioned.
Sample source text:
METHOD process_specific .
LOOP AT if_expression_brf~mt_brf200 INTO ls_brf200 where
category = 'F'.
*------... get results of 'subexpressions' --------------------------
CALL METHOD me->get_subexpression
EXPORTING
iv_applclass = ms_brf150-applclass
iv_expression = lv_expression
io_event = mo_event
io_processor = mo_processor
IMPORTING
ev_value = lv_value
* ev_type = lv_type
* ev_data_missing = lv_data_missing
ev_error = lv_error
EXCEPTIONS
result_not_valid = 1.
*------... locigal operation ----------------------------------------
CASE ms_brf130-operation3.
WHEN 1. "A or B or C
IF NOT lv_a IS INITIAL OR
NOT lv_b IS INITIAL OR
NOT lv_c IS INITIAL.
if_expression_brf~mv_value = mc_true.
ELSE.
CLEAR if_expression_brf~mv_value.
ENDIF.
WHEN 2. "A and B or C
WHEN 3. "(A or B) and C
WHEN 4. "A and B and C
ENDCASE.
if_expression_brf~mv_result_is_valid = mc_true.
ENDIF.
ENDMETHOD.
Description:
You can use method GET_SUBEXPRESSION to determine the results of the subexpressions.
We recommend that you perform a calculation only for the operands that are really needed. For example, if the result is available prematurely, no further operands need to be calculated.
The further procedure depends on the concrete requirements regarding functionality of the class. In class CL_EXPRESSION3_BRF, three operands are linked according to the customizing setting, and the result is determined.
The result variables are then filled accordingly, and the result is set to "Valid" to avoid repeated calculation.
Error Message in Calculation
If an error occurs during the calculation, you must create an error message and inform the event accordingly.
Sample coding:
MESSAGE e161(brf) WITH
ms_brf141-get_function
if_expression_brf~ms_brf150-expression
INTO lv_dummy.
CALL METHOD io_event->add_message.
if_expression_brf~mv_error = mc_true.
if_expression_brf~mv_result_is_valid = mc_true.
lv_error = mc_true.
If an error occurs, you can cancel the calculation.
Note the following:
-
Ensure that PROCESS_END of the method is still processed. For example, you can specify a simple EXIT with immediate exit from the PROCESS_SPECIFIC method.
-
As well as MV_ERROR, set the member variable MV_VALID to TRUE. The result contains errors, but it is still valid.
-
A repeated calculation would probably only confirm the error. You can therefore suppress such a repeated calculation.