2007 Jul 27 4:12 PM
Hi All,
We are trying to immitate the standard transaction COOIS but with some extra features to get a report.
We have a particular select in the custom code which is timing out and taking an unusually long time(infact never finished the select) if run in background.
*******************************
Custom Code
*******************************
SELECT RUECK
RMZHL
LMNGA
IEDD
MANUR
AUFNR
APLFL FROM AFRU
INTO TABLE GT_AFRU
FOR ALL ENTRIES IN GT_AFVC
WHERE RUECK = GT_AFVC-RUECK
AND RMZHL = GT_AFVC-RMZHL
AND MANUR = '1'
AND APLFL NE ' '.
*****************************************
Standard Code
*****************************************
SELECT * FROM afru INTO TABLE afru_tmp
FOR ALL ENTRIES IN rueck_tmp
WHERE rueck = rueck_tmp-rueck
AND ( canum = canum_0
OR canum IS NULL ).
The standard code returns the entries in blink of the eye whereas the custom code runs on for ever. Both the for all entries tables have the same entries and use the same primary key.
I also tried to fetch data from the table directly using SE16 and I input only 10 confirmations(RUECK-primary key) into the table and I try to execute this in background and it also seems to run for ever. Does anyone have any idea what is going wrong here? Pointers will be appreciated.
Regards,
Karthik
2007 Jul 27 4:14 PM
YOu should make a check if the table GT_AFVC has any entries in it or not.
if not GT_AFVC[] is initial.
SELECT RUECK
RMZHL
LMNGA
IEDD
MANUR
AUFNR
APLFL FROM AFRU
INTO TABLE GT_AFRU
FOR ALL ENTRIES IN GT_AFVC
WHERE RUECK = GT_AFVC-RUECK
AND RMZHL = GT_AFVC-RMZHL
AND MANUR = '1'
endif.
2007 Jul 27 4:14 PM
YOu should make a check if the table GT_AFVC has any entries in it or not.
if not GT_AFVC[] is initial.
SELECT RUECK
RMZHL
LMNGA
IEDD
MANUR
AUFNR
APLFL FROM AFRU
INTO TABLE GT_AFRU
FOR ALL ENTRIES IN GT_AFVC
WHERE RUECK = GT_AFVC-RUECK
AND RMZHL = GT_AFVC-RMZHL
AND MANUR = '1'
endif.
2007 Jul 27 4:29 PM
Well, I have clearly mentioned that the 'for all entries tables have same no. of entries', it implies that GT_AFVC isnt empty. I have also mentioned that the direct query on the table through SE16 with the same selection data is also not returning anything and running into long hours.
2007 Jul 27 4:36 PM
The table AFRU has an index on RUECK and should not have a problem atleast in theory. I will wait along with your for the answer.
Regards,
Ravi
2007 Jul 27 4:19 PM
I think your GT_AFVC is empty so , select is trying to dump everything from that table.
Check with that
and put a condition to check the entries in the table