cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdowns in Web Dynpro Table with random selection and w/o any lead selection.

Former Member
0 Kudos

Hi All,

My requirement is: I have a Web Dynpro Table in that on the toolbar I have 2 buttons (Add & Remove) on click of add button i am adding one blank row with 8 column all are input fields (in which 3 are drop down columns) to the table now in that blank row i have to fill 3 drop downs(all are independent). at random user can select any of the drop down if he has added 2 or 3 records w/o any lead selection. now I have to get  all the record of  the table on click on other button called submit.

How can i do this, Can any one help me out this.

Help will be appreciated.

Thanks a lot in advance.

Saurabh Shrivastava.

+91 8951319801

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I did not understand your question exactly.

As per my understanding you want to get all the data in the table on Submit.

If so, Just use GET_STATIC_ATTRIBUTES_TABLE method. This method returns all the data in the table.

Former Member
0 Kudos

Hi Khushboo,

Thanks for the reply. I have 2 Questions.

1. Actually i am not able to fill the drop downs, can you tell me in which method i can fill the drop downs. So that when ever i press the add button the drop downs will be filled.

2. In Node ( by which the table is binded) I have 3 different attributes (for each i am using the drop downs) so i have to set the attributes when user selects a drop down. i am filling those attributes in the method on_select of drop down but later if i select that row using lead selection then the drop downs values are getting reset.

My Node Structure is like this

Table_node                         0:N

    |__

          attribute 1

          attribute 2

          DD_NODE1                 0:N

               |__

                        Key

                        Value

          attribute 3

          attribute 4

          DD_NODE2                 0:N

               |__

                        Key

                        Value

          attribute 5

          attribute 6

          DD_NODE3                  0:N

               |__

                        Key

                        Value


I have to send the Key Values to DB Tables.

Hope you can understand my requirements now.

Thanks a lot

Saurabh Shrivastava

Former Member
0 Kudos

Hi Saurabh,

I understood your requirement now.

This is what you can do.

1. In your table, use DropDownByKey UI element for all drop downs.

If you do this, you do not need to create 3 nodes within the main node.

Say you have 5 columns in the table, and 3 of them are Drop Downs, even then you only need one node with the structure

     TABLE_NODE

          ATT1

          ATT2

          ATT3

          ATT4

          ATT5

Now your node is in place.

2. Write this sort of code in WDDOINIT method to fill your drop downs.

     DATA: lt_valueset TYPE wdr_context_attr_value_list,

               ls_valueset TYPE wdr_context_attr_value.

     DATA: lo_node_info TYPE REF TO if_wd_context_node_info,

               lo_node        TYPE REF TO if_wd_context_node.

     ** Now fill the lt_valueset table. This table has two fields. 1. Value 2. Text.

     ** You can fill the text to be displayed in TEXT field and value to be passed to your DB table in           ** VALUE field.

     ** Once your lt_valueset table is filled, write the following code.

     lo_node = wd_context->get_child_node( 'TABLE_NODE' ).

     lo_node_info = lo_node->get_node_info( ).

     lo_node_info->set_attribute_value_set(

     EXPORTING

          name = 'ATT1'  * Attribute name of the drop down

          value_set = lt_valueset ).    * This will fill the dropdown for ATT1 attibute

     ** You can refill the lt_valueset table with different values now and fill other 2 dropdowns in the           ** same way

     Now whenever you add an element to the context node, the drop downs will be automatically filled with the values.

Message was edited by: Khushboo Sachdeva

Former Member
0 Kudos

Also, Now you do not need to handle any events.

Whatever data the user selects in the drop downs will be available in your attributes of context node.

On submit, just get the data in the table using GET_STATIC_ATTRIBUTES_TABLE method.

Former Member
0 Kudos

Hi Khushboo,

Its Done..  

Thanks a Lot

Saurabh Shrivastava

Answers (0)