The exit during loop is called up during the processing of a form level and enables you to carry out activities that have to be performed for each line of the form level.
The exit during loop runs while the form level is being processed - immediately after data is transported to the respective work areas. In this user exit you can use the work areas belonging to the relevant form level, to the corresponding 1:1 levels, and to all form levels higher in the hierarchy. Use this user exit to:
· Perform summations
· Read additional data from the database
· Modify global data areas
*&---------------------------------------------------------------------*
*& USER_EXIT_SUM_PERFORM
*&---------------------------------------------------------------------*
FORM user_exit_sum_perform
USING x_booking type sbook
value(x_index) type sy-tabix.
DATA: local_amount LIKE x_booking-forcuram.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = sy-datum
foreign_amount = x_booking-forcuram
foreign_currency = x_booking-forcurkey
local_currency = local_currency
* RATE = 0
* TYPE_OF_RATE = 'M'
IMPORTING
* exchange_rate =
* foreign_factor = fremdkurs
local_amount = local_amount
* local_factor =
* exchange_ratex = faktorsum
* FIXED_RATE =
* DERIVED_RATE_TYPE =
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
ADD local_amount TO sum. “execute summation
ENDFORM . " USER_EXIT_SUM_PERFORM