Supply Chain Management Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
KatjaHuschle
Product and Topic Expert
Product and Topic Expert
677

Introduction

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.

Background

I am not a professional developer. I created this sample application for two purposes:

  1. To provide an example implementation for automation.
  2. To challenge myself and learn how AI tools can support me along the way.

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!

User Story

As an administrator, I want to:

  • Easily assign multiple production operators to plants and work centers.
  • Define template users with predefined certifications and work centers that can be used to create production operators.
  • Import initial user data via a CSV file.

Sample Solution

Master Data - Template user

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.

  • UG_OP_PRODUCE
  • UG_OP_PACKING

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. 

KatjaHuschle_0-1747385272432.png

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.

KatjaHuschle_1-1747385272441.png 

Custom App

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.

  • Upload user data
  • Retrieve and select a user group
  • Creation of the user

Step 1: Upload user

You can browse for the CSV file containing the users and upload it.

KatjaHuschle_2-1747385272445.png

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.

KatjaHuschle_3-1747385272446.png

A sample CSV file is provided with the sample code under the resources folder.

KatjaHuschle_4-1747385272446.png

Step2: Retrieve and select the user group

In this step, the user group that should serve as a template is retrieved and selected. First the user needs to to enter:

  • The plant name.
  • The UG_ALL user (which contains all user groups).

 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.

KatjaHuschle_5-1747385272454.png

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.

Step 3: Create users

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.

KatjaHuschle_6-1747385272460.png

Reporting in DM – Embedded SAC

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.

KatjaHuschle_7-1747385272468.png

 

Sample code on GitHub

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.

1. Set Up a Destination in Your Subaccount

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

2. Configure the SAP Cloud Application Router (xs-app.json)

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.

KatjaHuschle_8-1747385272472.png

3. Adjust environment configuration settings in SAP BTP

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.

KatjaHuschle_9-1747385272478.png

For more details I suggest investigating on the internet as I am not the expert.

Conclusion

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!

5 Comments