‎2008 Feb 01 5:02 AM
Hi,
I'm using following query in my RFC:-
SELECT *
FROM Transactions
UP TO 30 ROWS
WHERE TR_ID >= l_current_tid AND
PHASE = l_phase.
Now I want to ensure that this table Transactions is ordered by TR_ID before this query is executed..
How do I achieve this? Pls help me on this.
Awaiting for reply.
Regards,
Amey
‎2008 Feb 01 5:05 AM
Hi
Hope it will help you,.
Pls reward if help.
SELECT CARRID CONNID MIN( SEATSOCC ) AS MIN
INTO CORRESPONDING FIELDS OF WA
FROM SFLIGHT
GROUP BY CARRID CONNID
ORDER BY CARRID MIN DESCENDING.
WRITE: / WA-CARRID, WA-CONNID, WA-MIN.
ENDSELECT.
‎2008 Feb 01 5:22 AM
Thanks for quick reply..
But im using UP TO statement in query so what is happening is
1. it is first selecting all matched lines
2. Then ordering them by ORDER By condition
3. and then, returning 30 lines out of them..
So I want to sort the table first and then apply the select query..
I hope this better explains my problem..
Regards,
Amey
‎2008 Feb 01 5:22 AM
Hi
1.SELECT the required rows from the database into ITAB without using ORDER BY
2. sort the ITAB
3. Fetch the required data from the ITAB
Note: If u use ORDER BY in SELECT , performance will go down
Narendra