Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

REG. performance issue

mohan_subramania
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

i checked that it_aufk is not initial.