Liquid UI - Documentation - 23.22 Get user list using function module call

23.22 Get user list using function module call


Prerequisites

Purpose

The article demonstrates how to call a function module (BAPI_USER_GETLIST) to display the user list on the SAP Easy Access screen. The following steps will guide you through the process.

  1. Delete the image container on the SAP Easy Access screen
  2. Add a function to trim the string
  3. Call the function to display the user list
  4. Add a for loop to create texts
  5. Call the BAPI_USER_GETLIST function
     
Note: Ensure to provide the RFC parameters in the guixt.sjs file.

User Interface

//Create the SAPLSMTR_NAVIGATION.E0100.sjs file inside your scripts folder for customizing the SAP Easy Access screen 
//Now, let's 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().
     
    //Delete the image container on the SAP screen
     del("X[IMAGE_CONTAINER]"); 
     
     
  2. Add a function to trim the string.
     
    //Function to trim all the blank spaces
    String.prototype.trim = function() 
    {
        return this.replace(/^\s+|\s+$/g,"");
    }
    
     
  3. Call the getUsersList function to display the user list.
     
    //Displays the user details
    getUsersList();
    
     
  4. Add a for loop to create texts based on the number of users in the list.
     
    //For loop to create the texts
    for(i=0; i<user_id.length; i++)
    {
    	text([1+i,0], user_id[i]);
    }
    
     
  5. Call the BAPI_USER_GETLIST function using call().
     
    //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);       
        }
    }
    
     

SAP Process

  1. Refresh the SAP screen to see a list of users on the SAP Easy Access screen. Scroll down to view the entire user list.
     
     

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