Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
aviral_agarwal
Associate
Associate
Hello Community,

Co-authored with chaitanyapriya.puvvada.

In this blogpost , you will learn how to retrieve the files uploaded through the Forms of SAP Build Process Automation using the Automation artifact of  SAP Build Process Automation.

Pre-requisites


The UI element File Upload is visible in the Form, after completing the pre-requisites.

  1. Enable SAP Document Management Service (Integration option) in SAP BTP account. For more information, you can refer to this blogpost.

  2. Create a Destination for Document Manage Service in your BTP Cockpit. For more information, refer to the documentation.


Introduction


The files that are uploaded through the Forms  are stored in the SAP Document Management Repository. A unique folder ID is created in the SAP Document Management Repository for every file upload. These files can be accessed from SAP Document Management Service using APIs.

The APIs for SAP Document Management Service are available here.

Now, Let’s explore this functionality with a use case.

Use case


Automating paper-based invoice posting in SAP S/4HANA

Challenge


Processing of invoices is often still distributed across different people, tools and platforms. Since invoices are often received via PDFs or images, data needs to be extracted from those which is tedious work: a person needs to retrieve the data from the document and manually enter it into the target system. When it comes to processing many documents it becomes a huge challenge and requires a lot of time dedicated to this task. Also, manual matching is repetitive and error prone.


 

Solution


Here we have automated the process as follows:

  1. Invoice is uploaded through the Forms. The uploaded Invoice is stored in SAP Document Management Repository.

  2. A bot is triggered to retrieve the Invoice from SAP Document Management Repository and stored in the local system. Using SAP Document Information Extraction Service, the necessary data is extracted .

  3. An approval is triggered.

  4. Once Form is approved, Invoice is created and pushed to ERP system for further processing.


The following diagrams show the workflow of the use case.



Create the business process



  1. Create an Invoice Request Form and drag and drop the File Upload UI element to upload the Invoice document.





  1. Create a DMS Object data type as shown below.


The DMS object contains the structure of parameters same as those stored in SAP Document Management System.




  1. Create an Automation Get Folder Content to get folder content from SAP Document Management Service.


Note: A unique folder ID is created in the SAP Document Management Repository for every file upload. Hence this automation would retrieve the folder content.

The automation takes folder ID received from Invoice form and returns the folder content data as DMS object datatype.




  1. Create an another automation Download Document which would download the documents to the local system .


The automation takes folder content as input, downloads the invoice from SAP Document Management Repository to your local machine. The local machine system file path is provided by the user using filePath environment variable.





  1. Create an automation to extract the invoice data.


The automation takes the downloaded invoice path as input and returns the extracted invoice details as output.




  1. Create an automation Process Documents and include all three automations.


This automation contains all the previous three automations for processing the document.




  1. Create the Invoice Approval Form.





  1. Create the Invoice Confirmation and Rejection Notification Forms.


 





  1. Build your process as shown below and bind the parameters between the artifacts as shown below.





  1. Save, Release, and Deploy the process


Run the business process


When the process is run, the form provides folderID at the start of event and the automation provides the invoice details for further processing as shown below.


Once the Invoice is uploaded and submitted, it goes for approval.



You can find the Approval form with the uploaded invoice document as an attachment and the extracted invoice details in the Approval form.

If you want to know more about this use case, refer to the SAP Build Store Sample Content Invoice Processing with Document Management Service. To create a project by importing a template, refer this tutorial.

If you want to know more about extending your business process to post data to S/4HANA system, refer the SAP Discovery Center Mission.

 



How to view the files that are uploaded in SAP Build Process Automation?



  1. Repositories onboarded b using SAP Document Management Service integration option. cannot be viewed in the SAP Document Management Service application option web application. You need to develop the Reuse UI Fiori app .Please refer to the blogpost written by tapishnu.sengupta .


Once you have developed the Reuse UI Fiori app  , the files will be available as shown in the screen shot .


     2. The files that are uploaded through the Forms can be added as an attachment to the Approval Forms .Refer to the blogpost for more details.



For information related to issues with enabling SAP Document Management Service in SAP Build Process Automation tenant, please refer to the following Knowledge Base Articles:

For more information on SAP Process Automation, please refer to the following sources: