TM_ATTRIB_VALUES
Implementations of this user exit are processed:
In attribute maintenance screen when
Attributes are saved
Users switches from edit mode to display mode
In workflow wizard, if there are attributes to maintain and before the user proceeds with the next wizard step.
The difference to the user exit TM_ALL_ATTRIBUTES is that implementations for this exit here can also be used for individual F4-Help. You can use to provide an own logic for the possible values of an attribute. They are provided as F4-Help and are also used for value check (if the attribute properties “Enable value help” and “ Enable value check” are set for the attribute).
Location for activation
TM Server
Template function Module
/RTC/TM_TMPL_TM_ATTRIB_VALUES
Interface
Import Parameters
Field | TYPE | Description |
---|---|---|
LV_TRKORR | /RTC/TM_REQ-TRKORR | Transport Request |
LV_NAME | /RTC/TM_TM_ATT |
|
LT_ATTR | FIELDS: VALUE TYPE /RTC/TM_TM_ATTRVALUE DESCR TYPE /RTC/TM_TM_ATTRDESCR Please note the differences in the meaning of the parameters compared to the previous user exit TM_ALL_ATTRIB_VALUES | Table that can be populated through your implementation, to provide the allowed values for the current attribute. VALUE: Name of the attribute DESCR: Value of the attribute |
Example
The customer has defined the TM attribute TESTER. TM users should only be able to assign a user to that attribute who is assigned to the TM Group “TESTER_GROUP”.
Step 1 | Copy the function module /RTC/TM_TMPL_ TM_ATTRIB_VALUES to a new function module |
Add the following code to the section “Begin of customer implementation”:
DATA: lt_usrgr TYPE TABLE OF /rtc/tm_usrgr,
lw_usrgr TYPE /rtc/tm_usrgr.
DATA: lw_usr03 TYPE usr03.
DATA: lv_desti TYPE rfcdes-rfcdest.
DATA: lv_mandt TYPE /rtc/tm_mandt-mandt.
IF lv_name = 'TESTER*'.
SELECT * FROM /rtc/tm_usrgr INTO TABLE lt_usrgr
WHERE usrgroup = 'TESTER_GROUP'.
IF sy-subrc = 0.
* Assuming just one working client ...
* Assign the address name as attribute description
SELECT mandt FROM /rtc/tm_mandt INTO lv_mandt.
EXIT.
ENDSELECT.
CALL METHOD /rtc/tm_rfc=>get_rfc_destiname
EXPORTING
iv_r3_clnt = lv_mandt
IMPORTING
ev_rfcdest = lv_desti.
LOOP AT lt_usrgr INTO lw_usrgr.
CLEAR lt_attr.
lt_attr-value = lw_usrgr-bname.
CALL FUNCTION '/RTC/TM_APA_USER_ADDRESS_READ'
DESTINATION lv_desti
EXPORTING
user_name = lw_usrgr-bname
IMPORTING
user_usr03 = lw_usr03
EXCEPTIONS
user_address_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
concatenate lw_usr03-name2 ',' into lt_attr-descr.
concatenate lt_attr-descr lw_usr03-name1 into
lt_attr-descr separated by space.
ENDIF.
APPEND lt_attr.
ENDLOOP.
ENDIF.
ENDIF.