04-21-2008 11:06 AM
i am having one report with following code i have to change it.
LOOP AT IT_CSSL INTO WA_CSSL.
LOOP AT IT_AUFK INTO WA_AUFK.
SELECT SINGLE BELNR PERIO WOGBTR MEGBTR OBJNR GJAHR PAROB1 OWAER MEINH MEINB WERKS MATNR BUKRS
FROM COEP INTO WA_COEP WHERE WRTTP = '04' AND GJAHR = S_GJAHR
AND OBJNR = WA_AUFK-OBJNR AND PAROB1 = WA_CSSL-OBJNR.
IF SY-SUBRC = 0.
APPEND WA_COEP TO IT_COEP.
ENDIF.
ENDLOOP.
ENDLOOP.
i modified with for all entries that also not used like below. the following works for single objnr only for more it takes more time.
SELECT BELNR PERIO WOGBTR MEGBTR OBJNR GJAHR PAROB1 OWAER MEINH MEINB WERKS MATNR BUKRS
FROM COEP INTO TABLE IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE WRTTP = '04' AND GJAHR = S_GJAHR
AND OBJNR = IT_AUFK-OBJNR.
CLEAR:WA_CSSL,WA_COEP1.
LOOP AT IT_CSSL INTO WA_CSSL.
READ TABLE IT_COEP INTO WA_COEP WITH KEY PAROB1 = WA_CSSL-OBJNR.
IF SY-SUBRC = 0.
APPEND WA_COEP TO IT_COEP1.
ENDIF.
ENDLOOP.
REFRESH: IT_COEP.
IT_COEP[] = IT_COEP1[].
SORT IT_COEP BY BELNR.
and i create the seondary index for COEP table with key fields mandt, wrttp, gjahr and objnr that is also not working
please help me for this performance change
04-21-2008 11:16 AM
hi Mohan,
The only suggestion i can give is to run the rerport in background and also put all the key field in order of the table/secondary index in the where condition of your select statements..
REgards,
santosh
04-21-2008 11:16 AM
hi Mohan,
The only suggestion i can give is to run the rerport in background and also put all the key field in order of the table/secondary index in the where condition of your select statements..
REgards,
santosh
04-21-2008 11:41 AM
when u r selecting data from coep
then in the selection criteria u dnt have any promary ker parameter to make selection from.
may be u dnt have that kind of requirement if you can some how get one then its ok
then one more thing that i can suggest you is that just put all the primary key fields in the selection criteria
and make rages for and and every one and put star in each of them
i knw its the same means gettign all the data but it recudes soem time for fetching records.
SELECT BELNR
PERIO
WOGBTR
MEGBTR
OBJNR
GJAHR
PAROB1
OWAER
MEINH
MEINB
WERKS
MATNR
BUKRS
FROM COEP INTO TABLE IT_COEP
FOR ALL ENTRIES IN IT_AUFK
WHERE KOKRS IN R_KOKRS
AND BELNR IN R_BELNR
AND BUZEI IN R_BUZEI
AND WRTTP = '04'
AND GJAHR = S_GJAHR
AND OBJNR = IT_AUFK-OBJNR.
ALL THE THREE RANGES WILL HAVE 'I' 'CP' '' * ' IN IT
AND I THINK U R GETTiNG BELNR BEFORE COMING TO THE THIS TABLE
CANT U ENTER BELNR IN THIS AS SELECTION CRITERIA
IN AUFK U R GETTING CONTROLLING AREA IF YOU CAN PUT THAT I HTINK IT CAN HELP YOU
IN AUFK YOU HAVE ONE MORE FILED KDAUF ,IN CAN PUT THAT IN BELNRIN COEP THEN WILL IT HELP YOU
PLEASE CHECK ALL THIS ACCORDING TO YOU CRITERIA.
HOPE IT HELPS.
04-21-2008 11:33 AM
Hi,
Check if IT_AUFK has duplicate entries before suing FOR ALL ENTRIES to fetch data. aslo check the IT_AUFK is not initial before selecting the data into IT_COEP.
make sure u have data in s_gjahr.
04-21-2008 11:36 AM