dd by key & dd by index
TRANSCRIPT
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 1/18
Drop Down By KeyUncategorized July 8, 2012
The drop down by Key UI element provides the list of values from the domain fixed values. The cardinality is 1..1 and
type of the attribute to which the UI element is binded must have fixed domain values.
In the above screen I have binded the drop down by key UI element to the attribute of type BSTYP and the drop
down UI element lists all the fixed domain values of the BSTYP.
Note : With the drop down by key UI element we can only have only fixed domain values and if we need some more
option we need to include it in the dictionary domain level only.
If the drop down by Key UI element is binded to a cell editor of a table UI element the drop down can have only
fixed values for all the row item where as the drop down list can be different for each row in drop down by index.
Now let us see an simple example where I am going to set a drop down by key then read and display the value
selected.
Step 1 : Go to SE80 Tcode and create a webdynpro component.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 2/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 3/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 4/18
Provide the id for the UI element, choose a type and press enter.
Properties of the lable UI element.
We will set the label for property after creating the drop down UI element.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 5/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 6/18
Now set the label for property of the lable UI element to point drop down
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 7/18
Insert a text view UI element and bind the text property of the UI element to the attribute text.
Binding the property text of text view to the attribute text.
Step 4 : Do the following in the event handler method for the drop down.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 8/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 9/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 10/18
Step 6 : Create an application and test the application.
Output :
Select an element from a drop down.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 11/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 12/18
Add an attribute text to the context node drop.
Create one more attribute in the root context node to be binded to the text view.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 13/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 14/18
Bind the binding text property of the UI element drop down to the text attribute of context node drop.
Create an event handler method for the drop down.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 15/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 16/18
Step 5 : In the event handler method, write the following codes.
Step 6 : Save and activate the whole component.
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 17/18
7/27/2019 DD by Key & DD by Index
http://slidepdf.com/reader/full/dd-by-key-dd-by-index 18/18
Choose a value from a drop down.