Recent Posts

Pages: [1] 2 3 ... 10
1
Liquid UI for Android can be licensed on a per NAMED USER basis or on a per DEVICE basis.

License Type: USER

This type of license will allow 1 (one) named SAP User to be connected to SAP environment.  Over usage of 1 (one) additional named SAP User to be connected to SAP environment is allowed and granted (This can change in future releases).

Effective Version: 4.24.6.0

A maximum for 2 named users will be allowed to login to SAP with this license type to maintain compliance.
A license limitation popup will appear on the UI if additional named user logs into SAP environment, as it are not permitted with this license type.

See document for details on maintaining the usage for this license type

License Type: DEVICE

When there is a need to use multiple named SAP users on a single device, this type of license will be mandatory and required.  This license type allows the customers to use the application across multiple named users and work shifts on a single device.

Please contact sales@guixt.com for additional details and pricing or reach out to your Account Executive at Synactive Inc.


2
WS aka Web Scripts (Attended RPA for SAP) / RFC CALL: BAPI_USER_EXISTENCE_CHECK
« Last post by lakshmi.k on June 19, 2024, 02:23:34 AM »
Purpose:
Below example demonstrates to check the existence of username by calling BAPI_USER_EXISTENCE_CHECK function module on Easy Access Screen.

Note:
To make the function module call, it is required to provide the rfc parameters in the configuration file i.e., guixt.sjs

Liquid UI Code:
-----------------------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
-----------------------------------------------------------------------------------------------------------------------------------------------------
clearscreen();

//User Interface
inputfield([1,0],"User name",[1,10],{"name":"z_user_name","size":15});
pushbutton([3,1],"Check User Exist","?",{"size":[2,20],"process":z_fmCallGetData});



//Functions
// Function trim, to remove blank spaces from variable values
String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
}

// Function to return trimmed string
function getString(strInput) {
   return(typeof(strInput) == 'undefined' || strInput == 'undefined')? "" : strInput.toString().trim();
}

// Function to check for blank string
function isBlank(strInput) {
   var strVal = getString(strInput);
   var blank = strVal == "";
   return blank;
}



//Function to call Bapi and display results
function z_fmCallGetData() {
   rfcresult = call('BAPI_USER_EXISTENCE_CHECK',{'in.USERNAME':'&V[z_user_name]','out.RETURN':'z_return'});
   if(rfcresult.rfc_rc != 0){
      // Cannot Call RFC for any reason
      // RFC call was *NOT* successful.
      // Display message to user, that rfc cannot be called (you can use the content of rfcresult.rfc_key)
      message('E:Error! RFC call failed to return data');
      enter("?");
      goto SCRIPT_END;
   }else {
      if(!isBlank(rfcresult.exception)){
         // RFC Call succeeded, but the ABAP code in the function module generated an exception
         // Display message to user, that rfc exception occured (you can use rfcresult.exception)
         message('E: Error!'+rfcresult.exception);
         enter('?');
         goto SCRIPT_END;
      }
   }
   
   // RFC Call was successful
   if(!isBlank(z_return)){
      set('V[z_user_exist]',z_return.substring(24,60));
   }
   
   message('S:'+ z_user_exist);
   set('V[z_user_name]','');
   enter("?");
   SCRIPT_END:;
   
}
3
Purpose: Reading List Screen Data: Extracting Material Numbers and Generating a Checkbox List of Materials

This article explains how to generate a list of materials from the List screen, which facilitates the display of material details as needed.

Prequisties:
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([/color][/b]"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[Delete Favorites");
del("P[Delete Favorites");
del("P[Change Favorites");
del("P[Move Favorites down");
del("P[Move Favorites up");
del("P[Create role");

//Function to set the screen layout.
function fn_navigate(param){
    set("V[z_screen]","");
    set("V[z_layout]","");
}

//Design Screen.
if(z_screen==undefined || z_screen==""){
    pushbutton([3,1], "@12@Generate Material List",{ "process":z_readfromlist});
    inputfield([1,1],"Max Entries",[1,12],{"name":"z_max","size":"11"});
}

