2012 Dec 30 6:09 AM
HI all,
i want to improve performance of my program
could anyone suggest how to avoid this
" SELECT werk UP TO 1 ROWS
INTO l_iwerk
FROM ser03
WHERE obknr IN ( select OBKNR
from OBJK
WHERE equnr EQ p_equnr
AND taser EQ 'SER03' )."
Moderator message: please don't open new discussions for each similar issue, also search for available information before posting.
Message was edited by: Thomas Zloch
2012 Dec 30 6:26 AM
Hi Pavan,
Please try this,
select OBKNR
from OBJK
into table < a table of type objk>
WHERE equnr EQ p_equnr
AND taser EQ 'SER03'.
if sy-subrc = 0.
sort < a table of type objk> by objknr.
SELECT werk
INTO table lt_iwerk
FROM ser03
for all entries in < a table of type objk>
where WHERE obknr IN < a table of type objk>-obknr.
endif.
Regards,
Amit
2012 Dec 30 10:17 AM
If you have no related data in SER03, you would still end up wasting time to fetch all relevant data from table OBJK, apart from hogging memory.
2012 Dec 30 10:15 AM
SELECT Single werk INTO l_iwerk
FROM ser03
Join OBJK
on ser03~obknr eq objk~obknr
WHERE objk~equnr EQ p_equnr
AND objk~taser EQ 'SER03'