ABAP web dynpro Dropdown default value, allow you to set current value of dropdown UI element
Below are the simple steps required to set an abap web dynpro dropdown field (UI element) to be a value other than the first value in the drop down table.
**************************BEGIN*
*EXISTING CODE TO BUILD DROPDOWN
********************************
* create local data variable to access context information
Data: context_node type ref to if_wd_context_node.
* create table based on context structure
Data: it_carriers type STANDARD TABLE OF if_view1=>element_DROPDOWN_CARRIERS,
wa_carriers like line of it_carriers.
select *
from scarr
into table it_carriers.
context_node = wd_context->get_child_node( name = 'DROPDOWN_CARRIERS').
context_node->BIND_TABLE( it_carriers ).
****************************END*
DATA: index type i.
* Set displayed value of dropdown by index UI element.
index = 3. "sets dropdown value to the third entry in the drop down table
context_node->set_lead_selection_index( index = index ).
Step 2 - Save, Activate and Run |
||||||||