//Function to read the list screen data
function z_readfromlist(){   
    title("Generating Material List....")
    z_material_array  = []; 
    lfvrow = 1;
    onscreen 'SAPLSMTR_NAVIGATION.0100'
        enter("/NSE16");
    onscreen 'SAPLSETB.0230'
        set('F[table Name]', 'MARA');
        enter();
   
    onscreen '/1BCDWB/DBMARA.1000'
        set("F[MAX_SEL]","&V[z_max]");
        enter("/8");
   
    onscreen 'SAPLSETB.0120'
        SCROLL_NEXT:;
        enter("/scrolltoline=&V[lfvrow]");
    onscreen 'SAPLSETB.0120'
        enter("/hscrollto=0");
    if(z_max=="1"){
        goto START;
    }
    if(lfvrow >= _listlastvisiblerow){
        goto END;
    }
    START:;
    lfvrow = _listfirstvisiblerow;
    llvrow = _listlastvisiblerow;
    z_row = 5;

    LOOP:; 
    set("V[z_matval]","&#["+z_row+",20]");   
    z_material_array.push(z_matval);
    lfvrow = lfvrow+1;   
   
    if(lfvrow <= _listlastvisiblerow){   
        z_row = z_row+1;
        goto LOOP;
    }
    if(z_max==1){
        goto END;
    }
    else{
        goto SCROLL_NEXT;
    }   
    END:;

    for(var col = 0; col < z_material_array.length; col++) {
         var objReeb = <"#["+row+","+col+"]">;
        if (objReeb && objReeb.isValid) {
            var trimmedName = objReeb.name.toString().trim();
            if (trimmedName === '5' || trimmedName === '') {
                retString += value + ' ';
                value = "";
            } else if (trimmedName !== lastReebName) {
                value = trimmedName;
                lastReebName = value;
            }
        }
    }

    set("V[z_layout]","1");
    enter("/3");
    onscreen 'SAPLSETB.0120'
        enter("/3");
    onscreen '/1BCDWB/DBMARA.1000'
        enter("/3");
    onscreen 'SAPLSETB.0230'
        enter("/3");
    onscreen 'SAPLSMTR_NAVIGATION.0100'
        enter("?");
    set("V[z_screen]","home");
}
 
//Function to checks the material(s) selection and navigate to MM02
function checkSelection() {
    selected = [];
    for (k=0; k<z_material_array.length;k++) {
        var chkName = "chk"+ (k+1);
        if (eval(chkName) == 'X') {
            selected.push(z_material_array[k]);
        }
    }
    if (selected.length > 1) {
        return("Execute one Material at a Time ");
    }
    if (selected.length == 0) {
        return("No Materials Selected");
    }
    enter("/nmm03")
    onscreen 'SAPLMGMM.0060'
    set("F[Material]",selected[0]);
    enter();
    onscreen 'SAPLMGMM.0070'
        set("cell[Table,0,1]","X");
        set("cell[Table,0,2]","X");
        set("cell[Table,0,3]","X");
        set("cell[Table,0,4]","X");
        set("cell[Table,0,5]","X");
        set("cell[Table,0,6]","X");
        set("cell[Table,0,7]","X");
        set("cell[Table,0,8]","X");
        set("cell[Table,0,9]","X");
        set("cell[Table,0,10]","X");
        set("cell[Table,0,11]","X");
        enter("/6");
    onscreen 'SAPLMGMM.0080'
        enter();
    onscreen 'SAPLMGMM.0080'
        enter();
    onscreen 'SAPMSDYP.0010'
        enter();
}

//Design Screen.
if(z_layout=="1"){
    box([1,0], [z_material_array.length+5,25], "Material List");
    pushbutton([z_material_array.length+3,2], "@16@Display Material",{"process":checkSelection,"size":[2,21]});
    pushbutton([TOOLBAR], "@H9@Home","?",{"process":fn_navigate , "using":{"l_screen":""}});
    for(l=0,m=3;l<z_material_array.length;l++,m++)
    checkbox([m,2], z_material_array[l],{name: "chk"+(l+1)});
}


