Liquid UI - Documentation - 17.09 Create dropdownlist with custom values

17.09 Create dropdownlist with custom values


Prerequisites

Purpose

The article demonstrates how to create or modify dropdown lists on SAP screens using the dropdownlist(). Here, we are considering the Create Material (Initial Screen) to demonstrate the process and walk you through the following steps:

  1. Add dropdownlist, and set values to the list.
  2. Add a function to assign values to the dropdownlist.

User Interface

//Create the file SAPLMGMM.E0060.sjs inside your scripts folder for customizing the Create Material (Initial Screen).
//Now, add the Liquid UI script to the above file and save it.

Customization

  1. Login to SAP and navigate to the MM01 screen, add a dropdownlist labeled Select Industry Type, and set the values to the list using set(), as shown below.
     
    //Creates dropdownlist and sets values to the list
    set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");
    dropdownlist([10, 0],"mylist",{"refer":"F[Industry sector]","width":30,"process":test_dropdown});
    
     
     
  2. Add the test_dropdown function to assign the selected value from the dropdownlist to the Industry sector dropdownlist. Here, the Industry sector dropdownlist is restricted to only 3 values.
     
    //Function to assign the selected value
    function test_dropdown(){
    set("F[Industry sector]",z_ordertypeselected);
       set("F[Material Type]","FERT");
       enter();
     }
    

SAP Process

  1. Refresh the SAP screen, select Mechanical Engineering from the Select Industry Type dropdownlist, and hit Enter. Then, the Select View(s) pop-up appears, as depicted in the image below.
     
     

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