Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sorting drop down by key

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

Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question