Refer to the Attachment for clarity....
4
Purpose:
The below example demonstrates how to display native SAP function module details into a Liquid UI table on Easy Access Screen by making an RFC call.

Note:
For each output parameter in the function module, we need to specify individual structure object.
See Convert function module structure detail into type object to generate ready-to-use type object for selected structure.

Liquid UI Code:
------------------------------------------------------------------------------------------------------------------------------------
Script File Name : SAPLSMTR_NAVIGATION.E0100.sjs
------------------------------------------------------------------------------------------------------------------------------------

//User Interface
clearscreen();

pushbutton([0,1], "BAPI_USER_GET_DETAIL", "?", {"process":callBAPI_USER_GET_DETAIL, "size":[1,30]});

//LUI Table of Export Parameter
table([2,1], [25,42],{"name":"z_table_export", "title":"Data of Export Parameter", "rows":200});
column("Component", {"size":18, "table":"z_table_export", "name":"z_comp_export", "readonly":true});
column("Value", {"size":18, "maxlength":40, "table":"z_table_export", "name":"z_comp_value_export", "readonly":true});

//LUI Table of Table Parameter
table([2,50], [25,92],{"name":"z_table", "title":"Data of Table Parameter", "rows":200});
column("Component", {"size":18, "table":"z_table", "name":"z_comp_table", "readonly":true});
column("Value", {"size":18, "maxlength":40, "table":"z_table", "name":"z_comp_value_table", "readonly":true});


//Function
//Function to display data of export parameter and table parameter in the LUI table
function callBAPI_USER_GET_DETAIL() {
   
   var z_BAPILOGOND = {

      name:'BAPILOGOND',

      components:[

         { name:'GLTGV',      length:8,      decimalpl:0,      type:'D' },
         { name:'GLTGB',      length:8,      decimalpl:0,      type:'D' },
         { name:'USTYP',      length:1,      decimalpl:0,      type:'C' },
         { name:'CLASS',      length:12,      decimalpl:0,      type:'C' },
         { name:'ACCNT',      length:12,      decimalpl:0,      type:'C' },
         { name:'TZONE',      length:6,      decimalpl:0,      type:'C' },
         { name:'LTIME',      length:6,      decimalpl:0,      type:'T' },
         { name:'BCODE',      length:8,      decimalpl:0,      type:'undefined' },
         { name:'CODVN',      length:1,      decimalpl:0,      type:'C' },
         { name:'PASSCODE',      length:20,      decimalpl:0,      type:'undefined' },
         { name:'CODVC',      length:1,      decimalpl:0,      type:'C' },
         { name:'PWDSALTEDHASH',      length:255,      decimalpl:0,      type:'C' },
         { name:'CODVS',      length:1,      decimalpl:0,      type:'C' },
         { name:'SECURITY_POLICY',      length:40,      decimalpl:0,      type:'C' },
      ]

   };
   
   
   var z_BAPIPARAM = {

      name:'BAPIPARAM',

      components:[

         { name:'PARID',      length:20,      decimalpl:0,      type:'C' },
         { name:'PARVA',      length:18,      decimalpl:0,      type:'C' },
         { name:'PARTXT',      length:60,      decimalpl:0,      type:'C' },
      ]

   };
   
   rfcResult = call("BAPI_USER_GET_DETAIL", {"in.USERNAME":"&V[_user]",
                  "out.LOGONDATA(type:z_BAPILOGOND)":"z_export_logon",
                  "table.PARAMETER(width:3000,type:z_BAPIPARAM)":"z_table_param"});
   println("=====>>Exception: " + rfcResult.exception);

      

   
   var value_export = '';
   var a = 0;
   for (var idx in z_export_logon) {
      z_table_export.z_comp_export[a] = idx;
      set('V[value_export]',z_export_logon[idx]);
      z_table_export.z_comp_value_export[a] = value_export;
      a++;
   }
   

   
   var value_table = '';
   var c = 0;
    for (var j in z_table_param){
        for (var k in z_table_param[j]){
         z_table.z_comp_table[c] = k;
         set('V[value_table]',z_table_param[j][k]);
         z_table.z_comp_value_table[c] = value_table;
         c++;
        }
    }
}
5
WS aka Web Scripts (Attended RPA for SAP) / Making Structured RFC Calls
« Last post by lakshmi.k on March 18, 2024, 10:13:32 PM »
Purpose:
Below example demonstrates structure to make function module calls, display message to the user if the call was successful and display an error message if the call was not successful.

