cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting Internal Table field value as Text

0 Kudos

Hi Guys,

I need your support to resolve this issue, Based on the Business Partner drop down value we need to display the Work Flow Type values in ascending order. I've done sorting ITab in ascending as Text. but it is showing the value WorkFlow Glutz before the value Text.

For reference: see the attached pic.

Accepted Solutions (0)

Answers (3)

Answers (3)

mmgc_riel
Participant
0 Kudos

Hi,

I use a key_value list. Sorted of key and then i bind the value to dropDownByIndex

  DATA:

    ls_key_value                    TYPE wdy_key_value,

    lt_key_value                     TYPE wdy_key_value_list,

    lo_nd_ct_key_value         TYPE REF TO if_wd_context_node.

  lo_nd_ct_key_value = wd_context->get_child_node( name = wd_this->wdctx_ct_key_value ).

  ls_key_value-key   = 'A'.

  ls_key_value-value = 'text for A'.

  APPEND ls_key_value TO lt_key_value.

  ls_key_value-key   = 'B'.

  ls_key_value-value = 'text for B'.

  APPEND ls_key_value TO lt_key_value.

sort lt_key_value by key.

  lo_nd_ct_key_value->bind_table( new_items = lt_key_value set_initial_elements = abap_true ).

The idea is here to fill the list with all allowed/available entries.
I also use this for gettings domain values and then add the '...' or 'none' to the allowed values.

Hope it helps.

Maarten

ramakrishnappa
Active Contributor
0 Kudos

Hi Jayaram,

Let us say, you have a field WFTYPE and sort the records before binding to context as drop down list.

sort ITAB by WFTYPE. ( by default ASCENDING order ).

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi

Try ascending order by field name.

Thanks

KH