SAP Build Build Process Automation 4 – How to Create a Sales Order Process Using SAP Build Process Automation

7 months ago 34

How to create sales order process using SAP Build Process Automation

SAP Build Process Automation is an SAP BTP service that allows service that allows you to create, run, automate, and monitor your business processes on one interface using low-code/no-code capabilities. After subscribing to SAP Build Process Automation, you can create and manage projects in the Lobby. This lobby includes projects that you have created, those shared with you, or that you have imported from external sources or the store.

BUSINESS USE CASE:
During this hands-on tutorial, you will see how the Sales Order Approval process can be built using forms where a sales order is a document which confirms a sale that is generated by the seller after receiving a purchase order from the buyer. These sale order requests have to be reviewed and approved by the supplier to ensure that the sales orders are delivered on time. Once approved or rejected, the requester will be notified.

Before we proceed with our tutorial, we would like to give you an opportunity to join our ZAPYard’s learning community where we have more than 32 groups and more than 1000 real SAP Consultants interacting with each other daily. Only SAP topics and not BS. Else, they will be banned from the community without warning. 👇👇👇👇

If you want to be part of ZAPYard’s Discussion Community, please feel free to check the below Link. We Ask, Answer, Help and Learn Together. There are more than 32 groups from different topics like RAP, BPT, Fiori, iRPA, CAI, CPI, PI/PO, ABAP on HANA, SAPUI5, SAP Build, SAP Adobe Forms, ChatBots, SAC etc. Join any group of your interest and interact with our Community.

Join ZAPYard’s WhatsApp Community

STEP 1- Create a Business Process Project

In the Lobby, choose Create.

Select Build an Automated Process.

Select Business Process

In the Create a Business Process project dialog box, do the following:

  • Enter a Project Name that starts with Sales Orders Management.
  • Enter a Short Description: Sales Orders Management Project.
  • Choose Create.

STEP 2 – Create a Business Process

Once you have successfully created a Business Process Project, you will create a Business Process to automate the Sales Order Approval Process.

  1. A new tabs opens with the newly created project.
  2. In the Create Process dialog box, provide the following:
  • Enter a Name: Order Processing
  • Enter a Description for your process: A process to handle sales orders
  • Choose Create

You are navigated to the Process Builder canvas.

This is a visual canvas on which you map out your business process from start to finish.

STEP 3 – Create a Data Type

A data type is an artifact describing a data structure that can be used as an input and/or an output parameter in automations or processes.

There are two options to create a data type: imporing excel sheet and defining fields manually.

Importing Excel

In this option, you will be importing an excel file to create the data type. Based on the values present in the excel, the type of field is determined automatically and the fields are created accordingly. For example, orderAmount is maintained as 19000, hence the type of the field orderAmount is determined as Number.

1. Download this excel file for Sales Order datatype.

2. Navigate to your project. Click on the Project Content icon on the top left corner > + > Create > Data Type .

3. Name the data type Sales Order.

4. Click on Import Excel File.

5. Click on Browse to select the excel file.

6. Select Import an Excel File.

Your final data type looks as below.

Click Save to save the data type.

STEP 4 – Create and Configure API Trigger

The process trigger can be performed either via a Form or API application. In this tutorial we will configure API trigger.

  1. Back on your Order Processing process page, in the process builder canvas, click on Add a Trigger.

2. Choose Call an API.

3. Enter the name as Sales Order Trigger. The identifier is generated based on the name.

4. Open the Process Details side panel.

5. Choose Variables. Then choose Configure to configure inputs.

6. In the Configure Process Inputs window, choose Add Input to add parameters.

Add the following parameter:

Note: Type is a dropdown field which contains “Sales Order” as datatype.

7. Check the Required box.

8. Apply changes.

9. Save the project.

10. The inputs are now displayed in the process details side panel.

11. These input fields will be mapped to fields in SAP Build Apps.

12. Select the Sales Order Trigger to view the outputs.

13. The API trigger outputs are synchronized from the process inputs.

STEP 5 – Create and Configure Approval Form

Approvals are an important part of business processes, whether performed manually or automatically approved based on process conditions. In the Sales Order Approval Process, Supplier needs to review and approve the Sales Order requests.

With SAP Build Process Automation, you can manage approvals by creating and adding an approval form to a business process. Hence, you would create an Approval form for the Supplier where he/she can Accept/Reject the Sales Order request.

You can create interactive forms in SAP Build Process Automation. Forms can be used:

  • as a start trigger for a process.
  • as Approval Forms.
  • as additional steps added in the same process.

