BS: Define Values for dropdown with 2 fields:
1. The Id
2. The Value
The system display only the value
Example: In item master data - breakdown you see the text but in field self the id of break down is saved.
The definition of this type of dropdowns is in
global function form_opened
dw_1.item.utf1.dropdown.values=...
end global
Defintion:
item.mycolumn.dropdown.values=red=1,blue=2,white=3
If Value not defined, then Id and Value is the same
item.mycolumn.dropdown.values=red,blue,white
You can save the properties in a variable
setvar=ls_value=blue,red,white
item.mycolumn.dropdown.values=variable=ls_value
with standard-list you can use a id
(see program/dropdown.ini)
item.mycolumn.dropdown.values=:usercode
info: beas save master-data-entrys in memory (better performance)
List of existing in memory values:
type |
Description |
fttyp |
Work order types |
usercode |
SAP User Code (System save USER_CODE and display "U_NAME) from OUSR |
statusprjheader |
List of Status from Project header (TYP=H) |
statusworkorderheader |
List of Status from Work order header (TYP=W) |
statusworkorderpos |
List of Status from Work order Pos (TYP=P) |
importstatus |
List of Status for Import (TYP=I) |
If the dropdown icon not available and it's not a list, this command create automatically this icon.
Values with select
Alternative you can use a select statement
This will be executed directly and not when the Dropdown will be opened.
Needed if content and identifier are different.
Note: But fields must by from type "Char". Other data types not supported
item.mycolumn.dropdown.values=select=id,diysplay
Identifier maybe needs to be converted with convert(char(x),idcolumn)
Note: if you need a dropdown related to other definitions, then you must reload the value list.
Don't forget: The system can show the value only, if defined in the values list. Otherwise the system display the id in the column.
Translation
It is possible to translate the value at runtime
item.mycolumn.dropdown.valuestranslate=select=id,display
Example:
In a List view i want to insert the
Example Pricelist-Dropdown in Field userfield1 in dw_4
dw_4.item.userfield1.dropdown.values=select convert(char(2),listnum),listname from opln order by listnum