Skip to Content
Technical Articles
Author's profile photo Aditya Bajoria

MDG: CR URL Generation

Navigating to MDG CRs can be cumbersome at times. If users are on the Go and the CRs are awaiting their action, a direct CR link would help users. Although we can setup extended notifications will a link in the emails to navigate to NWBC Home Page(hard coded link) via variables.

 

Business Need:

  • Better User Experience.
  • Direct link of CR in Emails helps tracking efficient.

 

Use Cases:

  • Accessing CRs remotely on mobile device via emails.
  • Approval/Rejection of CRs on mobile/desktop.

 

Implementation:

This solution would be a 2 part development:

  1. Generate Direct CR URL via below Code:

  DATA:

    lv_url      TYPE string,

    lf_guid          TYPE sysuuid_c26,

    lt_para          TYPE tihttpnvp,

    lv_application_name TYPE string VALUE ‘USMD_CREQUEST_PROCESS’.

 

  APPEND INITIAL LINE TO lt_para

    ASSIGNING FIELD-SYMBOL(<fs_para>).

  <fs_para>-name = ‘CREQUEST’.

  <fs_para>-value = <Pass CR Number>.

 

  APPEND INITIAL LINE TO lt_para

    ASSIGNING <fs_para>.

  <fs_para>-name = ‘CREQUEST_WORKITEM’.

  <fs_para>-value = <Pass Current active Workitem ID>.

 

 

  APPEND INITIAL LINE TO lt_para

    ASSIGNING <fs_para>.

  <fs_para>-name = ‘SAP-CLIENT’.

  <fs_para>-value = sy-mandt.

 

* Generate URL for NWBC link of Direct CR

  cl_wd_utilities=>construct_wd_url(

    EXPORTING

      application_name = lv_application_name

      in_parameters    = lt_para

    IMPORTING

      out_absolute_url = lv_url ).

 

 

  1. Enhance User Decision to add Exit for email generation:
    1. Create custom class implementing interface IF_SWF_IFS_WORKITEM_EXIT.
    2. Implement method EVENT_RAISED
      1. If IM_EVENT_NAME = IF_SWF_IFS_WORKITEM_EXIT~C_EVTTYP_AFTER_CREATE.
        1. LWA_HEADER = IM_WORKITEM_CONTEXT->GET_HEADER( ).
        2. Select CR number from USMD2400 passing LWA_HEADER-WI_CHCKWI
        3. Use above code to generate URL.
        4. Create email content & recipients.
        5. Trigger email via CL_BCS.

 

This solution will increase user’s experience and turnaround time on all change request actions. We have seen a visible difference in user satisfaction.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nilesh Bundele
      Nilesh Bundele

      Very helpful. Thanks for sharing.

       

      Author's profile photo Beykan Gözümoğullari
      Beykan Gözümoğullari

      Thank you for sharing this blog but it didn't work on my side.

      When I open the CR via a link that generated the way you explain, the CR is not editable. A validation message appears and it mentioned that I'm not the processor of CR.

      On the other hand, if I open the same CR in my Change Request inbox, it is editable and looks normal.

      CR opened via link;

      CR opened via my change request inbox;

      Are you sure about using application no with the value USMD_CREQUEST_PROCESS’ as a parameter to the cl_wd_utilities=>construct_wd_url?

      Best regards,

      Beykan

      Author's profile photo Aditya Bajoria
      Aditya Bajoria
      Blog Post Author

      Looks like browser user session is creating issue, try to use the link a session where you have this ID logged in.

      Also, check the user for session in browser this link opened into.