Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Search Help output sorting issue

Former Member
0 Likes
5,257

Hi

Please see attachments. I created a search help and a function module exit as extract method. This is linked to my program parameter and works fine. However, the user would like the output to be sorted in descending order of time. The extract is only for current date. How can I do this in the search help? I'm already sorting the data during the SQL, but when it outputs, the sorting is according to the key field and in ascending order. I'd like it to be descending by default, but don't find a setting to do so? Please assist.

Thanks,

Adrian

1 ACCEPTED SOLUTION
Read only

Former Member
3,106

You can change the default sort order for search help by using this FM 'F4UT_PARAMETER_SORT'

Eg.:

If you want a table to be sorted by carrid and connid,

data:

  w_sort(20) type c value 'CARRID CONNID'.

Now pass w_sort to the parameter  PARAMETER_SORT in the FM.

Dont call the FM twice. Use a character work variable which has the field names separated by space and pass that work variable to the FM.

8 REPLIES 8
Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
3,106

Hi Adrian,

Can you write like below after filling internal table

Sort gt_out by uzeit by descending.

Arivazhagan S

Read only

Former Member
0 Likes
3,106

Hi,

In 'DISPLAY' event, add the sorting logic.

IF callcontrol-step = 'DISPLAY'.

SORT xyz by uzeit descending.

ENDIF.

Regards,

DPM

Read only

Former Member
3,107

You can change the default sort order for search help by using this FM 'F4UT_PARAMETER_SORT'

Eg.:

If you want a table to be sorted by carrid and connid,

data:

  w_sort(20) type c value 'CARRID CONNID'.

Now pass w_sort to the parameter  PARAMETER_SORT in the FM.

Dont call the FM twice. Use a character work variable which has the field names separated by space and pass that work variable to the FM.

Read only

Former Member
0 Likes
3,106

In your case pass variable UZEIT

data:

  w_sort(20) type c value 'UZEIT'.

Now pass w_sort to the parameter  PARAMETER_SORT in the FM.

set decending flag also

U will get it...

Rewards if helpful

Regards,

Hemanth

Read only

Former Member
0 Likes
3,106

Hi,

Write below code in your exit at last,

case callcontrol-step.
when 'DISP'.
    Sort gt_out by uzeit by descending.
endcase.

Regards,

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,106

Hi Adrian

You are doing sorting in SELECT but do this in last DISPLAY step

Nabheet

Read only

vishal_sharda2
Participant
0 Likes
3,106

Sorting data while selecting will not help. You need to sort the data while display.

Thanks!

VS

Read only

Former Member
0 Likes
3,106

Thanks Hemanth