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

Sorting Internal Table

How to sort an internal table in this format (1 2 3 4 ....) ? Dose it has to follow an append statement ?

Because when I used -


> SORT ITAB DESCENDING BY NUMBER. I'm getting this format (1 2 3 5 4 1).

please help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 06:06 AM

    it's finer i think last 1 show the header value just check it.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 06:13 AM

    hi,

    clear ur header (work area).

    then sort.

    regards

    anver

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 06:16 AM

    i m not clear abt ur requiremtn..

    wht u can do is u can dd a seqno field to ur itab and then sort ur itab by this field in asc or descending order--

    data: begin of itab occurs 0,

    seqno(1) type c,

    pernr like pa0006-pernr,

    data end of itab.

    select pernr from pa0006 up to 10 rows into corresponding fields of itab.

    loop at itab.

    itab-seqno = sy-tabix.

    modify itab index sy-tabix.

    endloop.

    sort itab descending by seqno.

    loop at itab.

    write:/ itab.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 06:19 AM

    Hi,

    When you specify

    SORT ITAB BY NUMBER.

    It will sort no append statement is needed.

    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.