Note:
To make the function module call, it is required to provide the rfc parameters in the configuration file i.e, guixt.sjs

Liquid UI Code:
----------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
----------------------------------------------------------------------------------------------------------------------
// User Interface
clearscreen();
inputfield([1,0],"Message",[1,10],{"name":"z_message","size":70,"readonly":true});
pushbutton([3,1],"Get Messsage","?",{"size":[2,20],"process":getMessage});

//Functions
//To remove blank spaces from variable values
String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
}

//Function to return trimmed string
function getString(strInput) {
   return (typeof(strInput) == 'undefined' || strInput == 'undefined') ? "" : strInput.toString().trim();
}

//Function to check for blank string
function isBlank(strInput) {
   var strVal = getString(strInput);
   var blank = strVal == "";
   return blank;
}

//Function to call BAPI and display results
function getMessage(){
   onscreen 'SAPLSMTR_NAVIGATION.0100'
      rfcresult = call('BAPI_USER_CHANGE',{'in.USERNAME':'&V[_user]','out.GENERATED_PASSWORD':'z_gen_pswd','table.RETURN':'z_return'});
      if(rfcresult.rfc_rc != 0) {         
         // Cannot Call RFC for any reason
         // RFC call was *NOT* successful.
         message('E: Error! RFC Call Failed to Return Data');
         enter("?");
         goto SCRIPT_END;
      } else {
         if(!isBlank(rfcresult.exception)) {
            // RFC Call succeeded, but the ABAP code in the function module generated an exception
            // Display message to user, that rfc exception occured (you can use rfcresult.exception)
            message('E: Error! '+rfcresult.exception);
            enter("?");
            goto SCRIPT_END;
         }
      }

      // RFC call was successful
      if(!isBlank(z_return)){
         set('V[z_message]', z_return.toString().substring(24,244));   
      }
      message('S: RFC call was successful');
      enter('?');
    SCRIPT_END:;   
}

6
WS aka Web Scripts (Attended RPA for SAP) / RFC CALL: BAPI_USER_GETLIST
« Last post by lakshmi.k on March 18, 2024, 09:29:22 PM »
Purpose:
Below example demonstrates to display users list on Easy Access Screen by calling BAPI_USER_GETLIST function module.

Note:
To make the function module call, it is required to provide the rfc parameters in the configuration file i.e., guixt.sjs

Liquid UI Code:
----------------------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
----------------------------------------------------------------------------------------------------------------------------------------------------
del("X[IMAGE_CONTAINER]");       //Deletes the image container on the Easy Access Screen

String.prototype.trim = function () {
   return this.replace(/^\s+|\s+$/g, "");
}

getUsersList();         //Calls the getUserList function and executes it

//To create text based on the number of users in the list
for(i=0; i<user_id.length; i++){
   text([1+i,0], user_id);
}

//Function to get users list
function getUsersList() {
call('BAPI_USER_GETLIST',{'in.WITH_USERNAME':'&V[_user]','out.ROWS':'z_rows','table.USERLIST':'z_userslist'});
   user_id = [];
   for(i = 0; i<z_userslist.length; i++){
             temp = z_userslist.trim();
             user_id.push(temp);       
    }
}
7
Purpose:
To extract data from a SAP table and load it into a Liquid UI table. Additionally, the data in table will be cleared using pushbuttons.

The following example illustrates the above defined process established on the easy access screen.

Liquid UI Code:
------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
------------------------------------------------------------------------------------------------------------------------------------

//Delete Image Container
del("X[IMAGE_CONTAINER]");

//User Interface
inputfield( [0,1], "Order", [0,11],{ "name":"va02_Order", "size":21, "searchhelp":"VMVA"});

