Skip to Content
Author's profile photo Caique Escaler

How to create an alert for VIP customers

1. ALERT FOR VIP CUSTOMERS IN INTERACTION CENTER

1.1. CREATION OF A CLASS

• Go to transaction SE24 to create a new class

/wp-content/uploads/2013/08/image006_260215.jpg

• Assign a description

/wp-content/uploads/2013/08/image007_260240.png

• Assign a package and then save

/wp-content/uploads/2013/08/image008_260241.png

• In tab “Caracts.” click in the button “Superclass”

/wp-content/uploads/2013/08/image009_260242.jpg

• Assign class CL_CRM_SMF_ABSTRACT_SERVICE in the field “Superclass”. Activate and save the class

/wp-content/uploads/2013/08/image010_260243.jpg

• In the tab Methods it’s necessary to redefine the method IF_CRM_SMF_SERVICE~EXECUTE

• Select the method and click the button /wp-content/uploads/2013/08/image012_260244.jpg to redefine the method.

• Upload the source code attached

method IF_CRM_SMF_SERVICE~EXECUTE.

  DATA : lv_string TYPE        string,                 “Result
         lv_fb     TYPE        string,                 “Fact Base
         lo_bdc    TYPE REF TO if_crm_ui_data_context. “Context

  TRY.
      CALL METHOD super->if_crm_smf_service~execute
        EXPORTING
          session            = session
          service_properties = service_properties.

    CATCH cx_root.
  ENDTRY.

* Context instance
  lo_bdc  = cl_crm_ui_data_context_srv=>get_instance( ).

  TRY.

      CLEAR lv_string.
     
*     Searchs for VIP flag main customer – In case true, LV_STRING = “X”     
      lv_string = lo_bdc->get_entity_attribute_as_string( path = ‘//currentCustomer/BuilFSTreasuryRel/VIP’
                                          iv_suppress_creation = abap_true ).
    CATCH CX_ROOT.
  endtry.

  if lv_string is initial.

    TRY.

*   Searchs for VIP flag in contact person – In case true, LV_STRING = “X”   
      lv_string = lo_bdc->get_entity_attribute_as_string( path = ‘//CURRENTCONTACT/BuilFSTreasuryRel/VIP’
                                          iv_suppress_creation = abap_true ).

      if lv_string = ‘X’.
*       Changes to “Y” to identify that the VIP is a contact person, not the main customer
        lv_string = ‘Y’.
      endif.
    ENDTRY.
  endif.

* Set the result
CALL METHOD me->set_fb_attr_by_id
    EXPORTING
      id    = ‘VIP’
      value = lv_string.
  DATA: fb TYPE REF TO cl_crm_smf_fact_base.

  fb = session->get_factbase( ).
  lv_fb = fb->get_factbase_as_string( ).

endmethod.

1.2. CONFIGURATION STEPS

• In IMG go to Customer Relationship Management->Interaction Center WebClient->Additional Functions->Intent-Driven Interactions->Service Manager->Define Services
• Create a new entry
/wp-content/uploads/2013/08/image014_260245.jpg

• Define the service as is displayed below. Assign the class that was created early.

/wp-content/uploads/2013/08/image015_260246.jpg

• In IMG go to Customer Relationship Management->Interaction Center WebClient->Additional Functions->Intent-Driven Interactions->Define Repository
• Select the context ICRULE the go to attributes

/wp-content/uploads/2013/08/image016_260247.jpg

• Create a new attribute. Use the service Z_BP_FLAG_VIP created early

/wp-content/uploads/2013/08/image017_260248.jpg

• Access CRM Web Client using role IC_MANAGER
• Go to Process Modeling->Alert

/wp-content/uploads/2013/08/image018_260249.jpg

• Create a new alert as is displayed  below

/wp-content/uploads/2013/08/image019_260250.jpg

• Go to Process Modeling->Rule Policy to create a new rule
/wp-content/uploads/2013/08/image020_260251.jpg

/wp-content/uploads/2013/08/image021_260252.jpg

/wp-content/uploads/2013/08/image022_260253.jpg
• Assign the business role and the IC event

/wp-content/uploads/2013/08/image023_260255.jpg

• Create the conditions clicking “Add Entry“.
/wp-content/uploads/2013/08/image024_260254.jpg

• Select Flag VIP condition

/wp-content/uploads/2013/08/image025_260256.jpg

• Create the action clicking “Add Entry“
/wp-content/uploads/2013/08/image026_260257.jpg

• Select the alert created early
/wp-content/uploads/2013/08/image027_260258.jpg
• Realease the rule and save

/wp-content/uploads/2013/08/image028_260259.jpg

Hope this helps!

Best regards,

Caíque

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo M. van Rijswijk
      M. van Rijswijk

      Thanks, help full document.

      But think is a mistake in the coding: you set attribute 'VIP'.

      CALL METHOD me->set_fb_attr_by_id

          EXPORTING

            id    = 'VIP'

            value = lv_string.

      In the attributes, you have defined: 'FLAG_VIP'. My believe is, that these should be the same.

      Regards,

      Martin

      Author's profile photo Caique Escaler
      Caique Escaler
      Blog Post Author

      Hey Martin, thank you for your comment!

      I appreciated that you have payed attention to this detail but, it's not necessary to do this to work. This document is a step by step guide and if you follow every step, for sure, it will works fine!

      With my best regards,

      Caíque

      Author's profile photo Nicolas Busson
      Nicolas Busson

      Hi Caique,

      Agree with Martin... I would find it weird that you can set any ID you want in the factbase and the system would somehow "magically" know to which attribute it should be mapped. So I beleive this example will work because actually you don't need any class to make it work : when you define your attribute FLAG_VIP in IC_RULE context, you set a Bpath expression that points to the VIP flag you're looking for.

      : )

      Did you try to remove this line and test your example once again?

      Cheers,

      Nicolas.

      Author's profile photo Former Member
      Former Member

      Nice Explanation Caique.

      It is definitely very helpful.

      As I currently do not have access to SAP CRM System, I could not get into details to provide you my suggestions.

      Do you have any idea if we can get a sandbox system of SAP CRM so that we can actually test it.?