Introduction

This is a second blog describing standard user management in SAP Multichannel Foundation for Utilities and Public sector. The enhancement options in user management OData services are explained here in details. If you need a higher level picture, please refer to the introduction blog on user management. This blog repeats information explained in the Administrator’s Guide for SAP Multichannel Foundation for Utilities and Public Sector. Please refer to it for more information.

The following enhancement areas will be explained (assuming SAP CRM is the leading system, the same changes can be executed on the SAP ERP side as well):

  1. User request extension
  2. User activation, reset password, and change password extension
  3. Email configuration

User Request Extension

In our standard OData models CRM_UTILITIES_UMC_URM and ERP_UTILITIES_UMC_URM, the UserRequest entity was extended with the following fields: Account ID, Business Agreement ID (Contract Account ID on ERP side), Date of Birth, Country ID, Region ID, City, Postal Code, Street, House Number and Room Number.

Custom fields can be added to the UserRequest entity in the OData models CRM_UTILITIES_UMC_URM and ERP_UTILITIES_UMC_URM. Custom fields are added to the metadata of the service after service regeneration. Then, the fields are provided as an input in the process of creating the User request, through the implementation of BAdI /IWBEP/BD_MGW_URM_VERIFICATION.

Steps for extending User Request

Step 1: Enhance the User request structure

User request structure /IWBEP/S_MGW_URM_USR_REQ_EXT can be enhanced and you can add your own fields.

/wp-content/uploads/2015/10/screen_807227.png

As illustrated in the screenshot above, currently only standard structure is included. You could append another extended structure with your own fields.

Step 2: Extend the UserRequest entity in the model

Remark: /IWBEP/USERREQUESTMANAGEMENT parent service that we inherited to CRM_UTILITIES_UMC_URM and ERP_UTILITIES_UMC_URM is not extendable via SEGW, which means that it can only be extended by using the old way of SAP Gateway service: via Customizing and by implementing necessary changes on MPC and DPC classes.

So, let’s extend CRM_UTILITIES_UMC_URM OData service. You need to run transaction SE24 in the SAP CRM system:

    1. Inherit the class CL_CRM_IU_UMC_URM_MODEL to your own Z-class
    2. Redefine the method DEFINE( ).
    3. Inside the method DEFINE( ), first call super->define( ) and then define your own fields for the entity UserRequest using the metadata APIs. See example code in the standard method below.
    4. Save and Activate.

/wp-content/uploads/2015/10/screen_807227.png

You need to map the property names in the service with the ABAP name for all fields, as illustrated above.

Step 3: Register the new model and service

On the SAP CRM system, the newly created model provider Z-class has to be maintained in the IMG node: SAP NetWeaver -> Gateway Service Enablement -> Backend OData Channel -> Service Development for Backend OData Channel -> Maintain Models.

  1. Provide a technical model name and version.
  2. Click on Create button.
  3. Provide the same model provider class that you just created and a relevant description. See the standard User Request Management Model on the screenshot below.
  4. Save. Click on Check Model button to check if the model is correct.

/wp-content/uploads/2015/10/screen_807227.png

Now the service has to be registered in the IMG under node: SAP NetWeaver -> Gateway Service Enablement -> Backend OData Channel -> Service Development for Backend OData Channel -> Maintain Services.

  1. Provide Technical Service Name and Service Version.
  2. Click on Create button.
  3. Provide a description and Data Provider Class as /IWBEP/CL_MGW_URM_DATA. Click on Save.
  4. Click on Assign model to assign the model that was created in the registering model step.

/wp-content/uploads/2015/10/screen_807227.png

Final step, you need to expose the service in SAP Gateway via transaction /IWFND/MAINT_SERVICES. Test it to see if you get a metadata of the service showing up.

If everything went well, all the extended fields are passed to the verification BAdI, which can be used to insert custom logic for user request validation. Further logic can be implemented in this BAdI through the IMG node (SAP NetWeaver -> Gateway Service Enablement -> Backend OData Channel -> User Management Setup -> Verify User Request).

User activation, reset password, and change password extension

The BAdI /IWBEP/BD_MGW_UM_USR_MANAGER is used during the processes of creating user, changing password, resetting password, unlocking user, updating user, etc. The implementation of the multichannel application re-uses the standard SAP Gateway class /IWBEP/CL_MGW_UM_USR_MGR_SUSR with redefined methods, i.e. CREATE_USER. For other user management functionalities such as change password, reset password etc., we are still using the methods provided by the standard SAP Gateway BAdI implementation. The reuse of the standard Gateway implementation happens in the class CL_MGW_UM_USR_MGR_SUSR_COPY. General path for user management enhancements:

