Author Topic: LiquidUI: Function Module Call  (Read 8517 times)

chirag.amin@guixt.com

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 34
    • View Profile
LiquidUI: Function Module Call
« on: January 29, 2016, 10:29:56 AM »
This is an example of calling a Function Module using WS. In this example, we will use the Function Module BAPI_USER_GET_DETAIL display information on a screen.

LiquidUI Script

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Author: Synactive, Inc. [1065 E. Hillsdale Blvd, Foster City, CA, 94404, USA]
// Email: support@guixt.com; sales@guixt.com;
// Contact: 650.341.3310
// Version: 1.0.0.0
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

// This allows a string to be trimmed of all blank spaces
String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
}

// Clear the screen of all elements
del("X[IMAGE_CONTAINER]");

// Run the function
getDetailFromFM();

// Run a for loop to dynamically create the text
for(j=0; j<param_id.length; j++)
{
   text([1+j,0], param_id[j]+": "+param_val[j]);
}
// Create a group box to hold the data witha  title involving the user and the user's class
box([0,0],[j+1,38],"Defaults for "+_user.trim()+" ("+z_class+")");


// This function makes the call to the Function Module and pulls the data to display
function getDetailFromFM(){
   println("In this function.")
   call("BAPI_USER_GET_DETAIL", {"in.USERNAME":"&V[_user]", "out.LOGONDATA":"z_logondata", "table.PARAMETER":"z_parameters"});
   
   // extract the user's class type
   z_class = z_logondata.substring(17,29).trim();

   
   // create two arrays
   param_id = [];
   param_val = [];
   
   // run a for loop to go through the table and store each value we want
   for(j = 0; j<z_parameters.length; j++){
      tmp = z_parameters[j].substring(0,20).trim();
      param_id.push(tmp);
      tmp = z_parameters[j].substring(20,38).trim();
      param_val.push(tmp);
   }
}


See attached documents
« Last Edit: February 10, 2020, 12:52:00 PM by Rahul Gera »