Liquid UI - Documentation - 17.09 Create dropdownlist with custom values

17.09 Create dropdownlist with custom values


Prerequisites


Purpose

The dropdownlist command (also called Combobox) creates or modifies dropdown lists on SAP screens. This article demonstrates how to restrict dropdownlist values and automatically execute a function when a value is selected from the dropdownlist.

To achieve this, we'll guide you through the following steps.

  1. Add customized dropdownlist on SAP screen.
  2. Set values to dropdownlist
  3. Add a function to assign values to dropdownlist


User Interface

//Create this file inside your script folder for customizing the Create Material (Initial Screen): SAPLMGMM.E0060.sjs 

//Now, let's add the Liquid UI script to the above file and save it. 

  1. Create a dropdownlist with the label “Mylist” at the desired position and set the values to the list using set(), as shown below.
     
    // Sample User Interface in MM01 transaction
    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 a function to assign the selected value from dropdownlist to the Industry sector dropdownlist. Here, the Industry sector dropdownlist is restricted to only 3 values.
     
    //Sample Function
    function test_dropdown(){
    set("F[Industry sector]",z_ordertypeselected); 
    set("F[Material Type]","FERT");
    enter();
    }

 

SAP Process

  1. Logon to SAP and navigate to the MM01 screen. Dropdownlist is used to trigger the action. Once an action is triggered, the set command can be used to populate the values chosen from the dropdownlist to other controls or screens. Selecting Mechanical Engineering from the new dropdown list will trigger the process, as shown below.
     

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