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: 
NaotoSakai
Advisor
Advisor
0 Kudos
This blog is a continuation of the previous one.

Previously, we have completed publishing the Rest API. This time, we will make it available for use in SAP Build Process Automation.

Step4. Create Destination


Create a Destination to access the Rest API created in the previous Step 2.


In the snapshot above, the following is entered

Name=AutomaticNumberingAPI

URL=<Rest API endpoint>

ProxyType=Internet

Type=HTTP

tokenServiceURLType=Dedicated

Authentication=NoAuthentication

Description=Automatic Numbering API for SAP Build Process Automation


Additional Properties:

sap.processautomation.enabled=true

sap.applicationdevelopment.actions.enabled=true


Step 5. Activation of Destination


On the SAP Build lobby screen, select the Setting tab at the top, then select Destination in the menu on the left.


Click New Destination, select the AutomaticNumberingAPI created in step 4, and activate it.




Step6. Create Action




On the SAP Build lobby screen, select Actions from Build an Automated Process.

Select Upload API Specification and select the Open API Specification from the previous Step 3, which is a file.




Set the name of this Action.



On the Add Actions From Automatic Numbering API screen, check the /getnextvalue checkbox, which is the REST API to be used.


There is no need to change any settings on this screen, so let's test the API operation.


Click on Test.
Select the Destination created in Step 4 as the Destination.


Also, set the arguments required for execution, prefix, instanceid, and workflowuser, as appropriate.
Note: The prefix used here should not be the one used in production, as it will be recorded in the database.
After setting the arguments, click the Test button to execute.


If a number created from the prefix and year is returned in the response as a newnumber like this, it is working properly.
After confirming that the action is working properly, Release it and publish it in the "Publish to Library" section. You can now use this Action in other workflow projects.

Step 7. Try to incorporate Action into the workflow


Incorporate this Action into your workflow.


The argument Prefix cannot be freely entered, so use this blog to define a variable for Prefix using Decision.


Thus, after the application is submitted, the approval form uses the auto-numbering values created.



 







As explained in Part 1 of this blog, it is not possible to incorporate the numbering function prior to the trigger form. It is not possible to display the numbering on a new form from the beginning. The only time it is possible to do so is "after application", "after approval", and so on. In this case, the problem is that the applicant cannot know the number given to the form he/she applied for. Therefore, it would be necessary to send an e-mail to the applicant after the number is given, or some other additional process.




Also, in this description the numbers are stored in the SAP HANA Cloud database. You may need to manage the numbers; we have configured the HDI container to expose the tables as ODATA when it is created, so you can use SAP Build Apps to create a simple management app. Also, since the tables are published as ODATA, it would be easy to incorporate the data held in the number management system as part of the master data in other solutions.


 
In this way, SAP Build Process Automation can handle the automatic numbering of numbers in the format of your choice. We hope this will be helpful as it may be a surprisingly important requirement in replacing actual work.


1 Comment