Skip to Content
Technical Articles
Author's profile photo Anita Rynkanen

Automated Supplier Invoice Upload using SAP Build Process Automation

Introduction – Use Case

We are introducing a simpler and faster way to enhance business efficiency and agility with confidence using SAP Build Process Automation. The SAP Build Process Automation gives an opportunity to develop a solution to automatically fetch supplier invoices from five Microsoft 365 email accounts, push them to SAP Business ByDesign and scan for verification and validation. This solution helps to manage labor-intensive, error-prone manual processing of invoices from suppliers.


Monitoring five email accounts and downloading a large number of attachments manually from emails and saving them on the computer as well as entering suppliers’ invoices into SAP Business ByDesign one by one is a tedious task. The current process is wasting resources while keeping manual processes alive. Additionally, there is a high probability of committing mistakes, while performing repetitive tasks.

In this blog, we are describing a few important aspects that we learned while developing a solution to automate supplier invoice processing with SAP Build Process Automation and setting up a Desktop Agent to run the automation in unattended mode.


Solution Diagram

The following setup was crucial for this automation to work:

  1. Enabling the invoice scanning in SAP ByDesign project scope
  2. Enabling external authentication for accessing multiple Microsoft 365 email accounts
  3. Creating a service Agent in SAP Business ByDesign

As a first step, we enabled integration with SAP Build Process Automation in the Business Configuration and Implementation Project questions.

We also enabled supplier invoices via PDF scanning. However, we didn’t select the automated invoice creation as we wanted the user to review scanned files before creating an invoice.

To use Microsoft 365 Cloud SDK in our automation and create external authentication for the Desktop Agent to access emails, we first configured an Azure application. In the Azure Active Directory, we created an application registration. We ensured the following:

  1. Under Certificates & Secrets, we created a new client secret.
  2. Under API Permissions, we added ‘Mail: Mail.ReadWrite’ as a delegated permission and application permission.
  3. Under Authentication, we added the following URL as a redirect URI:
  4. Under App roles, we created a default app role with a value ‘Agent’.
  5. Finally, we checked that in the admin section of My apps, in the email apps management, ‘Authenticated SMTP’ was selected.

We created new authentications separately for five email accounts in the Control Tower in SAP BPA using relevant IDs (Client ID, Client Secret, Tenant ID) when configuring the Azure application. The following scope was selected for all authentications: User Read, Offline Access, Open ID, Mail Read/ Write, Mail Send, Files Read/ Write.

Once created, we registered each external authentication on the Desktop Agent. Under Settings/ External Authentication, we entered email addresses of each identity to authenticate and verified the identities with a password.

To use these external authentications in the automation, we added authentication name for each email account in a configuration excel file and used authentication name as part of the input parameter in the 365 online authentication step of the automation.

We discovered that a business user is needed for pushing the PDF attachment to SAP Business ByDesign and kicking off the content recognition, triggered by an API call. As this automation is running in unattended mode, we wanted to create logins that do not expire. Therefore, we created a new Service Agent in the Business Partner Data Work Center in ByDesign and requested a user.

Once saved, we created a new security policy for the newly created business user. In this security policy we left the password validity field blank.

Also, we made sure to give the new business user the appropriate access rights.


With the automated supplier invoice scanning process, we reduced the manual invoicing process and the risk of human errors associated with repetitive tasks.


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniel Wroblewski
      Daniel Wroblewski

      That's really cool!

      Can you share a little bit about the automation/process, including the flow as well as how it was triggered and by whom?



      Author's profile photo Anita Rynkanen
      Anita Rynkanen
      Blog Post Author

      Hi Daniel Wroblewski

      Please see the process flow for further information. We have set up a trigger for this automation so it's running in unattended mode once an hour 24/7. 

      Many thanks,