SWITCH_STATUS

This user exit can be used to apply own checks whenever a request is switched from one transport level / status to another one. If the TM user is going to switch multiple requests, none of them will be switched if at least one fails the checks.

Location for activation

TM Server

Template function Module

/RTC/TM_TMPL_SWITCH_STATUS

Interface

Import Parameters

Internal table LT_TRKORR

(contains only 1 record)

Field

Description

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

STATUS

Current Status. Possible values:

‘Q’: Queue

‘C’: Current

EXP_DATE

Reference date for import sequence

EXP_TIME

Reference time for import sequence

DEP_EXIST

The Request collides with other Requests

RELATION

The Request has dependencies to other Requests (predecessor, successor)

CRIT_OBJ

The Request contains critical objects

S_CLIENT

Source Client of the Request

SHORTTEXT

Short text of the Request

 

Export Parameters

Parameter

Type

Shorttext

Parameter

Type

Shorttext

LV_RETCODE

SY-SUBRC

0: Status switch will be executed
>0: Status switch is denied

LV_MSGTEXT

/rtc/tm_param-value

Message, that should appear in case of sending return code > 0.

Example

The first approval for production should be done by a key user that is assigned to the attribute KEY USER. The status switch from Production Queue to Production Signature should be avoided as long as there is no key user assigned. Reason: It needs this attribute, so that after the status switch the appropriate key user can be notified…

Step 1

Copy the function module /RTC/TM_TMPL_SWITCH_STATUS to a new function module

 

Add the following code to the section “Begin of customer implementation”:

IF lt_trkorr-level_name = ‘Quality Assurance’ AND Lt_trkorr-status = ‘C’. * The level name is just an example. The better and safer way is to provide * customer specific tables where all specific values for projects/destinations, levels, * etc. can be maintained… SELECT SINGLE value FROM /rtc/tm_attrib03 into lv_value WHERE trkorr = lt_trkorr-trkorr AND Attr_name = ‘KEY USER’. IF lv_value = space. Lv_retcode = 8. CONCATENATE ‘Sorry. No key user specified yet…’ INTO lv_msgtext SEPARATED BY SPACE. ENDIF. ENDIF.