Skip to Content

Create Tables in the Form

Validate the order details extracted from the automation and display the error details in a table in a form.
You will learn
  • How to create a Table in the Form.
  • How to use List in Decision.
  • How to bind List in Decision to Table in Form.
  • How to retrieve the sample project from the Store.
aviral-agarwal-sapAviral AgarwalMarch 19, 2024
Created by
aviral-agarwal-sap
March 21, 2023
Contributors
celineaudinsap
aviral-agarwal-sap

Prerequisites

In this tutorial, you will be creating a Decision to validate the Purchase Order Details extracted from excel. If the Purchase Order Details has errors, the errors will be displayed in a table in a form.

  • Step 1

    Once you have completed the prerequisite mission, your process should look something like below.

    Automation
    1. In the Order Processing process:

      • Choose + after the Get Order Details.
      Automation
      • Select Decision.
      Automation
      • Select Blank Decision.
      Automation
    2. A pop up will appear to configure the decision. Enter Order Validity Check as decision name and choose Create.

      Automation
  • Step 2
    1. Go to the Overview Tab. Choose the Create button. Create an artifact of the type Data Type.

      Automation
    2. A new pop-up will appear.

      • Enter Name of the data type: Error Output
      • Enter Description of your choice
      • Choose Create
      Automation
    3. In the Data Type Error Output add new fields as following.

      Field Name Type
      ErrorCode String
      ErrorDescription String
      Automation
      Automation
    4. Choose Save.

  • Step 3
    1. Navigate to the Order Processing process.

    2. Select the decision Order Validity Check menu option and choose Open Editor.

      Automation
    3. Add Input and Output parameters.

      Automation
    4. Edit Input and Output parameters as follows.

      Parameter Name Data Type Parameter Type Description
      Input Sales Order Sales Order Input Input Sales Order
      Validity Check Output Error OutputOutput Validity Check Output

      CAUTION: Select the List checkbox to make the output type as list of Error Output.

      Automation
    5. Select the Rules tab. Choose Add Rule.

      Automation
    6. Enter Rule Name as Error Check and Rule Description of your choice.

    7. For Hit Policy, select All Match.

      What is going on?

      With a First Match hit policy, the rule engine fetches the first occurrence that matches the condition and returns it as the result. On the other hand, with a All Match hit policy, the rule engine fetches all the occurrences that matches the condition and returns them as the result.

    8. Choose Next Step.

      Automation
    9. In the Configure Conditions section, expand the Input Sales Order parameter.

      Automation
    10. For this scenario you will be choosing expectedDeliveryDate, orderAmount, shippingCountry and orderStatus. Choose Next Step.

      Automation
    11. In the Configure Results section, enter Validity Check Output (List) in Result Vocabulary. Choose Validity Check Output parameter. Choose Next Step.

      Automation
    12. In the Review section, a summary of the rule to be added is displayed. Choose Create.

      Automation
    13. Enter Full Screen Mode by clicking on the icon on the top right corner.

      Automation
    14. In the Decision Table, add the below mentioned conditions.

      Parameter Name Condition Error Code Error Description
      expectedDeliveryDate <TODAY() ‘ERR01’ ‘Delivery date is before current date’
      orderAmount >100000‘ERR02’ ‘Fraudulent Request’
      shippingCountry NOTEXISTSIN [‘India’,‘United Kingdom’] ‘ERR03’ ‘Delivery not supported in this country’
      orderStatus =’’‘ERR04’ ‘Order status is not set’
    15. Click on the first column.

      Automation
    16. Type <TODAY, and choose TODAY from Array Operators. When finished, click outside the input field to confirm.

      Automation
    17. Proceed in the same way for Error Code and Error Description (or Then section):

      Automation

      Remember that for all String type data object attributes, you must add a single quote (’) before and after the text.

    18. To add a new row to the decision table:

      • Choose the check-box of the first row
      • Choose Add Row
      • From the dropdown options, select Insert After
      Automation
    19. Similarly, enter the above values for the next rows.

    20. Choose Save.

      Automation
  • Step 4
    1. Navigate back to the Order Processing process.

    2. Select the Order Validity Check decision and choose Inputs in decision details.

    3. Map the input parameters listed in Input Sales Order to the selectedOrder output variables from Get Order Details automation.

    4. Choose save.

      Automation

    Which of the following are true concerning input and output parameters?

  • Step 5
    1. In the Overview tab, click the Create dropdown and choose Form.

      Automation
    2. In the Create Form popup, enter the form name and choose Create.

      Automation
    3. Add a Headline and Paragraph to provide necessary details. Add two Text fields and name them Customer Name and Order Number.

    4. Check both Text fields as read only.

      Automation
    5. Add a Table with Error Details as title. Mark it as Read Only.

      Automation
    6. Choose the + icon in the table and select Text. Enter Error Code as field name.

      Automation
    7. Choose the + icon beside Error Code field and select Text.

      Automation
    8. Enter Error Description as field name and choose Save.

      Automation
  • Step 6
    1. In the Order Processing process choose the + sign after the Order Visibility Check decision.

      Automation
    2. Choose Controls and Events.

      Automation
    3. Select Condition.

      Automation
    4. Choose the Open Condition Editor for the new condition.

      Automation
    5. In the Edit Branch Condition popup select the list-Validity Check Output parameter.

      Automation
    6. Put 0 as value and select Apply.

      Automation
    7. In the If branch of the new condition, choose + to add a new artifact.

      Automation
    8. Select Form.

      Automation
    9. Select Order Rejection Notification With Errors under Available Forms.

      Automation
    10. In the General section of form details:

      • Enter as Subject: Order Rejected due to errors
      • Choose Process Started By as users under Recipients
      Automation
    11. Under Inputs section, choose Select list and bind list-Validity Check Output to it.

      Automation
    12. Choose the Order Number and Customer Name from trigger form to map them with the respective input fields.

      Automation
    13. Select the + after Order Rejection Notification with Errors form.

      Automation
    14. Choose Controls and Events.

      Automation
    15. Choose End.

      Automation

      At the end, your process will look like this.

    16. Save your work.

      Automation
  • Step 7
    1. In the Order Processing process, choose the Release button on the top right corner.

      Automation
    2. In the Release Project popup, select Release.

      Automation
    3. In the Overview section that appears, choose Deploy.

      Automation
    4. Choose the Environment and select Deploy.

      Automation
    5. In the Define Variables section, enter the OrderfilePath for the excel file you downloaded in the prerequisites section. Choose Deploy.

      Automation

      Your project is deployed.

      Automation
  • Step 8
    1. In the Order Processing process, choose the Order Processing Form artifact. On the right panel that appears, select the Copy Link icon next to Form Link field.

      Automation
    2. Before executing the process, make sure your desktop agent is in unattended mode. You can refer to the prerequisites to Execute the Process with an Automation.

      Automation
    3. In a new tab in your browser, enter the form link. Enter the details required in the form and select Submit.

      Automation

      When you enter the order number in the form, the automation fetches the order details from excel stored in your machine. The details are validated according to the rules in the decision table and the respective errors are shown in a table in the form.

    4. In the SAP Build Lobby, choose the Inbox icon on the top right.

      Automation
    5. You will get a notification with the error details in a table.

      Automation
  • Step 9

    This sample project can be downloaded from the SAP Build Store.

    To retrieve this sample, please follow these steps:

    1. From the SAP Build Lobby, navigate to Store.

    2. Search for the sample project: Sales Order Management (MI05).

    3. Choose Create from Template to retrieve the sample and save it as a new project in your lobby.

      Store
    4. Choose Create.

      Create

      Your project gets created in editable version. You may release and deploy it and run the project.

    5. Navigate back to the lobby by clicking on the SAP logo.

      Project

      You can see your project is available in the lobby.

      Lobby

Back to top