The dropdownlist command (also called combobox) creates or modifies dropdown lists on SAP screens.
You can trigger actions from dropdown lists. Once an action is triggered, you can use the set command to populate the values chosen to other controls or screens. The basic syntax for dropdownlist is shown below:
set(“V[variable]”,value);
dropdownlist([18,0], "variable" ,{"refer":"V[z_variableselected]",
"width":30,"process":process_name,"textfont":"verdana","textheight":13,"textweight":6});
The dropdownlist command takes the following options:
Calls a process. The syntax is shown below:
{"process":function_name}
Passes the selected option to another screen or to a different element on the same screen. The syntax is as follows:
{"refer":"F[Industry sector]"}
Specifies the font to be used for the values in the dropdown list. The syntax is as follows:
{"textfont":"Helvetica"}
Specifies the height of the font used in the dropdown list. Heuight can be specified in pixels, percentage, or in ems. The syntax is shown below:
{"textheight":"10"}
Specifies the weight of the text to be used. the weight range is 0-8. The syntax is as follows:
{"textweight":6}
Specifies the width of the dropdownlist. The syntax is as follows:
{"width":30}
Please see the following example for more information.
The data used in the dropdown list can be drawn from either of the following sources:
in the following example, we will get our data from a text variable and we will display that data in a dropdown list.
Launch SAP and navigate to the MM01 transaction. The default screen appears as shown below:

Open the SAPLMGMM.E0060.sjs script file and enter the following code. Create the file if it does not already exist.
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});
function test_dropdown(){
set("F[Industry sector]", z_ordertypeselected);
set("F[Material Type]", "FERT");
enter();
}
Save the file, then refresh the MM01 transaction. The modified screen with the new dropdown list appears as shown below:

Click on the dropdown list and it will display as follows:

Select a value from the dropdown list. The process will execute, populating the fields with the desired values.