Liquid UI - Documentation - 22.05 Searchhelp using Function Module

22.05 Searchhelp using Function Module


Prerequisites


Purpose

On a Liquid UI inputfield we can bring F4 searchhelp display using function module. This method will allow to display custom field values and also restricted search help.


User Interface

  1. Log into SAP and on the SAP Easy Access Screen you will see 1 Liquid UI inputfield and a button. Click the highlighted button below

     
  2. You will see the sample Plant values displayed using searchhelp option using function module.

     


Liquid UI Script

//esession.sjs

load('functions_plant.sjs');

//SAPLSMTR_NAVIGATION.E0100.sjs

del("X[IMAGE_CONTAINER]");
inputfield( [2,3], "Plant", [2,10],{ "name":"z_plant", "size":4});
pushbutton([2,15], "@8D@", {"process":getPlantList,"size":[1,2]});

//functions_plant.sjs

function getPlantList(){
    plantValue = [];
    call("Z_GUIXT_GET_PLANT",{"table.TBL_PLANT":"plantValue"});
    if(plantValue.length > 0){
	enter('/o');   
	}
	}
	function selectPlant(param){
    enter('/12');
    onscreen '*'
	set("V[z_plant]",param.l_plant);
enter('?');
}
function exitPopup(){ enter('/12');
}

//RSM04000_ALV.E2000.sjs

clearscreen();
windowsize([0,2,105,10]);
title("Select Plant");
// Toolbar Button on Popup
del("P[Generate]");     
// Toolbar Button on Popup       
del("P[End Session]");     
// Toolbar Button on Popup   
del("P[Continue]");            
text('P[Cancel]','@02@Cancel');

if(plantValue.length > 0){
// Row Number to start painting controls on the screen
    rowNumber = 0; 
// Column Number to start painting controls on the screen	
    colNumber = 1;        
    plantNumber = '';
    
    for (var loop=0; loop<plantValue.length; loop++){
        if (colNumber > 100){    // On the screen, if the width of the screen exceeds 100, then draw controls on next row
            rowNumber+=3;
            colNumber=1;
        }
        plantNumber = plantValue[loop].substring(0,4).trim();

        pushbutton([rowNumber,colNumber],plantNumber,{"process":selectPlant, 'using':{'l_plant':plantNumber},"size":[2,5]});
        colNumber+=7;
    }
} 
onUIEvents['/12']={"process":exitPopup};
onUIEvents['Enter']={"process":exitPopup};

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