Navigate back to the Process Builder canvas to create an Approval Form.

1. Go to the Order Processing process and choose + below the Trigger.

2. Choose Approval.

3. Choose Blank Approval.

4. In the Create Approval dialog box, do the following:

  • In the Name field enter: Approval Form
  • In the Description field enter: Form to approve or reject the sales order
  • Choose Create

5. Click on Open Editor to edit the form.

6. Design the form by dragging and dropping the corresponding form elements as shown below.

7. Save the form.

8. Back within the process, click on the Approval Form and configure the Subject and Recipients.

In the Subject section:

  • Enter Please review
  • Select Material from the sales order details

In the Recipients section, enter your login ID (the email you used to sign into the SAP Build lobby).

Don’t copy and paste the email ID. Enter the email ID manually.

Configure the inputs of the Approval Form. Navigate to Inputs and map the fields accordingly.

Choose Save.

STEP 6 – Create and Configure Order Approval Notification Form

In this step, you will create and design a form which will be sent as notification to the seller if the Sales order is approved. Upon the execution of the process, this notification form will be available in the SAP Build Lobby Inbox which will be covered in the later part of the exercise.

  1. To add a confirmation to the process, select below the Approve option.

2. Choose Form.

3. Choose Blank Form.

4. In the Create Form dialog box, do the following:

  • In the Name field, enter Order Confirmation Form
  • In the Description field, enter Notification form to inform whether the sales order is approved by the supplier
  • Choose Create

5. Click on Open Editor to edit the form.

6. Design the form by dragging and dropping the corresponding Form elements as shown below.

7. Save the form.

8. Back in the process, click on the Order Confirmation Form and configure the Subject and Recipients.

In the Subject section:

  • Enter Your order
  • Select Material from the sales order details
  • Enter has been approved

In the Recipients section, enter your login ID (email).

In this tutorial, to complete the process, you will play the dual role of Supplier and Seller. Hence, you would map your email ID in the Notification Form as well.

9. Configure the inputs of Order Confirmation Form. Navigate to Inputs and map the fields accordingly.

Choose Save.

STEP 7 – Create and Configure Order Rejection Notification Through an Email

Notifications can be sent via an Email or to the SAP Build Inbox of the Seller. Before adding mail notifications to a process, you must first configure your SMTP mail destinations for SAP Build Process Automation.

How to configure SMTP mail destinations?

  • From SAP Build, click Settings.
  • Click Backend Configuration and select Mail Server.
  • Click Open in BTP Cockpit. The SAP BTP Manage Destinations area loads.
  • Click New Destination and enter the following data and properties, depending on your mail provider and authentication method.
  • Click New Property to add each of the following additional properties.

To test the configuration, click Send Test Mail and specify the recipients email.

To configure a GMAIL SMTP mail destination follow this link.

In this step, you will send out an email notification to the Seller if the Sales order is rejected. You need to configure the mail server to use the Mail Artifact.

To add an email notification to the process, select + below the Reject option.

Choose Email.

Once you have successfully added Mail, you will configure Mail Header and Mail Body.

In the To section, enter your personal or work email address – NOT the email of the user you used to sign into the lobby.

Our SAP Build Process Automation is connected to a SMTP (i.e., mail) server and this process will send out a real email, so you want to enter an email address that you can check – NOT the email of the user you used to sign into the lobby.

In the Subject section, enter Order Rejection Notification.

Click on Open Mail Body Editor.

Enter Your order

Select material from the salesorderDetails

Enter has been rejected

Click on Apply

Click on Save.

STEP 8 – Create and Configure Process Condition

Once the process with forms is designed, define which process flow should run based on if/else condition criteria. During the Sales Order Approval process, the Sales order can be approved automatically based on certain condition. In this step, you will add a condition where the Sales order goes for Supplier approval if the Order amount is greater than 100000 else the Sales order is approved automatically.

1. To add a condition to a process open the Process Builder. Choose + below the Trigger.

2. Choose Controls and Events.

3. Choose Condition.

4. To configure the condition, choose Open Condition Editor.

Process content will contain a list of attributes that have been defined in previous skills. For example: in the screenshot, you can see attributes from the API trigger. You will use this process content to configure different skills during business process modelling.

5. Edit your branch condition:

  • Set orderAmount from the process content
  • Select is greater than
  • Enter 100000 as the value
  • Choose Apply

You have configured your if branch to: if Order Amount is greater than 100000.

6. Both If and Default link branches are connected to the Approval Form.

7. Choose Save.

With this process condition, only the sales order above a specific amount will be sent for approval and the rest will be auto-approved.