table([2,1],[8,68],{"name":"va02_AllItems","title":"All items", "rows":20, "rowselection":true,"columnselection":true});
column('Item',{"table":"va02_AllItems","size":4,"name":"va02_item","position":1});
column('Material',{"table":"va02_AllItems","size":15,"name":"va02_mat","position":2});
column('Order Quantity',{"table":"va02_AllItems","size":15,"name":"va02_qty","position":3});
column('description',{"table":"va02_AllItems","size":25,"name":"va02_desc","position":4});

pushbutton( [10,1], "Extract Data To LiquidUI Table","?",{ "process":extractDataToLiquidUiTable,"size":[1,27]});
pushbutton([10,30], "Clear Table Data", {"process":clearData}); //clearTableData



//Functions
//Function to retrieve data to Liquid UI table
function extractDataToLiquidUiTable(){ 
   // SAP Easy Access
   onscreen 'SAPLSMTR_NAVIGATION.0100'
      enter("/nva02");
   
   // Change Sales Order: Initial Screen
   onscreen 'SAPMV45A.0102'
      set('F[Order]', '&V[va02_Order]');
      enter("=SUCH");
   
   
   // Change Sales Order: Initial Screen
   onscreen 'SAPMSDYP.0010'
      enter();
   
   // Change Sales Order: Initial Screen
   onscreen 'SAPMSDYP.0010'
      enter();
   
   onscreen 'SAPMV45A.4001'
      
      z_va02_item=[];
      z_va02_mat=[];
      z_va02_qty=[];
      z_va02_desc=[];
   
      
      gettableattribute('T[All items]', {'firstvisiblerow':'FVisRow', 'lastvisiblerow':'LVisRow', 'lastrow':'LastRow'});

      relrow=1;
      absrow=1;
      total=0;
      println("=====> First visible row is: "+FVisRow);
      println("=====> Last visible row is: "+LVisRow);
      println("=====> Last row of the table is: "+LastRow);

      if(FVisRow != 1){
         println("=====> Scroll to first row before start...");
         enter('/ScrollToLine=1', {table:'T[All items]'});
      } else {
         enter('?');
      }

   newscreen:;
   onscreen 'SAPMV45A.4001'
      relrow=1;
      gettableattribute('T[All items]', {'firstvisiblerow':'FVisRow', 'lastvisiblerow':'LVisRow'});
      println("=====> New first visible row is: "+FVisRow+", new last visible row is: "+LVisRow);

      newlabel:;
      
      if(absrow>LVisRow){
         println("=====> Scroll to next visible row before continue...");
         enter('/ScrollToLine=&V[absrow]', {table:'T[All items]'});
         goto newscreen;
      }

      if(absrow>LastRow){
         println("=====> Reach the end of table, end of scrolling");
         goto end;
      }
      set('V[z_curr_item]', '&cell[All items,Item,&V[relrow]]');
      z_va02_item.push(z_curr_item);
      set('V[z_curr_mat]', '&cell[All items,Material,&V[relrow]]');
      z_va02_mat.push(z_curr_mat);
      set('V[z_curr_quan]', '&cell[All items,Order Quantity,&V[relrow]]');
      z_va02_qty.push(z_curr_quan);
      set('V[z_curr_desc]', '&cell[All items,Description,&V[relrow]]');
      z_va02_desc.push(z_curr_desc);
      

      absrow++;
      relrow++;
      goto newlabel;
      
      end:;
      println("=====> Scroll to the first row of table at the end");
      enter('/ScrollToLine=1', {table:'T[All items]'});
   
      
      total = absrow;
      println("This is absolute row :"+absrow+":"+total);
      
      
   onscreen 'SAPMV45A.4001'
      for(var idx=1, i=0; idx<total-1;idx++, i++){

         va02_AllItems.va02_item=z_va02_item;
         va02_AllItems.va02_mat=z_va02_mat;
         va02_AllItems.va02_qty=z_va02_qty;
         va02_AllItems.va02_desc=z_va02_desc;

      }
      enter('/n');   
      
   
}


