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: 

Performance of a report

sastry_gunturi
Active Participant
0 Kudos

In my report I've written this select query

  if not itab1[] is initial.
    select objnr
              kstar
              ebeln
              wtgbtr
              wogbtr
              from covp
              into  table itab2
              for all entries in itab1
              where perio in s_period
              and objnr = itab1-objnr
              and   gjahr = p_fyear .
  endif.

In the selection screen if s_period(select-options) is left blank or only low value is entered then the report is

running properly. however if both high and low values are entered, it is taking lot of time to execute and running

into dump....Error is cited to this select logic.

Please can someone help how to fix this one and provide me any tips for proceeding in this.

Thank you

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

1, selecting a database view without proper key?

2. All the fields selecting are available in table COEP then why selecting from DB view COVP?

May try with the followin


  if not itab1[] is initial.
    select objnr
              kstar
              ebeln
              wtgbtr
              wogbtr
              from covp
              into  table itab2
              for all entries in itab1
              where objnr = itab1-objnr
              and   gjahr = p_fyear .
  endif.
  delete itab2 where NOT perio in s_period.

But i will not suggest for this code

aRs

8 REPLIES 8

former_member194669
Active Contributor
0 Kudos

Hi,

1, selecting a database view without proper key?

2. All the fields selecting are available in table COEP then why selecting from DB view COVP?

May try with the followin


  if not itab1[] is initial.
    select objnr
              kstar
              ebeln
              wtgbtr
              wogbtr
              from covp
              into  table itab2
              for all entries in itab1
              where objnr = itab1-objnr
              and   gjahr = p_fyear .
  endif.
  delete itab2 where NOT perio in s_period.

But i will not suggest for this code

aRs

0 Kudos

what is the key for covp...

can you suggest a better option of writing this one........

0 Kudos

Hi,

If u are selecting from COEP then also you don;t have proper key for select.

Try with my previous thread code

aRs

0 Kudos

what's the key for covp and coep...

i'll try to test the code given by you...

0 Kudos

Hi,

Primary keys for COEP

KOKRS

BELNR

BUZEI

First secondary index COEP are of 1

MANDT

LEDNR

OBJNR

GJAHR

WRTTP

VERSN

KSTAR

HRKFT

PERIO

VRGNG

PAROB

USPOB

VBUND

PARGB

BEKNZ

TWAER

secondary index of 2

OBJNR

KSTAR

GJAHR

PERIO

PAROB1

secondary index of 4

TIMESTMP

OBJNR

aRs

0 Kudos

Yaa i might think of using the secondary index of coep table...

i'll give a try ......

0 Kudos

Hi,

If you are going to use sec. index then please try to use full fields and in the same order mentioned in my previous thread

aRs

0 Kudos

sure....

please reply back to this thread if i come up with other questions thank you