REVOKE APPROVAL
This user exit can be used to apply own checks to the approval process. In opposite to the exit BEFORE_APP_REV, implementations of this exit are executed once per request. Thus you do not have access to the information, what other requests are subject of the current approval…. If the TM user is going revoke multiple requests, none of them will be revoked if at least one fails the checks.
Location for activation
TM Server
Template function Module
/RTC/TM_TMPL_REVOKE_APPROVAL
Interface
Import Parameters
Internal table LT_TRKORR
(contains only 1 record)
Field | Description |
---|---|
TRKORR | Transport Request |
OWNER | Owner of the Transport Request |
PJ_NAME | Project the request is assigned to |
DESTI_NAME | Destination the request is assigned to |
LEVEL_NAME | Current Transport Level of the request |
SIGN_POS | Position of the approval that should be revoked ‘1’: Technical approval ‘2’: Content approval ‘3’: 2nd content approval |
USRGROUP | User Group whose approval should be revoked |
Export Parameters
Parameter | Type | Shorttext |
---|---|---|
LV_RETCODE | SY-SUBRC | 0: Revoking request is possible |
LV_MSGTEXT | /rtc/tm_param-value | Message, that should appear in case of sending return code > 0. |
Example
By default, anyone who is authorized to approve can also revoke an approval. If the customer wants to restrict this to the user who has originally granted the approval, proceed as described here:
Step 1 | Copy the function module /RTC/TM_TMPL_REVOKE_APPROVAL to a new function module |
Add the following code to the section “Begin of customer implementation”:
SELECT sign_user FROM /rtc/tm_sign into lv_approver
WHERE trkorr = lt_trkorr-trkorr AND
Level_name = lt_trkorr-level_name AND
Sign_pos = lt_trkorr-sign_pos.
EXIT.
ENDSELECT.
* No user groups used in that example
IF lv_approver ne sy-uname.
Lv_retcode = 8.
CONCATENATE ‘Sorry. Only’ lv_approver ‘may revoke that approval…’
INTO lv_msgtext SEPARATED BY SPACE.
ENDIF.