Liquid UI - WS Reference Library

dropdownlist()


Purpose

With dropdownlist(), you can create and modify dropdownlist.

Based on the selection of an item in the dropdownlist, you can define a trigger for an action.


Syntax

dropdownlist([startrow,startcol],"variables","option":value...});

Note: You can use set command to populate values in the dropdownlist. The following is the syntax:

set("V[variable]",value);
dropdownlist([startrow,startcol],"variables","option":value...});


Properties

  • startrow,startcol - row and column co-ordinates
  • variables - The list of items that appear in the dropdownlist


Available Options

You can use the following options with the dropdownlist: 

"process":".."

"process":true - This option calls a function.

"refer":".."

"refer":"true" - This option is used to pass the selected value of the dropdownlist to another screen or to a different element on the same screen.

"textfont":".."

"textfont":"string" - This option is used to specify the style of the font for the values in the dropdownlist. The default font is Arial.

"textheight":".."

"textheight":"" - This option is used to specify the height of the font in the dropdownlist. The height can be specified in pixels, percentage, or in EMs. The default height depends on SAP GUI font size.

"textweight":".."

"textweight":true - This option is used to specify the weight of the text. The weight range varies from 1(thin) - 9(heavy). The default value is 5.

"width":".."

"width":value - This option is used to specify the width of the dropdownlist. The default width is 16.


Options Detail

process

  1. This option calls a function.

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");  
    dropdownlist([1,0],"mylist",{"process":test_dropdown});
    
  3. As per the code, the dropdownlist will call test_dropdown named function.

refer

  1. This option is used to pass the selected value of the dropdownlist to another screen or to a different element on the same screen.

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");  
    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]","process":test_dropdown}); 
  3. As per the code, the selected value from the Industry sector dropdownlist is passed to the mylist dropdownlist.

textfont

  1. This option is used to specify the style of font for the values in the dropdownlist. The default font is Arial.

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");  
    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]","process":test_dropdown,"textfont":"calibri"}); 
  3. The textfont option changes the font style of the text.

textheight

  1. This option is used to specify the height of the font in the dropdownlist. The height can be specified in pixels, percentage, or in EMs. The default height depends on SAP GUI font size.

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");  
    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]", "process":test_dropdown,"textheight":"15"}); 
  3. The textheight options increases the height of text in pixels.

textweight

  1. This option is used to specify the weight of the text. The weight range is 1(thin) - 9(heavy) and the default value is 5

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;"); 
    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]","process":test_dropdown,"textweight":20});
  3. The text size will increase to 6.

width

  1. This option is used to specify the width of the dropdownlist. The default width is 16.

  2. set("V[mylist]","=--- Select Industry Type ---;B=Beverage;C=Chemical Industry;M=Mechanical Engineering;");  
    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]","process":test_dropdown,"width":30}); 
  3. The width option increases the dropdownlist width horizontally.


Example

Consider an organization that wants to create only the few types of Sales Orders:

Figure 1: Creating Sales Order - Liquid UI


Script

set("V[mylist]","=--- Select Order Type---;AA=Promotion Order;CMR=Standard Order;AEBO=AEBO Order;");
dropdownlist([2,17],"mylist",{"refer":"F[Order Type]","width":30,"process":test_dropdown});

Script Details


Tips and Tricks

  • dropdownlist

    This example explains on how to restrict dropdownlist values and execute a function automatically when a value is selected from the dropdownlist. 

    dropdownlist([1,0],"mylist",{"refer":"F[Industry sector]","width":30,"process":test_dropdown});

    Learn more about dropdownlist on SAP Screens