dropdown Values

beasscript-logo-small

BS: Define Values for drop-down with 2 fields:

1. The ID

2. The Value

The system displays only the value

 

Example: In item master data - breakdown you see the text but in field self the ID of breakdown is saved.

dropdownVariant1

 

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 is not defined, ID and Value are 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 drop-down icon is not available and it's not a list, this command creates the icon automatically.

 

Values with select

Alternative you can use a select statement

This will be executed directly and not when the drop-down is opened.

 

Needed if content and identifier are different.
Note: Fields must be from type "Char". Other data types are not supported.

item.mycolumn.dropdown.values=select=id,diysplay

 

Identifier may need to be converted with convert(char(x),idcolumn)

 

Note: if you need a drop-down related to other definitions, 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 displays 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