cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting a drop down

Former Member
0 Kudos

Hai Experts,

I just want to sort the fields of the dropdown box in webdyn pro. How can I do it? Please help.

Regards,

Srija.

Accepted Solutions (1)

Accepted Solutions (1)

former_member206441
Contributor
0 Kudos

Hi

This code snippet might be helpful for you.


 data: itab type table of zdepdet,          "zdepdet is a ztable with fields empid and empname
       wa like line of itab.

 select * from zdepdet into table itab.
   delete adjacent duplicates from itab comparing dept.


   wa-dept = '--Select--'.
*  wa-ename = 0.
   append wa to itab.
     sort itab ascending by empid.

loop at itab into wa.
  ls_dept-empid = wa-empid.
  ls_dept-dept = wa-dept.
  append ls_dept to lt_dept.
endloop.

*** bind all the elements
  node->bind_table(
    new_items            =  lt_dept
    set_initial_elements = abap_true ).

Regards

Arun.P

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank u so much.

Former Member
0 Kudos

I have a dropdown box with city name, it is already sorted by city ID but now i have to sort it by description. Wat i have to do for this? Plz explain me clearly I am a beginer.

saket_abhyankar
Active Participant
0 Kudos

Hi,

If I am not wrong, you are using DropDownByKey UI element to display drop down list, and binding the table of type 'wdr_context_attr_value_list' to the context attribute. Try to Sort the table by 'TEXT' and then bind it to the attribute. I hope this will help.

Regards,

Saket.

Former Member
0 Kudos

Hi,

While filling the context node bound to drop down node, you have to take care of sorting the data and then binding it.

Regards

Manas Dua