cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting drop down by key

Former Member
0 Kudos

Hi All,

Is there any way to sort drop down by key by value. currently it is sorting values in drop down according to keys of those values.

Regards

Amit

Accepted Solutions (1)

Accepted Solutions (1)

pranav_nagpal2
Contributor
0 Kudos

Hi Amit,

There is no direct way to sort drop down by key.... you can use drop down by index.... in drop down by key sorting is possible only by creating your own table type if you have access to se11.......

regards

Pranav

Former Member
0 Kudos

Hi Pranav,

it is not feasible to change the drop down as coding will also change and might result in complications....

please explain the table type option..... thanks in advance...

regards

Amit

Former Member
0 Kudos

hi

to sort ddk u have to create a table type which is not sorted.

for that go to se11->datatype->tabletype

there u have to give line type as WDY_KEY_VALUE,

in KEY TAB

key definition key component key category nonunique

in key components give 'KEY'

in INITIALIZATION AND ACCESS

Standard Table

this will create table type which is not sorted but satandard.

DATA LR_NODE_INFO TYPE REF TO if_wd_context_node_info.

data ls_value type wdy_key_value.

data lt_value_set type 'YOUR TABLE TYPE NAME'.

ls_value-key = 'y'.

ls_value-value = 'yes'.

append ls_value to lt_value_set.

ls_value-key = 'n.

ls_value-value = 'no'.

append ls_value to lt_value_set.

.


here a sort statement or in wtever order u want append the values accordingly.

sort lt_value_set by value.

lr_node_info = wd_context->get_node_info( ).

lr_node_info = lr_node_info->get_child_node( YOUR NODE ).

lr_node_info->set_attribute_value_set( name = 'YOUR ATTRIBUE BINDED TO DDK'

value_set = lt_value_set ).

REgards

govi

Answers (1)

Answers (1)

Former Member
0 Kudos

drop down by key UI element does not support this thing.

Best regards,

Rohit