Purpose With DropDownList you  can generate a drop down list. It can be used for input in SAP ERP standard fields or for your own variables.

DropDownList (10,1) "currencylist" refer="F[Currency]"  width=20

A drop down list is displayed. The list items are taken from the long text "currencylist". The selected value is put into the standard entry field F[Currency].

DropDownList (4,1) "countrylist" refer="V[XD_country]"  width=24

A drop down list is displayed. The list items are taken from the long text "countrylist". The selected value is put into the GuiXT variable V[XD_country].


Format 1 DropDownList (row,column) "longtext" refer="name"   

To display the drop down list, the content of the long text variable "longtext" is interpreted as follows:

  • Each line of the text represents an item of the drop down list
  • In addition, you can use a semicolon as delimiter if you prefer to describe numerous items in one line
  • A drop down list item can consist of a field value, e.g. a currency such as EUR, SFR, ... Or it can contain both the internal value and a descriptive text. The text is visible in the drop down list and the value is put into the entry field or variable when the user selects the item. The format, when you specify both a value and a text, is: value=text. Example: "OR=Standard order".
  • You may include a text with a blank value. This text will be shown if the variable or entry field is empty. Example: "=--- Select order type ---"

You can fill the long text variable with fixed values defined in your script (Example 1), or read a separate file where you maintain the items, or read the values from the SAP ERP database, e.g. the search help values (Example 2).

Format 2 DropDownList (row,column) table="V[varname]"    refer="name"   

The selection list is built from the GuiXT table variable V[varname]. The first column is the key, the second the text.
The keys are automatically displayed if the SAP GUI option is set to "Display key values" or the -showkeys option is specified.

process= Specifies an InputScript that is processed when the user selects an item from the dropdown list
width= Width of drop down list (columns). Default is 16.
Textfont= Selected font. Default is "Arial" .
Textheight= Text height in pixels. Default depends on SAP GUI font size.
Textweight= Text weight between 1 (thin) and  9 (heavy). Default is 5. Bold is approximately 7.
-readonly No selection possible
-nosort The drop down list is displayed without prior sorting
-showkeys The key values are displayed before the text (only in connection with table=)
-hidekeys The key values are not displayed (only in connection with table=)
-hidetext The text is not displayed in the header field of the drop down list (only in connection with table=)
Example 1 // VA01 order type: drop down list with selected order types
F[Order Type] -triple
text[ordertypes] "=--- Select order type ---;OR=Standard order;CS=Cash sale;RE=Returns;"
(2,0) "ordertypes" refer="F[Order Type]" width=30
Example 2

// Order reason selection according to SAP table TVAUT

// Create GuiXT structure and table variables for the Open Call interface

CreateStructure V[ui_ddltabline] key text
CreateTable V[ui_ddltab_va01_augru] key text
// Set parameters to read the text table
Set V[ui_table] "TVAUT"
Set V[ui_condition] "SPRAS = '&V[_language]' "
Set V[ui_fields] "AUGRU,BEZEI"
// Read the table via RFC
Call /guixt/dbselect _
export.table="ui_table" _
export.condition="ui_condition" _
export.fields="ui_fields" _
// add an empty entry (will automatically become the first entry)
Clear V[ui_ddltabline]
AppendRow V[ui_ddltabline] table=V[ui_ddltab_va01_augru]

// Display the dropdown list
(19,2) "Order reason" size=28 -label
DropDownList (19,30) table=V[ui_ddltab_va01_augru] width="50" refer="V[ui_va01.augru]"


Components GuiXT + InputAssistant