Code: Alles auswählen.
DATA: u_is_allowed TYPE confirmed.
DATA: l_hrus_d2 TYPE hrus_d2.
DATA: temp_rep_name TYPE sy-uname.
PARAMETERS: g_akt TYPE sy-uname.
PARAMETERS: akt_user TYPE sy-uname.
temp_rep_name = akt_user.
PERFORM check_deputy CHANGING u_is_allowed.
FORM check_deputy CHANGING u_is_allowed.
SELECT * FROM hrus_d2 INTO l_hrus_d2
WHERE
rep_name EQ temp_rep_name
AND begda <= sy-datum
AND endda >= sy-datum
AND reppr = 'ZCOA'
AND active = 'X'.
IF l_hrus_d2-us_name EQ g_akt.
u_is_allowed = 'X'.
g_akt = sy-uname.
ELSE.
temp_rep_name = l_hrus_d2-us_name.
PERFORM check_deputy CHANGING u_is_allowed.
ENDIF.
ENDSELECT.
ENDFORM.