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

sorting internal table by date

Hello experts,

i wat to sort internal table in asscending order and am using the code as follows,

APPEND wa_final TO it_final.

sort it_final by edatu vbeln ASCENDING.

am getting output as 05.09.2008

10.09.2008

27.08.2008

but i want in 27.08.2008

05.09.208

10.09.2008

please help me ASAP.

Thanks,

vino....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 09:32 AM

    Hi,

    sort only with date , not with VBELN.

    U will get the correct answer.

    Thanks and Regards

    Ganesh Reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 07:21 AM

    Hi

    I think you uploaded date field as your output format. If it is in ddmmyyyy format, when you sort it, automatically it will sort. Check your input entries.

    Otherwise, what you had written is correct.

    check your code

    Regards,

    Dhanunjaya Reddy.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 07:24 AM

    Is your edatu field TYPE CHAR10 or sy-datum.

    It has to be type sy-datum to be sorted properly.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 07:25 AM

    Change your SORT statement as below

    sort it_final by edatu ASCENDING vbeln ASCENDING.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 11:14 AM

    hi vinoth,

    if u make the format of the field edatu as YYYYMMDD and den put the sorting conditon on it.. then it will sort correctly.. rest vbeln is not a problem. beacuse if u have more than one similar date entry u have to sort it thru vbeln too..

    so just try changing format..

    regards

    palak

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 11:19 AM

    Write as sort it_final by vbeln edatu ASCENDING.

    Regards

    Sandipan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2011 at 04:58 AM

    Assigned the date fied to char and then sorted then it works fine.

    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.