cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown in WDA

Former Member
0 Kudos

Hi all,

Can anyone send me the step by step procudre or tutorial for developing application using dropdown in Webdynpro ABAP?.

Regards,

Shanthi

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Shanti,

there are 2 kinds of dropdowns in WDA. (Dropdown by index & key) they differ in the nature of binding properties. Just have a look at the info below:

Index Binding:

1) Selecting a value leads to a round trip only if the corresponding event property is bound to an action.

2) Selecting a value will change the lead selection.

3) The data stored in the context will not be changed by selecting any value.

Key Binding:

1) Selecting a value leads to a round trip only if the corresponding event property is bound to an action.

2) Selecting a value will not change the lead selection.

3) The data stored in the context element at lead selection will be overwritten by the key value related to the selected data.

Regards,

Uday

Answers (5)

Answers (5)

uday_gubbala2
Active Contributor
0 Kudos

As a reference you can try go through this [free sample version|http://www.sap-press.de/download/dateien/1079/sappress_web_dynpro_for_abap.pdf] of Ulli Hoffman's textbook Web Dynpro For ABAP. Go through section 3.3.1 "Using Dropdown Lists". Hope that this helps resolve your problem.

Regards,

Uday

Former Member
0 Kudos

for drop down by key , proceed like above ;

except mantain the cardinlaity as 0..1 . Here is a code for your refernce :


-> TYPES: BEGIN OF str_roles,
  ->  role TYPE z0cz_roles-role_id,
 ->  END OF str_roles.

  ->DATA: it_role TYPE TABLE OF str_roles,
   ->    wa_role TYPE str_roles.

  ->DATA:          value1 TYPE wdy_key_value,
    ->       set TYPE wdy_key_value_table.


 -> SELECT role_id FROM z0cz_roles INTO TABLE it_role.

->SORT IT_ROLE DESCENDING BY ROLE.
->  LOOP AT it_role INTO wa_role.
 
  ->  value1-key = sy-tabix.
  ->  value1-value = wa_role-role.
  ->  APPEND value1 TO set.
   ->  ENDLOOP.

->  DATA : node_info TYPE REF TO if_wd_context_node_info.
 -> node_info = wd_context->get_node_info( ).
->  node_info = node_info->get_child_node('CN_DROPDOWN').
  ->node_info->set_attribute_value_set( name = 'CA_ROLE'   value_set = set ).

regards,

amit

Former Member
0 Kudos

hi ,

this sample code wud help u

suppose I have created a node CN_SYSTEM with att SYS_DESC ( this is field name in my table z2ts_systems )

proceed like this :


->DATA : it_sys      TYPE STANDARD TABLE OF z2ts_systems .

-> SELECT *
  ->  FROM z2ts_systems
   ->   APPENDING TABLE it_sys.

->DATA lo_nd_cn_system TYPE REF TO if_wd_context_node.

->* navigate from <CONTEXT> to <CN_SYSTEM> via lead selection
 -> lo_nd_cn_system = wd_context->get_child_node(
 -> name = wd_this->wdctx_cn_system ).

->  lo_nd_cn_system->bind_table( it_sys ).

I hope it wud help

regards,

amit

Former Member
0 Kudos

hi

if u r using drop down by index , than proceed like this :

1 declare a context node of cardinality 0..n

2 declare attribute of type string under it . The attribute name should be exactly the same as that in database table '

eg if u want to poulate values for a field ' SYS' from table , than giv the attribute name as 'SYS' in context attribute

3 declare internal table of type standard table

4 populate internal table with values

5 take the refernce of the node , u have created

6 bind it with the internal table

the dropdown by index wud nw contain app values

regards

amit

Former Member
0 Kudos

Check standard component WDR_TEST_EVENTS Regards, Radhika