Skip to Content
author's profile photo Former Member
Former Member

Search Help output sorting issue

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

PROGRAM_03.png (21.4 kB)
SEARCHHLP_02.png (23.2 kB)
FUNCEXIT_01.png (17.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2014 at 09:57 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2014 at 09:34 AM

    Hi Adrian,

    Can you write like below after filling internal table

    Sort gt_out by uzeit by descending.

    Arivazhagan S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2014 at 09:35 AM

    Hi,

    In 'DISPLAY' event, add the sorting logic.

    IF callcontrol-step = 'DISPLAY'.

    SORT xyz by uzeit descending.

    ENDIF.

    Regards,

    DPM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2014 at 10:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2014 at 10:09 AM

    Hi,

    Write below code in your exit at last,

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

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2014 at 10:26 AM

    Hi Adrian

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

    Nabheet

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2014 at 10:47 AM

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

    Thanks!

    VS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2014 at 12:19 PM

    Thanks Hemanth

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.