TM_ALL_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.

 

This exit is very useful if attributes have dependencies, as the user exit provides all attribute values at once. Example: Attribute 1 = TICKET TYPE, Attribute 2 = TICKET NUMBER.

If there are naming conventions types to check for the different ticket types, you must know and evaluate the value for TICKET TYPE in order to see, if the TICKET NUMBER fits to the naming conventions.

Location for activation

TM Server

Template function Module

/RTC/TM_TMPL_TM_ATTRIBS_VALUES

Interface

Import Parameters

Field

TYPE

Description

Field

TYPE

Description

LV_TRKORR

/RTC/TM_REQ-TRKORR

Transport Request

LT_ATTR

FIELDS:

ATTR_NAME TYPE /RTC/TM_TM_ATT

VALUE TYPE /RTC/TM_TM_ATTRVALUE

Table, hat contains the requests current attributes and their assigned values

ATTR_NAME: Name of the attribute

VALUE: Value of the attribute

Export Parameters

Parameter

Type

Shorttext

Parameter

Type

Shorttext

LV_RETCODE

SY-SUBRC

0: Attributes can be saved

>0: Attributes cannot be saved

LV_MSGTEXT

/rtc/tm_param-value

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

Example

The customer has connected TM to a 3rd party ticketing system. There are various ticket types possible. Depending on the ticket type, the ticket number can (and must) have different length.

 

Step 1

Copy the function module /RTC/TM_TMPL_ TM_ATTRIBS_VALUES to a new function module

 

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

constants: lv_lo6(6) value '0000000', lv_hi6(6) value '9999999', lv_lo5(5) value '000000', lv_hi5(5) value '999999', lv_lo4(4) value '00000', lv_hi4(4) value '99999'. data: lw_attr1 like lt_attr. data: lv_len type i. data: lv_lens. read table lt_attr into lw_attr with key attr_name = 'TICKET TYPE'. read table lt_attr into lw_attr1 with key attr_name = 'TICKET ID'. lv_len = strlen( lw_attr1-value ). case lw_attr-value. when 'Service Call'. if not ( lv_len = 6 and lw_attr1-value between lv_lo6 and lv_hi6 ). lv_retcode = 6. endif. when 'Change' or 'Work Order'. if not ( lv_len = 5 and lw_attr1-value between lv_lo5 and lv_hi5 ). lv_retcode = 5. endif. when 'Problem'. if not ( lv_len = 4 and lw_attr1-value between lv_lo4 and lv_hi4 ). lv_retcode = 4. endif. when others. lv_retcode = 12. if sy-langu = 'D'. concatenate 'Ungültiger Ticket Type:' lw_attr-value into lv_msgtext1 separated by space. else. concatenate 'Invalid Ticket Type:' lw_attr-value into lv_msgtext1 separated by space. endif. endcase. if lv_retcode > 0 and lv_retcode < 12. lv_lens = lv_retcode. if sy-langu = 'D'. concatenate 'Die Ticket ID für Tickets vom Typ' lw_attr-value into lv_msgtext1 separated by space. concatenate 'muss nummerisch und' lv_lens 'stellig sein.' into lv_msgtext2 separated by space. else. concatenate 'The Ticket ID for tickets of type' lw_attr-value into lv_msgtext1 separated by space. concatenate 'must be nummeric with length' lv_lens '.' into lv_msgtext2 separated by space. endif. endif.