BEFORE_ATTRIBUTE_CHANGE
This user exit can be used to control wether the attribute maintenance is allowed for a specific request or not
Location for activation
TM Server
Template function Module
/RTC/TM_TMPL_ATTRIBUTE_CHANGE
Interface
Import Parameters
Internal table LT_TRKORR
Field | Description |
---|---|
TRKORR | Transport Request |
Export Parameters
Parameter | Type | Shorttext |
---|---|---|
LV_RETCODE | SY-SUBRC | 0: Changing attributes is allowed |
LV_MSGTEXT | /rtc/tm_param-value | Message, that should appear in case of sending return code > 0. |
Example
Attributes should no longer be changeable, after the attribute STATUS is set to PRODUCTIVE.
Step 1 | Copy the function module /RTC/TM_TMPL_ ATTRIBUTE_CHANGE to a new function module |
Add the following code:
FIELD-SYMBOLS: <lw_trkorr>.
DATA: lt_req TYPE TABLE OF /RTC/TM_REQ.
* lt_trkorr can only contain 1 record here
LOOP AT lt_trkorr ASSIGNING <lw_trkorr>.
SELECT SINGLE * FROM /rtc/tm_attrib02 WHERE
trkorr = <lw_trkorr>-trkorr AND
attr_name = ‘STATUS’ AND
value = ‘PRODUCTIVE’.
IF sy-subrc = 0.
Lv_retcode = 8.
Lv_msgtext = ‘Sorry, Request has status PRODUCTIVE’.
EXIT.
ENDIF.
ENDLOOP.