cancel
Showing results for 
Search instead for 
Did you mean: 

Values in the drop down

Former Member
0 Kudos

Hi all,

I am using a dropdownbykey and all the values are getting fetched from a table in the dropdown. But apart from that values a want to add one more value by hard coding. And the value which I am inserting in the dropdown by hard coding it should come on the first position of the dropdown.

I am using following code to fetch values in drop down from table ZINSP.

node_info = wd_context->get_node_info( ).

node_info = node_info->get_child_node( 'CN_PROVIDER' ).

call method cl_wd_dynamic_tool=>get_table_data

exporting

tab_name = 'ZINSP'

row_count = 0

importing

data = it_ZINSP.

loop at it_ZINSP assigning <TableZINSP> .

if <TableZINSP>-ZLAND1 eq lv_ca_destination.

value-key = <TableZINSP>-ZINSPCD.

value-value = <TableZINSP>-ZINSPDE .

insert value into table value_set.

endif.

endloop.

node_info->set_attribute_value_set( name = 'CA_PROVIDER' value_set = value_set ).

  • How it is possible ??? *

Regards,

Rohit Makkar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rohit,

Do this.

node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node( 'CN_PROVIDER' ).
call method cl_wd_dynamic_tool=>get_table_data
exporting
tab_name = 'ZINSP'
row_count = 0
importing
data = it_ZINSP.

value-key = '1'.
value-value = 'First Value'.
insert value into table value_set.

loop at it_ZINSP assigning <TableZINSP> .
if <TableZINSP>-ZLAND1 eq lv_ca_destination.

value-key = <TableZINSP>-ZINSPCD.
value-value = <TableZINSP>-ZINSPDE .
insert value into table value_set.
endif.
endloop.

That will do the required.

Regards,

Kinshuk

Former Member
0 Kudos

Hi,

You have to do simple modification to your code..

insert value into table value_set index 1.

then the record is first record of table.

Thannks

Suman