You have to add a notification form in the If connection to notify the requester of the auto-approval and terminate the process.

STEP 9 – Create and Configure Process Condition

In this step, you will create a notification form which would be received by supplier if the order is approved automatically without any approvals. With the Low-code capabilities, you need not to re-design the Form. Let’s explore the Duplicate feature in SAP Build Process Automation.

1. To add the new form, you will use the Duplicate feature. Select the Overview.

  • Find Order Confirmation Form under the Artifacts section and select three dots (…).
  • Choose Duplicate.

Copy functionality is used to copy the artifacts between two different projects.

2. In the Duplicate Artifact pop-up window, change the name to Auto Approval Notification and select Duplicate.

3. The form is automatically opened in the form builder. Change the Auto approval form in the form builder to reflect the data for auto approval use case.

Design the notification form, the same way as in the previous steps, to send another notification to the requester about auto-approval.

Modify the Layout fields:

4. Save your work.

5. Go back to the Process Builder and add the auto approval form, choose + below the Default branch.

6. Choose Form.

7. Choose Auto Approval Notification.

8. Configure the General section.

Under Subject:

  • Enter: Your order
  • Choose: material from salesorderdetails
  • Enter: has been approved automatically

Under Recipients, enter your login ID (email).

9. Configure the Inputs section.

Click on Save.

10. Below Auto Approval Notification, select +.

11. Choose Controls and Events.

12. Choose End.

STEP 10 – Save the Project

  1. Click on Save to save your work.

Once you have successfully completed the project, your final process looks as below.

STEP 11 – Release Business Process Project

To run the process you have to first release and then deploy the business process project.

1. In the Process Builder, to release a project, click Release button on the top-right corner of the screen and provide a description in the popup dialog.

Versions have x.y.z format where x is a major version number, y is minor and z is the patch number. Every time you release, a new version will be created. The version is incremented automatically based on how you want to store the changes in the repository like major or minor update or just as a patch.

If you are releasing for the first time, then the version will start with 1.0.0. Next time you release, the version numbers will be automatically updated.

2. Click Release.

STEP 12 – Deploy Released Project

1. Once the project is released successfully:

  • Click on Deploy option on the top-right corner of the screen
  • Choose the Public environment
  • Deploy the project

Since you have created an API trigger in your process, you can see Sales Order Trigger in the list of triggers.

2. Click Deploy

Deployment will take a couple of seconds/minutes depending upon how big your project is and how many different artifacts it has. Any errors during the deployment will be shown in the Design Console at the bottom of the screen.

Once the deployment is successful, you will see a changed status. You can also see all your deployed and/or released project versions from the project status list next to the project name.

STEP 13 – Deploy Released Project & Trigger the Process from POSTMAN

Once you have successfully deployed the business process with an API trigger, you can view the API trigger.

In the Lobby, under Control Tower, choose Environment.

1. Open the Public environment.

2. Under the Unattended Triggers, open the trigger View

Here you can view the API endpoint and the payload to make a POST call to trigger the process.

Here we will use POSTMAN to trigger the process.

Enter the URL and the Body in the POSTMAN with a POST method

But to call the API, you have to pass an authorization header. You have to use the OAuth 2.0 client credentials to generate a bearer token.

You can find the client ID, secret ID and Token URL from the Instances of the Process Automation

Go to the service keys

Click on View

Take the client ID, secret ID and the URL

Go to the POSTMAN

Select OAuth2.0 as authentication

Make sure the Token URL would be the url from the service key and at the end concatenate “/oauth/token”

https://d9ca81batrial.authentication.us10.hana.ondemand.com/oauth/token

Then click on the Get New Access Token button.

Click on Proceed

Click on Use Token

Click Send in the POSTMAN

The process will trigger

Go to the Lobby > My Inbox application

There will be a approval to the Supplier

If the supplier rejects the request, there will be an email sent to the buyer.

I hope this post has provided valuable information and insights to help you. Thank you for reading, and if you have any questions or thoughts, please don’t hesitate to share them in the comments below. Your feedback is always appreciated as we continue to strive to provide relevant and engaging content for our readers. 👍👍

One Click to ZAPYard’s All Social Media Handles

PLEASE SHARE YOUR COMMENTS AND FEEDBACK

Please follow our LinkedIn PageLinkedIn Group , Facebook PageFacebook GroupTwitter , Instagram and Telegram SAP Technical Group Signal Group

Do not forget to SUBSCRIBE to our YouTube Channel for Free Courses and Unconventional Interesting Videos.

SAP Build Process Automation Series

Read Entire Article