//clear table data
function clearData() {   
   var table_value = ' ';

   for(i=1;i<total-2;i++) { 
      table_value += ' ';
   }

   onscreen 'SAPLSMTR_NAVIGATION.0100'
      set('V[va02_*]','');
      set('V[z_*]','&V[table_value]');
      enter();
      
}
8
WS aka Web Scripts (Attended RPA for SAP) / Read LiquidUI Table
« Last post by lakshmi.k on February 29, 2024, 08:33:15 PM »
Purpose:
Read values in the LiquidUI table with toolbar pushbutton.

Below example demonstrates read LiquidUI table data and display them on the console window.

Liquid UI Code:
------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
------------------------------------------------------------------------------------------------------------------------------------
//Delete image container
del("X[IMAGE_CONTAINER]");

//User Interface
table([1,5],[10,45],{"name":"va01_AllItems","title":"All items", "rows":10, "rowselection":true,"columnselection":true});
column('Item',{"table":"va01_AllItems","size":4,"name":"z_va01_item","position":1});
column('Material',{"table":"va01_AllItems","size":15,"name":"z_va01_material","position":2});
column('Order Quantity',{"table":"va01_AllItems","size":15,"name":"z_va01_Orderquantity","position":3});

pushbutton([TOOLBAR],"Read LiquidUI Table","?",{"process":readLiquidUITableValues,"size":[2,23]});

//Functions
// Function prototype to trim blank characters from a string
String.prototype.trim = function () {
   return this.replace(/^\s+|\s+$/g, "");
}

// Function to return trimmed string
function getString(strInput) {
   return (typeof(strInput) == 'undefined' || strInput == 'undefined') ? "" : strInput.toString().trim();
}

// Function to check for blank string
// Specifically used to determine if input exist in the edit field
function isBlank(strInput) {
   var strVal = getString(strInput);
   var blank = strVal == "";
   return blank;
}


//function to read LiquidUI table 'All items'
function readLiquidUITableValues(){
   i = 0;
   //declaring variables and arrays
   temp_items=[];
   temp_material=[];
   temp_quantity=[];
   
   STARTLABEL:; 
   z_temp1 = va01_AllItems.z_va01_item[i ];   
   z_temp2 = va01_AllItems.z_va01_material[i ];   
   z_temp3 = va01_AllItems.z_va01_Orderquantity[i ];
   
   if(!isBlank(z_temp1) && !isBlank(z_temp2) && !isBlank(z_temp3)){   

      temp_items.push(z_temp1);
      temp_material.push(z_temp2);
      temp_quantity.push(z_temp3);
   
      i=i+1;
      goto STARTLABEL;
      
   }   
    
   println('-----------items-------'+temp_items);
   println('-----------material-------'+temp_material);
   println('-----------order quantity-------'+temp_quantity);
   

}
9
WS aka Web Scripts (Attended RPA for SAP) / Add Inputfield Values to SAP Table
« Last post by lakshmi.k on February 28, 2024, 11:35:37 PM »
Purpose:
Add Inputfield values to SAP table using pushbutton.

Below example demonstrates adding inputfield values created on the VA02 screen to the "All items" table.

Liquid UI Code:
-------------------------------------------------------------------------------------
Script File Name: SAPMV45A.E0102.sjs
-------------------------------------------------------------------------------------

//User Interface
del("G[Search Criteria]");      //Deletes Search Criteria group box

comment([4,2], "Item   Material        Order Quantity  Plnt");

inputfield([5,2], {"name":"z_va02_item", "size":6,"nolabel":true});
inputfield([5,9], {"name":"z_va02_mat", "size":15,"nolabel":true});
inputfield([5,25], {"name":"z_va02_qty", "size":15,"nolabel":true});
inputfield([5,41], {"name":"z_va02_plnt", "size":4,"nolabel":true});

pushbutton([2,59],"Add Values To SAP Table", {"process":addValuesToSAPtable});


