Author Topic: Display Native SAP Function Module Details Into Liquid UI Table  (Read 5429 times)

lakshmi.k

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 7
    • View Profile
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++;
        }
    }
}