AFTER_ADD2_WF
This user exit is called at every time after a request has been added to the Transport Management workflow.
Location for activation
TM Server
Template function Module
/RTC/TM_TMPL_ADD_TO_WORKFLOW
Interface
Import Parameters
Internal table LT_TRKORR
Field | Description |
---|---|
TRKORR | Transport Request |
OWNER | Request Owner |
PJ_NAME | Project that is assigned to the Transport Request |
DESTI_NAME | Destination that is assigned to the Transport Request |
LEVEL_NAME | Name of the initial transport level after insertion |
STATUS | Initial status after insertion |
EXP_DATE | Reference date assigned to the Transport Request (usually the export date) |
EXP_TIME | Reference time assigned to the Transport Request (usually the export time) |
EXP_DATE_ORG | Export date of the Transport Request |
EXP_TIME_ORG | Export time of the Transport Request |
DEP_EXIST | “X” = The Request has collisions with other Requests |
RELATION | “X” = The Request has dependencies to other Requests |
CRIT_OBJ | “W” = Request contains critical objects/aspects of severity “Warning” “E” = Request contains critical objects/aspects of severity “Error” |
S_CLIENT | Source client of the Transport Request |
SHORTTEXT | Short text of the Transport Request |
Export Parameters
Parameter | Type | Shorttext |
---|---|---|
LV_RETCODE | SY-SUBRC | No effect here |
LV_MSGTEXT | /rtc/tm_param-value | No effect here |
Example
The customer’s naming convention for short texts forces the developers to provide the ticket id of an external change request management product at a specified position within the shorttext:
BC:WB:<ticket id> - <Free text>
The customer wants Transport Management to store the ticket ID also in a TM attribute called TICKET ID:
Step 1 | Copy the function module /RTC/TM_TMPL_ADD_TO_WORKFLOW to a new function module |
Add the following code to the section “Begin of customer implementation”:
FIELD-SYMBOLS: <lw_trkorr>.
LOOP AT lt_trkorr ASSIGNING <lw_trkorr>.
* Parse <lw_trkorr>-shorttext for the ticket id and store it in lv_ticket
* Fill the attribute table
lw_attrib03-trkorr = <lw_trkorr>-trkorr.
lw_attrib03-attr_name = ‘TICKET ID’.
lw_attrib03-value = lv_ticket.
lw_attrib03-create_user = sy-uname.
lw_attrib03-create_date = sy-datum.
lw_attrib03-create_time = sy-uzeit.
lw_attrib03-chang_user = sy-uname.
lw_attrib03-chang_date = sy-datum.
lw_attrib03-chang_time = sy-uzeit.
lw_attrib03-source_system = sy-uzeit.
MODIFY /rtc/tm_attrib03 FROM lw_attrib03.
* Set the icon for TM attributes for the request
UPDATE /rtc/tm_req SET attr = 'X'
WHERE trkorr = lt_trkorr-trkorr.
* If requested by the customer, write an action log entry
CALL FUNCTION '/RTC/TM_WRITE_HISTORY'
EXPORTING
iv_trkorr = <lw_text>-trkorr
iv_action = ‘AssignAttrValue’
iv_level = <lw_text>-level_name
iv_msgid = '/RTC/TMM00'
iv_uname = sy-uname.
ENDLOOP.