2005 Jul 28 4:58 PM
Hi,
Can someone tell me how to combine follwoing two queries in one so that it will increase performance..
SELECT single PLNNR from AFKO
into T1
WHERE AUFNR = '007200000100'.
SELECT single STATU from PLKO
into T2
WHERE PLNNR = T1.
2005 Jul 28 5:02 PM
check out the JOIN option
SELECT single Fplnnr pSTATU
INTO (t1, t2)
FROM AFKO AS F INNER JOIN PLKO AS P
ON Fplnnr = Pplnnr
WHERE AUFNR = '007200000100'.
2005 Jul 28 5:02 PM
check out the JOIN option
SELECT single Fplnnr pSTATU
INTO (t1, t2)
FROM AFKO AS F INNER JOIN PLKO AS P
ON Fplnnr = Pplnnr
WHERE AUFNR = '007200000100'.
2005 Jul 28 5:07 PM
2005 Jul 28 5:11 PM
oops....
sorry u cant use select single in a sub query
the syntax of a subquery is quite restricted...the link will give you the details...
but in any case....either u use joins or subqueries...i dont think there will be a major impact on performance in this particular case that you have specified.
regards,
PJ
2005 Jul 28 5:06 PM
using subqueries it is possible
select single statu from plko into t2 where plnnr in (select single plnnr from afko where aufnr eq '007200000100').
read about subqueries at this link...
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
regards,
PJ