//Function to add values in the inputfield to SAP table
function addValuesToSAPtable(){

   onscreen "SAPMV45A.0102"
      enter();
   onscreen "SAPMSDYP.0010"
      enter();
   onscreen "SAPMV45A.4001"
      var absrow = 1;
      var relrow = 1;
      
   NEW_SCREEN:;   
   
      enter("/scrolltoline=&V[absrow]", {"table":"T[All items]"});
   onscreen "SAPMV45A.4001"
      relrow = 1;

      gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LRow"});
   NEW_ROW:;
   
      if(absrow > LVisRow){
         goto NEW_SCREEN;
      }
      if(absrow > LRow){
         goto END_OF_TABLE_SCROLL;
      }
      
      relrow++;
      absrow++;
      
      goto NEW_ROW;
   END_OF_TABLE_SCROLL:;
   
      //Adding inputfields values to the All items table
      set("cell[All items,Item,&V[relrow]]","&V[z_va02_item]");
      set("cell[All items,Material,&V[relrow]]","&V[z_va02_mat]");
      set("cell[All items,Order Quantity,&V[relrow]]","&V[z_va02_qty]");
      set("cell[All items,Plnt,&V[relrow]]","&V[z_va02_plnt]");
      
      set('V[z_*]','');       //it clears the values in the inputfield
      enter('/11');
      
      onerror               //It navigates to VA02 screen if there is an error
      message(_message)
      enter('/nva02')
      
}




10
Purpose:
Using _tabrow on Liquid UI table with pushbutton option to retrieve the clicked row details.

For the below example, Liquid UI table is displayed on SAP Easy Access screen.
Click the pushbuttons on the UI to clear or populate the table with random data.
Click the pushbuttons in the Liquid UI table to retrieve the clicked row number and get that row Material details.

Liquid UI Code:
---------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
---------------------------------------------------------------------------------

pushbutton([TOOLBAR],'Find Position',{'process':readCursorPosition});

function readCursorPosition(){
        // Put cursor in the table cell, to find out its position
        set('V[z_rowcol]','['+_tabrow+','+_tabcol+']');
        println('Value:' + z_rowcol);
}


//USER INTERFACE
clearscreen();
table([6,1], [30,48],{"name":"z_table", "title":"LUI Table", "rows":20, "rowselection":true});
   column("Material", {"size":18, "table":"z_table", "name":"z_print_mat", "readonly":true});
   column("Desc", {"size":18, "maxlength":40, "table":"z_table", "name":"z_print_matdesc", "readonly":true});
   column("Row #'s", {"size":4, "table":"z_table","label":"@AA@", "pushbutton":true,"fcode":"?","process":fnGetClickedRowData});
               
pushbutton([1,1],"Clear Table","?",{"process":fnClearTable,"size":[2,20]});               
pushbutton([1,22],"Fill Data Table","?",{"process":fnFillTable,"size":[2,20]});               
comment([4,1],"[Click on the LUI table row pushbuttons to get the Row number and Material number]");      
         



// FUNCTIONS
// Function to clear the Liquid UI table based on parameters
function clear_values(tablename, columnArray, rows){   
   for (var loop = 0; loop < rows; loop++){
      for (var col=0; col<columnArray.length; col++){   
         tablename[columnArray[col]][loop] = "";
      }
   }   
}               


function fnClearTable(){
   if(typeof z_table =='object'){
      clear_values(z_table,["z_print_mat","z_print_matdesc"],20);
      for(var idx=0;idx<20;idx++){
         z_table.selectedrows[idx] = " ";
      }
   }        
}


function fnFillTable(){
   if(typeof z_table =='object'){
      for(var idx=0;idx<20;idx++){
         z_table.z_print_mat[idx] = "12340"+idx;
         z_table.z_print_matdesc[idx] = "Test Desc_"+idx;
      }
   }        
}

function fnGetClickedRowData(){
   if(_tabrow == -1){
      message("E: No data found, please click 'Fill Data Table' first");
   } else {
      zrow = _tabrow-1;
      message("S: You clicked Row# "+_tabrow+" and Material# is "+z_table.z_print_mat[zrow]);
   }
}
Pages: [1] 2 3 ... 10