‎2009 Apr 27 8:57 AM
Hi,
how do I sort/order a custom (Z) database table (not internal table) ? Couldn't find a suiting option with F1 for the SORT statement.
Thanks,
Avraham
‎2009 Apr 27 9:02 AM
‎2009 Apr 27 9:08 AM
I have a database table, just like, say MARA or VBAK, but it's not SAP, it's mine.
Was it an internal table, I would work this out with SORT. But I didn't do this yet to a database table.
‎2009 Apr 27 9:10 AM
that is wat i am telling...
now go to se16 ..
give youer table name ...
give F8
THEN you follow the steps of ,my before post you can get it...
‎2009 Apr 27 9:13 AM
‎2009 Apr 27 9:13 AM
Hi,
If you just wanted to VIEW the data in a standard SAP table in a sorted order,
then go to the transaction SE16.
GIve the table name.
Press Enter Button.
Then press F8 (Execute button).
In the screen to folow, yo will get the records of the table.
Put the cursor on the column by which you want to sort, then click on the SORT Button(Acending : CTRLSHIFTF5) or Descendin(CTRLSHIFTF6)
Regards,
Ravi
‎2009 Apr 27 9:27 AM
‎2009 Apr 27 10:25 AM
>
> I have to do this within my program.
Use ORDER BY in your select. Or just select your data into an itab and use SORT. I don't see the problem.
If you mean that you want to sort your table in the database itself, then you can't. Database table rows are not held in any specific order; the order is applied when you select the data out of the table.
‎2009 Apr 27 10:35 AM
Hi,
By default system database table will be sorted based on the primary key fields. So you can change that sequence now. If you want to sort some other field also, which is not primary key, then make that field to primary key.
In the program, it is normal way of sorting by mentioning the required fields. If you don't mention any thing means, it is again based on the primary keys.
Regards,
Santhosh.
‎2009 Apr 27 9:04 AM
yes you cansort...
just make it display in alv format..
go to SETTING -> USER PARAMETERS ...now select alv grid...now you can sort your tables output.
with regrads
janani