Skip to Content
0
Former Member
Jun 23, 2009 at 01:27 PM

Service ticket status change-ERMS

113 Views

Hi All,

My requirement is to change the status of service ticket whenever the agent receives second e-mail contact to "New Message".

For this i've created a new service id in ERMS and created a class in which i've included the following logic in the method to achieve this functionality:

*Internal table and Work areas declaration
DATA : x_status_com TYPE crmt_status_comt,
       i_status_com TYPE STANDARD TABLE OF crmt_status_comt,
       x_input_field_name TYPE crmt_changeable VALUE 'X'.

*Assign the values to change the service ticket status
x_status_com-ref_guid = '0026D6FB55EBD04E98772A4C71045C32'.
x_status_com-ref_kind = 'A'.
x_status_com-status = 'E0008'. "New Message
x_status_com-activate = 'X'.

APPEND x_status_com TO i_status_com.

*Call this function to change the service ticket status
CALL FUNCTION 'CRM_STATUS_MAINTAIN_OW'
  EXPORTING
    it_status_com        = i_status_com
  CHANGING
    ct_input_field_names = x_input_field_name
  EXCEPTIONS
    not_allowed          = 1
    error_occurred       = 2
    warning_occurred     = 3
    OTHERS               = 4.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

*Call this function to perform the transaction commit.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

BUT the above code is not working as it is giving type-conflict error message in the runtime dump.

Can any one tell me how can i pass one entry in the above function module to change the status of my GUID or service ticket. Also, please let me know if the FM 'CRM_STATUS_MAINTAIN_OW' is correct when i want to change the status of my service ticket or an e-mail ticket/id.

Thanks,

Shamim

Edited by: S H A M I M on Jun 23, 2009 7:04 PM