‎2007 Aug 15 6:13 PM
I have a SELECT statement that is bogging down the performance of my report. Can this be converted into 2 READ's. Any ideas on how to improve the performance of this code. Thanks.
SELECT SINGLE qals~prueflos qals~aufnr qals~selmatnr afpo~dauat afpo~dwerk
FROM ( qals
INNER JOIN afpo ON afpo~aufnr = qals~aufnr )
INTO (qals-prueflos, qals-aufnr, qals-selmatnr, afpo-dauat, afpo~dwerk)
WHERE qals~matnr = collector-matnr
AND qals~charg = collector-charg
AND qals~art = c_manualinsp
AND qals~herkunft = c_gr_prod.
‎2007 Aug 15 6:18 PM
HI,
Write two select instead of this join..
select single prueflos aufnr selmatnr from qalis into wa_qals where matnr = collector-matnr
and charg = collector-charg
AND art = c_manualinsp
AND herkunft = c_gr_prod.
if sy-subrc eq 0.
select aufnr dauat dwerk from afpo where aufnr = wa_qals-aufnr...
if sy-subrc eq 0.
your logic
endif.
endif.
Thask
mahesh
‎2007 Aug 15 6:18 PM
HI,
Write two select instead of this join..
select single prueflos aufnr selmatnr from qalis into wa_qals where matnr = collector-matnr
and charg = collector-charg
AND art = c_manualinsp
AND herkunft = c_gr_prod.
if sy-subrc eq 0.
select aufnr dauat dwerk from afpo where aufnr = wa_qals-aufnr...
if sy-subrc eq 0.
your logic
endif.
endif.
Thask
mahesh
‎2007 Aug 15 6:28 PM
‎2007 Aug 15 6:29 PM
Not always...I think it depends on wether your are using the complete key, index and amount of data....but not really sure -:P
Greetings,
Blag.
‎2007 Aug 15 6:58 PM
Did you find Answer ?
QALS - Key field PRUEFLOS ,you are not using here
if not see the my comments
if you do not have key field(Where condition) when you use select single ,then do not use select single command.
instead of select single ,use select up to 1 row ,see the performance now.
if you need help on select up to 1 row then see the saphelp.
Thanks
Seshu