Author Topic: Calculating Sum of two Liquid UI Inputfields  (Read 6210 times)

Ashfaq Ahmed

  • Administrator
  • Newbie
  • *****
  • Posts: 32
    • View Profile
Calculating Sum of two Liquid UI Inputfields
« on: August 23, 2021, 11:34:41 PM »
Purpose: To Calculate the sum of two inputfields using Liquid UI WS

Please follow the below steps:

Step-1: Open the Script file "SAPLSTMTR_NAVIGATION.E0100.sjs" or Create it if it is not present in the WS Directory as configured in the "guixt.sjs" file.

Step-2: Add the below Code Snippet and Save it.

//Deleting the Screen Controls
//Liquid UI Code:
del("X[IMAGE_CONTAINER]");
del("P[User menu]");
del("P[SAP menu]");
del("P[SAP Business Workplace]");
del("P[Display role menu]");
del("P[Add to Favorites]");
del("P[Delete Favorites]");
del("P[Change Favorites]");
del("P[Move Favorites down]");
del("P[Move Favorites up]");
del("P[Create role]");
del("P[Assign users]");
del("P[Documentation]");

//Function to Increment the Total Field from the Quantity Field
function Increment(param){
var total1=parseInt(z_quantity);
var total2=parseInt(z_total);
var output=total1+total2;
set("V[z_total]",output);
}

//Design Screen
inputfield( [12,73], "Total", [12,86],{ "name":"z_total", "size":32});
inputfield( [10,73], "Quantity", [10,86],{ "name":"z_quantity", "size":32});
pushbutton([14,93], "@01@",{ "process":increment, "size":[2,12], "using":{ "quantity":"z_quantity", "total":"z_total" }});

Step-3: Enter the Values in the inputfields and Click on the Pushbutton.

Step-4: It will calculate the Sum and display the result in the inputfield.


Refer to the Attachment for clarity....