Application Development and Automation 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: 
Read only

Fetching data from MSEG table

Former Member
0 Likes
389

Dear Abap Gurus ,

I am trying to prepare a vendor Rating Report . There are particular 2 queries which have perfomance issues .The requirement is such that this report has to be executed for the whole financial year .

1st Query :

SELECT BELNR GJAHR BLDAT BUDAT CPUDT FROM EKBE INTO CORRESPONDING FIELDS OF TABLE T_ekbe

WHERE BUDAT IN S_SRDATE

AND BEWTP = 'E'

AND WERKS IN S_PLANT .

Question 1: Is there any additional parameter which i can add in the where clause for getting data from ekbe for vendor rating .

Above query gives 98,000 records .

After This , another below query is taking 12 minutes to get executed which takes data from MSEG . T_EKBE has 98,000 records .

SELECT MBLNR ZEILE CHARG ABLAD EBELN EBELP MATNR MENGE WERKS ABLAD LIFNR FROM MSEG INTO CORRESPONDING FIELDS OF TABLE T_MSEG

FOR ALL ENTRIES IN T_ekbe

WHERE MBLNR = T_ekbe-BELNR

AND MJAHR = T_ekbe-GJAHR

AND MATNR IN S_MATNR

AND WERKS IN S_PLANT

AND BWART = '101'

AND LIFNR IN S_VENDCD .

Question 2 : How to increase speed of this query for MSEG .

Thanks In advance ,

Devendra Singh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
325

hi,

there are various ways you can increase speed:

1) process a few number of records each time say 10000 using parallel processing then automatically the total time will be reduced bt 1/10

2) second query fetch the record based on open cursor approach

3) you declare types in place of doing move corresponding and alos sort the table after 1st query deleting adajcent duplicates

1 REPLY 1
Read only

Former Member
0 Likes
326

hi,

there are various ways you can increase speed:

1) process a few number of records each time say 10000 using parallel processing then automatically the total time will be reduced bt 1/10

2) second query fetch the record based on open cursor approach

3) you declare types in place of doing move corresponding and alos sort the table after 1st query deleting adajcent duplicates