Liquid UI - Documentation - 13.17 Export Native SAP Function Module Details into Liquid UI Table

13.17 Export Native SAP Function Module Details into Liquid UI Table


Prerequisites

Purpose

The article is a demonstration of how to use an RFC call to specific details of a native SAP function module within a Liquid UI table, based on the SAP Easy Access screen. Here, we’ll perform the following actions:

  1. Delete the image container on the SAP Easy Access screen
  2. Add a push button to execute the process
  3. Add a table and columns to display the data
  4. Add a function that displays the data in the tables

User Interface

//Create the file SAPLSMTR_NAVIGATION.E0100.sjs inside your scripts folder for customizing the SAP Easy Access screen
//Now, add the Liquid UI script to the above file and save it.

Customization

  1. Delete the image container on the SAP Easy Access screen using del().
     
    // Deletes the Image container on the SAP screen
    del("X[IMAGE_CONTAINER]");
    
     
     
  2. Add a push button labeled BAPI_GET_USER_DETAIL to execute the callBAPI_GET_USER_DETAIL process on click.
     
    // Creates a push button to execute the process
    pushbutton([0,1], "BAPI_USER_GET_DETAIL", "?", {"process":callBAPI_USER_GET_DETAIL, "size":[1,30]});
    
     
     
  3. Add tables labeled Data of Export Parameter and Data of Table Parameter with columns Component and Value to display the data.
     
    // Creates tables with columns to display the data
    table([1,1],[2,1],{"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});
     
     
  4. Add the callBAPI_GET_USER_DETAIL function to export the data in the Liquid UI table.
     
    // 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' },
          ]
    
       };
    // Performs Remote Function Call to retrieve user details  
       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++;
            }
        }
    }
    

SAP Process

  1. Refresh the SAP screen, and click on the BAPI_USER_GETS_DETAIL push button. Then, the function module details will be exported to the Liquid UI table, as shown in the image below.
     
     

Can't find the answers you're looking for?