SAP Multichannel Foundation for Utilities and Public Sector: User Management Enhancement Explained
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):
- User request extension
- User activation, reset password, and change password extension
- 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.
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:
- Inherit the class CL_CRM_IU_UMC_URM_MODEL to your own Z-class
- Redefine the method DEFINE( ).
- 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.
- Save and Activate.
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.
- Provide a technical model name and version.
- Click on Create button.
- 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.
- Save. Click on Check Model button to check if the model is correct.
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.
- Provide Technical Service Name and Service Version.
- Click on Create button.
- Provide a description and Data Provider Class as /IWBEP/CL_MGW_URM_DATA. Click on Save.
- Click on Assign model to assign the model that was created in the registering model step.
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.
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:
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.
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:
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:
- Inherit the class CL_CRM_IU_UMC_URM_NOTIFICATION into your Z-class.
- Redefine the COMPOSE method.
- 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.
Hi Yevgen,
Crystal clear block ... keep it up ... it gives the better understanding on user self service .. (y) 🙂
Thanks Yevgen well written.
Hi Yevgen,
Just want to know that MCF-U is also applicable for Telecom or oil based company's ? Please Acknowledge.
Regards,
Narpreet Singh
Not applicable. Only Utilities and Public sector.
Yevgen
Hi Yevgen,
Is it possible to set it up without E-mail notification and commit the User account directly?
Regards
Mik Pedersen
Mik, everything is possible with custom code/badi. However, we thought email notification with email verification was additional security step.
Yevgen
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!
Arjun, what is your use case? Why do you want to create BP in the system via OData service without any user for this BP?
Yevgen
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!
Hi Arjun, let's continue this discussion in private mode on SCN, just follow me and we can exchange some private messages.
Yevgen
Thanks Yevgen for a very informative article. Got a question. Is it possible to set registration verification email to expire after 24 hours?
Yes, there is a report that can run in background, I think it is visible from NW GW customizing.
Yevgen
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
Hi Yevgen,
very helpful blog post.
Is it still valid for MCF SP6? Is the Service still not usable in SEGW and will this be changed in the future?
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
Hi Yevgen,
Â
I have read your both the MCFU blogs and really very helpful.
I am working on MCFU implementation for one of the IS-Utility client. We have done the installation and configuration for the same.
We are facing issue in login. We are able to get register the use and activate user via link. After clicking on activation link we getting the activation message for user. But after activation when we try to login user we are getting error message "Check Client, user id or password is not matching". and not able to login.
Could you please provide any suggestion on this ?
Â
Regards,
Parixit Patel.
Hi Patrixit, sounds like a configuration issue, I would recheck settings as per admin guide. If it doesn't help, create a customer ticket for MCF component.
Best Regards, Yevgen