Digital Manufacturing (DM) plays a pivotal role for various personas on the shopfloor. During the implementation phase, primary users typically include Power Users like Manufacturing Admins and Production Engineers. However, as we prepare for the go-live stage, onboarding Production Operators and Production Supervisors becomes crucial.
This onboarding process involves several essential steps: setting up system access, assigning appropriate authorizations, and ensuring organizational alignment with plants and work centers.
In my previous blog User Onboarding, I provided an overview of these steps. In this post, I'll share a sample application demonstrating how you can use Public APIs provided by Digital Manufacturing to automate user assignment to plants and work centers.
I am not a professional developer. I created this sample application for two purposes:
The result? A functional sample application, now available on GitHub https://github.com/SAP-samples/digital-manufacturing-extension-samples/tree/main/dm-sidebyside-exten... 😊.
Regarding AI support, I was amazed at how well it worked! However, some basic knowledge is necessary to ask the right questions and interpret responses accurately. And when things get tricky or errors arise, having a knowledgeable colleague like Vivekananda Panigrahy can make all the difference. Thanks a lot, Vivek!
As an administrator, I want to:
In this sample I have created two users which I use to define certain user groups which can than be used as template to create the actual users.
The difference between them lies in their assigned Work Centers and a dummy certification, which I have assigned using the user ID. This certification allows me to easily identify the relationship between the created users and the user group used for their creation.
Additionally, I created a UG_ALL user, which includes all user groups as supervised users. This makes it easy to retrieve all user groups defined in a plant.
To build the application I used the approach of a side-by-side extension using SAP UI5 and public User APIs provided by SAP DM https://api.sap.com/api/sapdme_user/resource/User
The application consists of three main steps.
You can browse for the CSV file containing the users and upload it.
I followed the implementation logic outlined in this blog https://community.sap.com/t5/technology-blogs-by-members/creation-of-dynamic-table-with-csv-xlsx-fil..., though I simplified it to focus on CSV format only.
The CSV file is very basic and only includes Email, First Name and Last Name.
A sample CSV file is provided with the sample code under the resources folder.
In this step, the user group that should serve as a template is retrieved and selected. First the user needs to to enter:
All the user groups assigned are listed and once one user group is selected from the result list the details of the user group is displayed to allow reviewing the details.
To retrieve the user groups, I call the Public API https://api.sap.com/api/sapdme_user/path/getSupervisorsUsingGET_1 with the user UG_ALL.
The API returns the list of supervised users, which in this setup represents the different user groups available within a plant. To display the details I call the Public API https://api.sap.com/api/sapdme_user/path/getUserUsingGET_1.
Once the user data has been uploaded and the template user group selected, the creation of new users—including certification and work center assignments—can be triggered.
For user creation, I call API https://api.sap.com/api/sapdme_user/path/createUserUsingPOST_1
Note: If a user already exists in DM, the creation process will fail due to an error. To handle this, you can modify the program logic to allow either creation or update based on user input.
For updating users, use: https://api.sap.com/api/sapdme_user/path/updateUserUsingPATCH_1.
Why did I assign a certification named after the user group to each user? This trick allows me to easily retrieve users assigned to specific groups using the User Certification Assignment Master Data Object and display it in a custom dashboard
Details on the MODs you can find on SAP HELP - https://help.sap.com/docs/sap-digital-manufacturing/insights/usercertification-mdo.
The sample code is published on GitHub SAP-samples/digital-manufacturing-extension-samples.
If you want to use it as a jump start make sure you read the Readme File to adapt the mandatory configurations.
To call a public API in your coding you first need to setup a destination in your subaccount pointing to the Public API. Details you can find on SAP HELP https://help.sap.com/docs/sap-digital-manufacturing/operations-guide/prepare-for-api-integration
In the xs-app.json file the configuration for your SAP Cloud Application Router, which helps route incoming requests within your app, is defined. Make sure it points to the destination you have defined.
Issue: Many modern browsers, including Google Chrome, have tightened restrictions on third-party cookies to improve privacy and security. This can impact authentication flows or application behavior that relies on cookies for session management Solution: Navigate to the SAP BTP Space where your application is deployed. Locate your environment configuration settings. Add or modify the variable: COOKIE_BACKWARD_COMPATIBILITY=true This instructs SAP BTP to maintain compatibility with older cookie behavior, helping resolve login and session issues.
For more details I suggest investigating on the internet as I am not the expert.
The current version of Digital Manufacturing and the available Public APIs for Users allows you to easily automate the organizational assignment of users to work centers.
This sample application on GitHub serves as a jump-start for creating custom-tailored solutions, whether for integration with third-party tools, adding approval workflows, or refining user assignment strategies.
If you try this approach, let me know your experiences!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |