Boosting the Sales Order Management Process with an Automation

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Explain how bots are executed
  • Review the Automation Editor
  • Prepare the Excel file with sales order details
  • Create and edit the automation
  • Map the right order using a loop with conditions
  • Finalize, test, simplify, release, and deploy the automation

Introduction: Boosting Business Processes with Automation

Why use automations? Automations can speed up your process and reduce potential errors related to manually transferring data.

Now that you have mastered the basics of setting up your process, it’s time to simplify your trigger form by reducing the number of input fields.

You will use robotic process automation (RPA) to extract data from an excel file that contains the details of the sales order.

You’ll then learn how to map the inputs and outputs of the different artifacts according to the changes of the process. Lastly, you’ll use the Desktop Agent to run your process.

Note
The Desktop Agent does not work on a Mac device. You will need to use a Windows machine to complete this part of the lesson, or a Mac running a virtual desktop with Windows. Refer to the prerequisites in Unit 1 for more information.

Task automation can run in two ways:

Unattended mode
Bots are working autonomously with human supervision only – there is no human intervention in the part of the process RPA is running.
Attended mode
The attended mode, in which bots will work with humans to assist them, to help the bot.

Automation Editor

The Automation Editor of SAP Build Pro is composed of four main parts:

  • The Toolbar
  • The Workflow
  • The Right-Side Panel
  • The Console

Select each marker to learn more.

Prepare the Excel File with Sales Order Details

Business Scenario

SAP Build Process Automation has native integration to several Microsoft Office products including Outlook and Excel SDK. In this exercise, you will learn how to use Excel files in your automations.

To design your automation, you will need an Excel file filled with the sales orders data. You have the possibility to create it by yourself using the sample below.

Note

In this exercise, you will create an Excel file containing Sales Order data. You can either create it manually (see task 1) or download the prepared file (see task 2).

Task 1: Alternative 1: Prepare the Excel File With Sales Order Details

Steps

  1. Create an Excel file.

    Use the following cell formats:

    ColumnFormat
    Order NumberText
    Order AmountNumber
    Order DateDate
    Shipping CountryText
    Expected Delivery DateDate
    Order StatusText
    Note
    Ensure that you use the correct format of the cells in the columns, listed above!

    1. Open MS Excel.

    2. Create an excel file with the columns you find in the table above.

    3. Save the file under a name of your wish.

  2. Add data to the columns.

    Use the following data:

    Order NumberOrder AmountOrder DateShipping CountryExpected Delivery DateOrder Status
    PO7991410418.221/21/2022United States of America1/29/2022In Time
    PO7918150935.131/22/2022United Kingdom1/27/2022Urgent
    PO7375313977.821/23/2022United Kingdom2/20/2022In Time
    PO7311755055.41/24/2022United Kingdom3/30/2022In Time
    PO6858429358.41/25/2022United Kingdom2/20/2022In Time
    PO636843739.821/26/2022United Kingdom3/25/2022In Time
    PO6189483574.121/27/2022Germany2/5/2022In Time
    PO3115273993.561/28/2022Germany3/10/2022In Time
    PO2686220887.561/29/2022Germany3/5/2022In Time
    PO8282436955.641/30/2022United States of America3/30/2022In Time

    1. If not done, open the file.

    2. Enter the data from the table above.

    3. Save the file.

Task 2: Alternative 2: Download the File

Steps

  1. Download the file.

    1. Choose the following URL: https://education.hana.ondemand.com/education/pub/mmcp/group/GR_1C5B25FF9CC48BA3/25341A492A1A669A.xlsx?download=1

    2. The file will download to your PC.

Create and Edit the Automation

Business Scenario

Now that your excel file is ready, let’s create the automation. For that you will open the process in Process Builder and add a new automation between the Trigger Form and the Approval Form. You will create the automation and edit the automation details and map the Excel file variables with the sales order data. Then you will use a loop to confirm that the result of the inputs look correct.

To learn more about how to create and edit the automation, follow this interactive tutorial.

Task Flow

In the task of this exercise, you will perform the following steps:

  1. Add a New Automation to the process.
  2. Set the Environment Variables of the project.
  3. Add Excel activities.
  4. Perform Excel Data Mapping.
  5. Close the Excel instance.
  6. Add input and output parameters.
  7. Create a variable.

Exercise Options

To carry out this exercise, you can choose from the following options:

  1. Live Environment: Using the instructions provided below, you can perform the steps in your SAP BTP account.
  2. Platform Simulation: Follow the step-by-step instructions within the simulation.
  3. Side-by-side: Follow the step-by-step instructions within the simulation and perform the steps in your SAP BTP account simultaneously.
Note
We strongly recommend to perform the steps in the live environment.

Task 1: Create and Edit the Automation

Steps

  1. Add a new Automation to the process.

    Use the following data:

    FieldValue
    Agent Version3.11.
    NameGet Order Details
    DescriptionAutomation for Order Process

    1. Choose Sales Orders Management.

    2. Choose Order Processing.

    3. Choose Add.

    4. Choose AutomatioNew Automation.

      4

    5. To select an Agent Version, open the list.

    6. Select 3.11.

    7. Choose Confirm.

    8. In the Name field, enter Get Order Details.

    9. In the Description field, enter Automation for Order Process.

    10. Choose Create.

    11. An automation Get Order Details is created:

  2. Set the Environment Variables of the project.

    Use the following data:

    FieldData
    IdentifierOrderFilePath
    TypeString

    1. Choose Settings.

    2. Choose Environment Variables.

    3. Choose Create.

    4. In the Identifier field, enter OrderFilePath.

    5. As Type, select String.

    6. Choose Create.

    7. Choose Close.

  3. Add Excel activities.

    1. Choose More.

    2. Choose Open Editor.

      Since Excel is used in this automation, you have to open an Excel instance. Open Excel Instance is a mandatory activity to use when using Excel. Once you open an Excel instance, you can use other Excel activities.

    3. In the Search field, enter Open Excel.

    4. Drag an Open Excel Instance.

    5. Drop it on the Canvas.

      Next, Excel Data Mapping is done with the Excel Cloud Link activity. Excel Data Mapping allows you to transform columns-based data from an Excel sheet into data that can be used in the automation. The data from the Excel sheet stays the same but the structure becomes a data type structure, making it possible to use throughout the project.

  4. Perform Excel Data Mapping.

    Use the following data:

    FieldValue
    NameSales Order
    NameOrders

    1. Choose the Clear icon to remove the existing value.

    2. In the Search field, enter excel cloud link.

    3. Drag Excel Cloud Link.

    4. Drop it on the Canvas.

    5. Choose Excel Cloud Link.

    6. Choose Edit Activity.

    7. Choose browse.

    8. Choose Downloads.

    9. Choose SalesOrdersDetails.

    10. Choose Open.

      The Excel file is mapped automatically.

    11. In the Workbook Path field, enter OrderFilePath.

    12. Choose From Excel data.

      You can now see a pop up to create a data type. A Sales Order variable is needed to collect the data from the Excel sheet columns. In this step, a variable is automatically created from the Excel file columns.

    13. In the Name field, enter Sales Order.

    14. Choose Create.

    15. Choose the Overview tab.

    16. The framework creates a data type with the columns of the Excel as the field names. You can see it in the Artifacts section in the Overview tab.

    17. Choose the Get Order Details tab.

    18. Choose the Clear icon to remove the existing value.

    19. In the Name field, enter Orders.

    20. Choose Close.

  5. Close the Excel instance.

    Once Excel is no longer required, close the Excel instance. Close Excel Instance activity closes an instance of Excel.

    1. Choose the Canvas.

    2. Choose the Clear icon to remove the existing value.

    3. In the Search field, enter close excel instance.

    4. Drag Close Excel Instance and drop it on the Canvas.

    5. Choose Save.

  6. Add input and output parameters.

    Use the following data:

    FieldValue
    Input parameter
    NameOrderNumber
    DescriptionReceives order number from the Order Processing Form
    TypeString
    Output parameter
    NameSelectedOrder
    DescriptionSelected order details are passed to the Process
    Data TypeSales Order

    1. Choose the Canvas.

    2. Choose Input/Output.

    3. Choose Add new input parameter.

    4. In the Name field, enter OrderNumber.

    5. In the Description field, enter Receives order number from the Order Processing Form.

    6. In the Type field choose String.

    7. Choose Add new output parameter.

    8. In the Name field, enter SelectedOrder.

    9. In the Description field, enter Selected order details are passed to the Process.

    10. if required, in the Type field, choose the Clear icon to remove the existing value.

    11. In the Data Type field, enter Sales Order.

  7. Create a variable.

    1. Choose Tools.

    2. Choose the Clear icon to remove the existing value.

    3. In the Search field, enter sales order.

    4. Drag Sales Order.

    5. Drop it on the Canvas.

      You can now see that a variable of the data type Sales Order is created.

    6. Choose Create Sales Order variable.

    7. Choose the Clear icon to remove the existing value.

    8. In the Output Parameters field, enter selectedOrderDetails.

    9. Choose Save.

Result

You have successfully created and edited the automation.

This concludes the interactive tutorial.

Map the Order using a Loop with Conditions

Business Scenario

Excel Data Mapping allows you to transform column-based data from an Excel sheet into datatype that can be used in your automation. The data from the Excel sheet stays the same but the structure becomes a data type structure, making it possible to use throughout your project.

To check if you have correctly mapped the sales order data, you need to loop through the orders and check if you can find yours using the condition, and see if the order number that you received from the trigger is equal to the currentMember of the authors.

Task Flow

In the task of this exercise, you will perform the following steps:

  1. Add a New Automation to the process.
  2. Add a control activity.
  3. Set the variable.
  4. Stop the loop.

Exercise Options

To carry out this exercise, you can choose from the following options:

  1. Live Environment: Using the instructions provided below, you can perform the steps in your SAP BTP account.
  2. Platform Simulation: Follow the step-by-step instructions within the simulation.
  3. Side-by-side: Follow the step-by-step instructions within the simulation and perform the steps in your SAP BTP account simultaneously.
Note
We strongly recommend to perform the steps in the live environment.

Mapping the right order using a loop with conditions

Task 1: Map the Order Using a Loop With Conditions

Steps

  1. Add a New Automation to the process.

    1. Choose canvas.

    2. In the Search field, enter For each and choose Enter.

    1. Drag For Each and Drop on canvas.

    2. Choose For Each.

    3. In the Set looping list field, enterOrders and choose Enter.

  2. Add a control activity.

    To match the desired order, a control activity has to be added to search for a match to its order number. The Condition activity is the activity that you will add. In this condition, you will check if the order number entered in the Form is available in data read from Excel in Step 2.

    1. Choose canvas.

    2. In the Search field, enter Condition and choose Enter.

    3. Drag Condition and Drop on canvas.

    4. Choose More options.

    5. Select Edit Formula.

    6. In the Expression field, enter Step0.OrderNumber === Step5.currentMember.orderNumber.

    7. Choose Save Expression.

  3. Set the variable.

    If the order number is found in Excel, i.e. the condition is True, set the variable using Set Variable Value activity that is a Data Management Activity.

    1. Choose canvas.

    2. In the Search field, enter Set variable value and choose Enter.

    3. To display Set Variable Value, select the scroll bar to scroll down.

    4. Drag Set Variable Value and Drop on canvas .

    5. Choose Set Variable Value.

    6. In the variable field, enter SelectedOrderDetails and choose Enter.

    7. In the value field, enter currentMember and choose Enter.

  4. Stop the loop.

    Once the order number is found in the Excel, use the control End Loop to stop the loop.

    1. Choose canvas.

    2. In the Search field, enter loop end and choose Enter.

    3. Drag Loop End and Drop on canvas .

    4. Choose the Clear button to remove the existing value.

    5. In the Search field, enter log message and choose Enter.

    6. Drag Log Message and Drop on canvas.

    7. Choose Log Message.

    8. In the message field, enter SelectedOrderDetails and choose Enter.

      Note

      You have successfully mapped the order using a loop with conditions.

Finalize, Test, and Simplify the Automation

Business Scenario

At the end of your automation creation process, there are some last steps to fulfill. First, you have to create output parameters and connect them with the endpoint of the automation. If everything has been set up, you can run a test. After successful testing, to simplify the start form, you can delete all redundant information. Release your process project that finally can be deployed.

Exercise Options

To carry out this exercise, you can choose from the following options:

  1. Live Environment – by using the instructions provided below, you can perform the steps in your SAP BTP account.
  2. Platform Simulation – follow the step-by-step instructions within the simulation.
  3. Side-by-side: Follow the step-by-step instructions within the simulation and perform the steps in your SAP BTP account simultaneously.
Note
We strongly recommend to perform the steps in the live environment.

Task 1: Link Automation Parameters With Business Process

Apart from creating an output parameter, it is mandatory to pass the data through the End step to expose the data outside the automation.

Steps

  1. Create output parameters.

    1. Choose End.

    2. In the SelectedOrder field, enter selectedOrderDetails.

    3. Choose Save.

      You can now see the complete Get Order Details automation.

      Make sure to add the steps Condition, Set variable value, End Loop inside the For Each block.

  2. Map the Automation Parameters with Form Parameters.

    1. Choose Order Processing.

    2. Choose Get Order Details.

    3. Choose OrderNumber.

    4. Choose Order Number.

    5. Choose Save.

Task 2: Test the Automation

Steps

  1. Test the automation.

    Use the following data:

    FieldValue
    OrderNumberPO7991
    OrderFilePathW:\SalesOrdersDetails.xlsx

    1. Choose the Get Order Details tab.

    2. Choose Test.

    3. In the OrderNumber field, enter PO7991.

    4. In the OrderFilePath field, enter W:\SalesOrdersDetails.xlsx.

    5. Choose Test.

    6. You can now see the test results:

      • Automation opens the SalesOrderDetails Excel.
      • Reads the Excel content.
      • Closes the Excel.
      • Loops through Excel and verifies if the entered OrderNumber is available in the Excel. If the OrderNumber is available in the Excel, it sets the Orders Details.
      • Ends the looping.
  2. Check the selected order details.

    1. Choose Open the console.

    2. You can now see the selected order details.

Task 3: Simplify the Start Form

Steps

  1. Simplify the Start Form.

    After the design of the automation that retrieves the data form the Excel file, simplify the start form by deleting the not needed fields.

    1. Choose the Order Processing tab.

      Choose Order Processing.

    2. Choose Close the console.

    3. Choose More.

    4. Choose Open Editor.

    5. Choose More.

    6. Choose Order AmountDelete.

    7. Choose More.

    8. Choose Order DateDelete.

    9. Choose More.

    10. Choose Expected Delivery DateDelete.

    11. Choose More.

    12. Choose Shipping CountryDelete.

    13. Choose Save.

    14. On the tab, choose Close.

  2. Check mapping forms.

    The different forms of the process will need inputs mapping from the automation outputs.

    1. Choose the Order Processing tab.

      The different forms of the process will need inputs mapping from the automation outputs.

    2. Choose Approval Form.

      Choose Inputs.

    3. On the right side, choose Inputs.

    4. Choose Order Amount.

    5. Choose Order Amount.

    6. Choose Expected Delivery Date.

    7. From the Process Content window, choose Expected Delivery Date.

    8. Choose Zoom out.

    9. Choose Order Confirmation Form.

    10. From the right side panel, choose Inputs.

    11. Choose Order Amount.

    12. Choose Order Amount.

    13. Choose Expected Delivery Date.

    14. From the Process Content window, choose Expected Delivery Date.

    15. Choose Order Rejection Form.

    16. From the right side panel, choose Inputs.

    17. Choose Order Amount.

    18. From the Process Content window, choose Order Amount.

    19. Choose Expected Delivery Date.

    20. From the Process Content window, choose Expected Delivery Date.

    21. Choose Save.

Result

You have successfully finalized, tested, simplified, released, and deployed the automation.

This concludes the tutorial.

Log in to track your progress & complete quizzes