Skip to Content
Technical Articles
Author's profile photo Chaitanya Priya Puvvada

Upload files in SAP Process Automation

Hello Community,

With SAP Process Automation, you now have the availability to upload files in your forms.

The citizen developers can also restrict the number of files to be uploaded for each file input field.

Approver can download the form when he is approving the tasks in his Inbox.

Pre-requisites

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

1. Enable Document Management Service in SAP BTP account

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

Please find the video on setting up DMS.

 

 

Build a Form with File Upload

1. Create a Form and drag and drop the File Upload.

 

2. Create an approval Form and drag and drop the File Upload. Make it read-only since it is sent to the Approver for review.

3. Build your process as shown below and bind the parameters of the Input form with the file parameters of the Approval Form.

 

 

4. Save, Release, and Deploy the process

 Run the business process

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 in the Approval form which is available for download.

 

How to retrieve the attachments uploaded through Forms?

Refer to the blogpost for more details.

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

 

Assigned Tags

      34 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Keerthana Jayathran
      Keerthana Jayathran

      Hi Chaitanya Priya Puvvada ,

      Can we use S3 Bucket for the file upload in SPA.

      Regards,
      Keerthana

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Keerthana jayathran

      At the moment, We support CMIS-based repositories.

      Author's profile photo Parthibaraja Vijayan
      Parthibaraja Vijayan

      Hi Chaitanya Priya Puvvada,

      Is it possible to upload structure data via excel to S4 using SPA?

       

      Regards,

      Parthibaraja

      Author's profile photo Sadiq Manji
      Sadiq Manji

      Hi Chaitanya Priya Puvvada,

       

      Are there plans to enhance some of the Automation Activities, such as "Extract Data" which calls the Document Information Extraction service, to utilize these uploaded files easily?

       

      It doesn't seem very straightforward to download this file from the DMS from within an automation and then supply the local file to this activity. Following the DMS sample on the Bot Store doesn't seem very straightforward for a "citizen developer".

       

      Ideally other activities, like the Excel activities, would also be enhanced to leverage this DMS file.

       

      Best regards,

      Sadiq

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Sadiq Manji ,

      I understand your requirement. As of now, we don't have activities which support that feature. We will take this into consideration.

      Author's profile photo Nico Loeblich
      Nico Loeblich

      Dear Chaitanya Priya Puvvada,

      do you know some capabilites about uploading a document (content) to SAP SDM Service:

      (a) from Office Application(like Excel, Word)
      (b) from any Print-Service
      (c) from 3rd Party Scan Software
      (d) via Interface with encoded Data Stream Content

      Just Direct -> Without saving to local / network windows file explorer.

      Thanks
      Nico

      Author's profile photo Maximilian Hartig
      Maximilian Hartig

      Hi,

      I followed the tutorial and when I upload a document a new document is created in SAP Document Management Service, but unfortunately without content. If I use the samples and upload a document everything works fine: https://store.irpa.cfapps.eu10.hana.ondemand.com/#/package/29a922bb-6cdc-4d7f-82f1-66a73d749921

       

      Any idea what the issue could be?

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Can you check what is happening in the Developer console of the Browser when you are uploading the document using Process automation?

      Are you getting any errors?

      Author's profile photo Soumya Sharma
      Soumya Sharma

      Hello Chaitanya Priya,

      I have followed the same steps as you have mentioned to upload a document from the SAP Process(via Build). In my SAP Build, I can see the UI control of file upload.

      However, when I try to run the process, the file upload control does not load. I get the below error:

      Are there any more steps that I am missing here? Could you please let me know.

      Regards,

      Soumya

       

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Soumya Sharma

      Can you please check if the URL is changed in ur BTP destination? From the error,I notice that the URL is changed to a Dummy URL instead of a DMS repo URL.

      Author's profile photo Soumya Sharma
      Soumya Sharma

      Hello Chaitanya Priya,

      I have created the destination with the right DMS repo URL. However, when I try to access the destination(simply even viewing it in the BTP cockpit) after saving it, I see that the URL gets changed to : https://sap.com/DUMMY_URL.

      I am not really sure if this is expected but this is the current behavior that I am observing.

      Regards,

      Soumya

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Soumya Sharma

      This is a bug in BTP cockpit and the BTP cockpit team is working on that.Create Service instance manually till the issue is fixed..

      Author's profile photo Ahmed Ajlan
      Ahmed Ajlan

      Could we upload multiple files on SAP build process automation form?

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Ahmed Ajlan

      You can upload multiple files

      Author's profile photo Subodh Marathe
      Subodh Marathe

      HI  Chaitanya Priya Puvvada

      I have a requirement for uploading a flat file by users (From UI) & having an approval workflow and load into HANA Backend.

      Can SAP Process Automation be used to do the same? I understand HANA backend should be on BTP(cloud).

      Thanks & Regards

      Subodh

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Hi Subodh Marathe,

      do you have the same requirement then me?

      Just see the next comment here 🙂

      do you have DMS, Integration Option in place?

      would be interesting to exchange on a thing like that.

       

      best regards,

      Wolfgang

       

       

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Subodh Marathe, Wolfgang Fuchs 

      You can upload the files and have them in the Approval workflow but you cannot send the attachments to HANA Backend. The actions project doesn't support attachments.As an alternative you can use an automation to send your attachments to Backend.

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Hi Chaitanya Priya Puvvada ,

       

      thanks for clarification.

      But i didn't find any documentation on how to use preliminary uploaded files when starting an Process Automation Workflow with an API Trigger.

      I just want show the use case one more time:

      1. user is in S/4 Backend and uploads documents via API to DMS, Integration Option repository
      2. now he triggers a workflow from S/4 Backend ( also via API Trigger )
      3. For the Approval task we would like to use the documents the user uploaded in step 1.

       

      I think this is a valid use case that is necessary for many SAP On-Prem Users.

       

      To clarify one more time:

      API%20Trigger

      API Trigger

      1. Calling the API Trigger is straight forward. We have S/4 Hana Release 2020 FPS02 in place. works smooth.
      2. I want to have the Approval Task to already have documents attached. The documents that i uploaded before triggering the API and i use the file path in payload.

       

      1. My requirement is to already have files included here. And i didn't know how this was possible

       

      In general i have already solved this issue, but i just wanted to point out, that it is missing in documentation. For me it was hard to get there.

      I will share the experience on this use case soon.

       

      best regards,

      Wolfgang

      Author's profile photo Kimberly Wyss
      Kimberly Wyss

      Hi Wolfgang,

      Could you elaborate on how you achieved this exactly?

      Would be highly appreciated!

      Best,

      Kimberly

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Hi Kimberly,

      i entered a blog post on this topic which is under review now.

      can you see it, as you are from SAP?

      Use uploaded documents in Process Automation API Trigger | SAP Blogs

       

      Otherwise, i try to tell you in a differnt way 🙂

       

      best regards ,Wolfgang

      Author's profile photo Kimberly Wyss
      Kimberly Wyss

      Hi Wolfgang,

      Unfortunately I do not have access to the blogs that are under review 🙁

      Very curious on how you went on to solve this.

      Best,

      Kimberly

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Good News Kimberly, now its possible 🙂

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Hi Chaitanya Priya Puvvada ,

       

      is it possible to upload files to dms and use them inside API-Trigger?

      That means, that i would like to have files included in the workflow already in the first form.

      Use Case:

      Start Workflow ( SBPA ) from SAP Backend ( S/4 HANA ).
      Step 1: Upload files to DMS, Integration Option
      Step 2: Trigger API to start an Approval Workflow.
      Step 3: Approval Person checks infos and uploaded documents, approves or reject WF.

      Best regards,

      Wolfgang

       

      Author's profile photo Wolfgang Fuchs
      Wolfgang Fuchs

      Chaitanya Priya Puvvada Just wanted to let you know what i was talking about, since this simple solution has cost me a lot of energy and desperation --> Use uploaded documents in Process Automation API Trigger | SAP Blogs

      I think that's even a feature which extends use cases available for SBPA 🙂

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Wolfgang Fuchs :

      We released the blog post, Store sample, and the Discovery Center mission on this use case in the month of May for a similar scenario. Please refer to the blog post for more details. You can refer to the SBPA learning content monthly release for more updates.

      The feature request is already in the pipeline.

      Author's profile photo Sadiq Manji
      Sadiq Manji

      Hi Chaitanya Priya Puvvada

      Will this  feature request include a DMS SDK or something to make these steps simpler in the automation side? The sample provided in the store is nice but may still be a bit much for Citizen Developers to follow...

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      To simplify it for Citizen Developers, we have a future roadmap to release the activities to retrieve the attachments instead of writing the custom code.

      Author's profile photo Mohini Verma
      Mohini Verma

      Hi Priya,

      Thanks for the detailed blog, we are facing one issue with this functionality -

      Uploading a file using a DMS destination only works if we give the repoID in the URL. It automatically creates a folder inside that repo when the file is uploaded which is a dynamic folder every time. Now, if we want to download the file from DMS for further tasks using automation in SPA, how will the file be downloaded since we need to give the folder name and file name to download a file?

      Somehow we should either be able to specify the folder name in the destination or have information returned when the file gets uploaded about the name of the folder.

      We need to implement this scenario for one of the projects and hence your support would be very helpful!

      Regards,

      Mohini

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hi Mohini Verma

      We have created a sample in the Store which is similar to your use case. Please refer to the same.

      Author's profile photo Santosh Chinni
      Santosh Chinni

      Hello Chaitanya, the Attachment UI element occupies full space in the approval form which is not acceptable as per our requirement. Is there any plan to show the Attachment option as an icon instead of UI element?

      Attachment%20UI%20Element

      Attachment UI Element

      Thanks,

      Santosh

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      As of now, we don't have any plans to modify this UI element.

      Author's profile photo Shubham Kumar
      Shubham Kumar

      Hi Chaitanya,

      Thanks for the detailed blog. I am facing one issue on document.

      When i am trying to upload a document from process automation its getting failed although it was working earlier.

      Although I have checked the destination too and i tried to upload the file individually to DMS (CMIS Repo) and its working fine.

      Can you please help me out with this issue.

      Please find the attached screenshot of error.


      Thanks in Advance.

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Shubham Kumar

      Please refer to these KBA 

      Author's profile photo Sandeep Verma
      Sandeep Verma

      Hello Chaitanya Priya Puvvada
      Thanks for the detailed blog.

      I did try to put "Upload doc" input field in SBPA approval form, but could find it in the drag and drop features.

      Can you please help on this.

      Thanks