IMG Path:  SPRO −> SAP Customizing Implementation Guide −> SAP NetWeaver −> Gateway Service Enablement −> Backend OData Channel −> User Self Service Setup −> Implement User Management.

Create and Activate New Online User for Existed Customer


When the user clicks on the activation link in the notification email, a new online account is created. The users with identical generated user IDs are created on SAP Gateway, CRM and ERP systems. Newly created users on SAP CRM and ERP systems will be associated to a certain business partner.

/wp-content/uploads/2015/10/screen_807227.png

The enhancement spot /IWBEP/ES_MGW_UM contains BAdI definition to manage the users. The BAdI /IWBEP/BD_MGW_UM_USR_MANAGER can be used to configure processes of user creation, password change, password reset, etc. Standard implementation at the end does the following:

/wp-content/uploads/2015/10/screen_807227.png

Reset/Change Password

There is no special logic in the method CHANGE_PASSWORD. The standard BAdI implementation for SAP Gateway is reused in the BAdI implementation for SAP Multichannel Foundation for Utilities and Public Sector. If the user is locked due to too many unsuccessful logon attempts, the user will be unlocked when the password is reset.


/wp-content/uploads/2015/10/screen_807227.png

Email Configuration

In the enhancement spot /IWBEP/ES_MGW_URM, the BAdI /IWBEP/BD_MGW_URM_NOTIFICATION is used to send emails to the user when a user is created or for reset password.

Enhancement Spot: /IWBEP/ES_MGW_URM

BAdI Definition: /IWBEP/BD_MGW_URM_NOTIFICATION

Enhancement Implementation: CRM_IU_UMC_URM

Implementation Class: CL_CRM_IU_UMC_URM_NOTIFICATION

Filter Value: 

SERVICE_DOCUMENT_NAME = CRM_UTILITIES_UMC_URM

SERVICE_DOCUMENT_NAMESPACE      = /SAP/

SERVICE_DOCUMENT_VERSION            = 0001

IMG Path:  SPRO −> SAP Customizing Implementation Guide −> SAP NetWeaver −> Gateway Service Enablement −> Backend OData Channel −> User Self Service Setup −> Define Notification Process for User Request Management:

/wp-content/uploads/2015/10/screen_807227.png

Steps to create Your Own BAdI Implementation

In case you want to use the standard notification agent to send email notifications but you want to customize the content or format:

  1. Inherit the class CL_CRM_IU_UMC_URM_NOTIFICATION into your Z-class.
  2. Redefine the COMPOSE method.
  3. Register the extended class as BAdI implementation in the IMG in the above mentioned enhancement spot.

Conclusion

This blog should be able to get you started when you come to the point of extension of standard user management. A lot of APIs and BAdIs are mentioned in this blog, so don’t forget to put external breakpoints to check when something is not working.

To report this post you need to login first.

16 Comments

You must be Logged on to comment or reply to a post.

    1. Yevgen Trukhin Post author

      Mik, everything is possible with custom code/badi. However, we thought email notification with email verification was additional security step.

      Yevgen

      (0) 
  1. Arjun gupta

    Hi Yevgen,

    Thank you for the detail blog. Now here is my requirement and I am not sure if this is possible using project- CRM_UTILITIES_UMC_URM. I would like to create BP, but I do not want to create  username/password as there is separate workflow for user registration once move in is successful. I know this BP creation is used for deregulated market, but can we use it for BP creation? Could you please help with some input on this.

    Thank you!

    Image.png

    (0) 
      1. Arjun gupta

        Hi Yevgen,

        Here is the use case.

        1. Allow a new customer to start a service with utility, i.e create a BP, Business agreement and move in

        2. Then if customer wish to register for online account, go for user creation.

        Hope this helps.

        Thank you in advance!

        (0) 
  2. Joseph Jomy

    Thanks Yevgen for a very informative article. Got a question. Is it possible to set registration verification email to expire after 24 hours?

    (0) 
  3. Narpreet Singh

    Hi Yevgen,

    Many Greetings!!

    Just want to know that is there any possibility whether we can get a demo MCFU system for practice like ides or we have to get proper license from SAP ?

    Please Acknowledge

    Regards,

    Narpreet Singh

    (0) 
    1. Yevgen Trukhin Post author

      Hi Mark, sorry I don’t get automatic email notifications somehow after transfer to new blog platform. Here is my answer. Yes, it is still valid for all MCF SPs (latest one SP09).
      Best Regards, Yevgen

      (0) 

Leave a Reply