cancel
Showing results for 
Search instead for 
Did you mean: 

Using DropDown in a TABLE- WebDynPro

Former Member
0 Kudos

HI

Can any body help me to use dropdown control in table and also setting the default value for the drop down.

DATA: lx_current_controller TYPE REF TO if_wd_controller,

lx_node TYPE REF TO if_wd_context_node_info,

lx_element TYPE REF TO if_wd_context_element,

ls_value TYPE wdy_key_value,

lt_value_set TYPE wdy_key_value_table.

DATA node2 TYPE REF TO if_wd_context_node.

lx_current_controller = wd_this->wd_get_api( ).

CLEAR ls_value.

ls_value-key = '1'.

ls_value-value = 'H'.

INSERT ls_value INTO lt_value_set[] INDEX 1.

ls_value-key = '2'.

ls_value-value = 'P'.

INSERT ls_value INTO lt_value_set[] INDEX 2.

ls_value-key = '3'.

ls_value-value = 'S'.

INSERT ls_value INTO lt_value_set[] INDEX 3.

This is the code which I am using right now and here I am not using any aditional node,

If I converted the dropdown type in to DropDownByIndex then the additonal node is required, I have given it one node inside another, the parent node is assigned as datasource for Table

But the selected value cannot be taken back

The code used is

node_tb = wd_context->get_child_node( name = wd_this->wdctx_tb ).

node_nn = node_tb->get_child_node( name = wd_this->wdctx_nn ).

The first statement is working fine but the second statement gives an error,

node nn is inside node tb

Pls help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If there is a context named 'AUTHORISATIONS'with attribute'AUTHORISATIONS'

then write the following code in wddoinit().

  • Data Declarations for dropdown...................................................

DATA: lo_nd_authorizations_info TYPE REF TO if_wd_context_node_info,

lt_dbtag_set TYPE wdy_key_value_table,

dbtag_key_item TYPE wdy_key_value,

lo_nd_authorizations TYPE REF TO if_wd_context_node.

***********************************************************************************

  • Step1 - Initialize the values for the dropdown menus in authorization column.

***********************************************************************************

lo_nd_authorizations = wd_context->get_child_node( name = wd_this->wdctx_authorizations ).

dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_adm.

dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_adm.

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_upd.

dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_upd.

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_rea.

dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_rea.

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_non.

dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_non.

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

lo_nd_authorizations_info = lo_nd_authorizations->get_node_info( ).

lo_nd_authorizations_info->set_attribute_value_set( name = 'AUTHORISATIONS' value_set = lt_dbtag_set )

Former Member
0 Kudos

Hi

What I need is not menu, But Table and also help me how to get back the data from Table which contains dropdown list as an element in every row

Former Member
0 Kudos

Hi,

So now you have one subnode for drop down. using supply function or Bind_table method pass the required data to that sub node.

Then Bind the Drop down box with the particular attribute from your Sub node.

If the sub node has the data means surely it will displayed in the Drop down list box.

Thanks.

Former Member
0 Kudos

HI Viji

It is exactly what you told, But how to take back the selected data from different rows of the table , if there is any material available, please send to shabeebkv at gmail

Former Member
0 Kudos

Hi,

Sorry I don't have any material. But you can check the standard application WDR_TEST_EVENTS.

In that application some examples are there for table with drop down box.

Thanks.

Former Member
0 Kudos

HI viji

WDR_TEST_EVENTS does not contain any selection example it only contain example about how we can add data to dropdown which is used with a Table.

If you can pls help

Wth Thanks

Former Member
0 Kudos

Hi,

So you filled your drop down with Data's. Now the problem is You need the seleced data from the list box. Is it so?

Then you have to write the coding at OnSelect Event. In that event handler, Using code wizard read the Attribute which supplies the data's to your drop down.

For Example, You have One subnode and its structure is Sflight. Now you binded your dropdown with CARRID attribute menas, The selected value is now stored in the same CARRID.

Thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Did you used Supply function for your nodes?

For Dropdown with in a table best advice is Use a separate node with supply function.

Thanks.