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].
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 database, e.g. the search help values (Example 2).
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.
Options
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 withtable=)
Example 1
GuiXT
// VA01 order type: drop down list
// with selected order types
del F[Order Type] -triple
Set text[o1] "=--- Select order type ---;"
Set text[o2] "OR=Standard order;"
Set text[o3] "CS=Cash sale;"
Set text[o4] "RE=Returns;"
Set text[ordertypes] "&text[o1]&text[o2]&text[o3]&text[o4]"
DropDownList (2,0) "ordertypes" _
refer="F[Order Type]" width=30
Example 2
GuiXT
// 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" _
import.values="ui_ddltab_va01_augru"
// 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
Text (19,2) "Order reason" size=28 -label
DropDownList (19,30) table=V[ui_ddltab_va01_augru] _
width="50" refer="V[ui_va01.augru]"