Skip to content

Latest commit

 

History

History

ex3.3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

SAP Build Apps

New Purchase Page - Logic for Data Variables

  1. Go to UI Canvas > Variables > Data Variables

  1. Add 2 data variables: A_ProductBasicText and Customers
  • Select SAVE

Note: Please make sure that you have same data variable names in your screen: A_ProductBasicText1 and Customers1

  1. Select Customers1 data entity. Select the [X] icon under Filter condition.

  1. Select Object with Properties

  1. Add a condition:

    • Property: customerNumber.

    • Condition type: equal.

    • Select the ‘123’ icon under Compared value

  1. Go to Formula > Select into the Formula field

  1. Enter the formula below and Save the formula afterwards

INTEGER(params.SelectedCustomerNumber)

  1. Save the condition

  1. Switch to VIEW.

  2. Drag & Drop the UI Components with the following order:

    • Dropdown field

    • Input field

    • Button

  1. Switch to VARIABLES > PAGE VARIABLES >

  2. Create 2 Page Variables

    • Variable 1: Name: PurchaseValue Variable Value type: number

    • Variable 2: Name SelectedProduct Value type: text

  3. Select Save

  1. Switch back to VIEW then:

    • Select Dropdown field.

    • Rename the Label text: Select Product.

    • Select the ‘[ ]’ icon under Option list.

  1. Go to Formula

  2. Enter the formula below

MAP(data.A_ProductBasicText1, {label:item.Product, value:item.Product})

  1. Save the Formula

  1. Select the X under Selected value

  2. Go to Data and Variables > Page variable > SelectedProduct > select Save

  1. Select Input field and Rename label: Purchase Value

  2. Select the ‘X’ icon under Value

  1. Go to Data and Variables > Page variable > PurchaseValue

  2. Select Save

  1. Select Button > Rename label: Add Points!

  2. Open Logic Canvas

  1. Drag & Drop the logic components below to create the logic and join each component.

    • Create record

    • Alert

    • Navigate back

  2. Select Save

  1. Select Create record function > Select the data entity Purchases and Save.

  2. Select the Custom Object

  1. Select the ABC icon under ID > Formula

  2. Select the Formula bar.

  1. Enter the following formula and Save:

GENERATE_UUID()

  1. Select the [X] icon under customer_ID > Formula > Create formula

  1. Enter the following formula and Save:

data.Customers1[0].ID

  1. Select the [X] icon under purchaseValue > Formula > Create formula

  1. Enter the following formula and Save:

INTEGER(pageVars.PurchaseValue)

  1. Select the [X] icon under selectedProduct > Data and Variables > Page Variable > SelectedProduct

  1. Save the window

  1. Select Alert component > Select the ABC icon under Dialog title > Formula

  1. Copy and Paste (as plain text) the formula below > Save

data.Customers1[0].name + " has successfully earned " + outputs["Create record"].response.rewardPoints + " points!"

  1. Save the project