‎2008 Apr 29 8:32 AM
Hi experts,
SELECT AAUFNR ABUKRS AWERKS AKOKRS A~OBJNR
APRCTR BGSTRP BGSTRS CMATNR INTO TABLE
GT_ORDER FROM AUFK AS A INNER JOIN AFKO AS B ON AAUFNR = BAUFNR
INNER JOIN AFPO AS C ON AAUFNR = CAUFNR WHERE A~AUFNR IN SO_AUFNR
AND ABUKRS IN SO_BUKRS AND APRCTR IN SO_PRCTR AND A~WERKS IN SO_WERKS.
IF GT_ORDER IS NOT INITIAL.
SELECT
A~KOKRS
A~BELNR
B~BUZEI
B~WOGBTR
B~OBJNR
B~KSTAR
B~OWAER
A~BUDAT
B~BELTP
FROM COBK AS A INNER JOIN COEP AS B
ON AKOKRS = BKOKRS AND
ABELNR = BBELNR INTO TABLE GT_COVP FOR ALL ENTRIES IN GT_ORDER
WHERE OBJNR = GT_ORDER-OBJNR AND
OWAER = 'INR' AND
KSTAR IN R_COSTGL AND
BUDAT IN SO_BUDAT.
this is the code i have written . in development it is taking less than one minute but in quality it is taking to
too much time . can any help me to reduce the time in quality.
thanks & regards
suri
‎2008 Apr 29 8:50 AM
goto st05 activate the trace.
then run your report.
deactivate the trace. then check when select query is made is the system using any indexes if no then adjust your query as to use indexes or create new if not available.
But be carefull in making indexes since to many indexes may slow down updation and insertion.
Regards
Khusro Habib
‎2008 Apr 29 8:50 AM
goto st05 activate the trace.
then run your report.
deactivate the trace. then check when select query is made is the system using any indexes if no then adjust your query as to use indexes or create new if not available.
But be carefull in making indexes since to many indexes may slow down updation and insertion.
Regards
Khusro Habib
‎2008 Apr 29 8:53 AM
HI Suresh,
I would suggest one correction:
IF GT_ORDER[] IS NOT INITIAL.
Because your statement checks for the header line & this one check for the table.
Hope this helps.
Reward if helpful.
Regards,
Sipra
‎2008 Apr 29 9:01 AM
IF GT_ORDER[] IS NOT INITIAL.
SELECT
A~KOKRS
A~BELNR
A~BUDAT
B~BUZEI
B~WOGBTR
B~OBJNR
B~KSTAR
B~OWAER
B~BELTP
FROM COBK AS A INNER JOIN COEP AS B
ON AKOKRS = BKOKRS AND
ABELNR = BBELNR INTO TABLE GT_COVP FOR ALL ENTRIES IN GT_ORDER
WHERE OBJNR = GT_ORDER-OBJNR AND
OWAER = 'INR' AND
KSTAR IN R_COSTGL AND
BUDAT IN SO_BUDAT.
Better if OBJNR is the first field in internal table GT_ORDER ..
also sort GT_ORDER by OBJNR ...