2006 Dec 12 8:25 PM
Hi,
I need to find all sales order which have to be delivered to a selected date.
So I make Querry with an acces on VBEP-EDATU but the performance are very bad. How can I increase the performance ?
Thanks
Eric
Hi,
I need to find all sales order which have to be delivered to a selected date.
So I make Querry with an acces on VBEP-EDATU but the performance are very bad. How can I increase the performance ?
Thanks
Eric
2006 Dec 12 8:37 PM
Hi Sturni,
I see that this VBEP is an APPL1 data class with size category '3' (Data records expected: 29,000 to 110,000). So, you can get this data into an internal table and sort it and then retrieve the required records using EDATU by binary search.
Regards,
Vivek
2006 Dec 12 8:52 PM
Thanks for your answer ...
But in my case I have about 500 000 records ...
2006 Dec 12 8:54 PM
2006 Dec 12 9:07 PM
Hi Sturni,
Are you filling the internal table using table in select statement?
Can you paste your query once?
Regards,
Vivek
2006 Dec 12 9:17 PM
Why don't you give Vivek's answer a try - you may run into memory problems; but on the other hand it might work.
Rob
2006 Dec 13 9:47 AM
select
VBEPEDATU VBEPPOSNR VBEPVBELN VBAPWERKS VBAPMATNR VBAPVRKME VBAPKBMENG VBAPKWMENG VBAPABGRU VBAPUEPOS VBAPPOSNR VBAPVBELN VBAPMEINS VBUPLFSTA VBUPLFGSA VBUPABSTA VBUPGBSTA VBUPPOSNR VBUPVBELN VBUKGBSTK VBUKABSTK VBUKCMGST VBUKLFSTK VBUKSPSTG VBUKVBELN VBPAKUNNR VBPAPARVW VBPAVBELN
from ( VBEP
left outer join VBAP
on VBAPPOSNR = VBEPPOSNR
and VBAPVBELN = VBEPVBELN
inner join VBUP
on VBUPPOSNR = VBAPPOSNR
and VBUPVBELN = VBAPVBELN
inner join VBUK
on VBUKVBELN = VBAPVBELN
inner join VBPA
on VBPAVBELN = VBAPVBELN )
where VBEP~EDATU in SP$00002
and VBUP~LFSTA in SP$00010
and VBUP~LFGSA in SP$00011
and VBUP~ABSTA in SP$00012
and VBUP~GBSTA in SP$00013
and VBUK~GBSTK in SP$00005
and VBUK~ABSTK in SP$00006
and VBUK~CMGST in SP$00007
and VBUK~LFSTK in SP$00008
and VBUK~SPSTG in SP$00009
and VBPA~PARVW in SP$00016 .
endif.
I see my problem is on "where VBEP~EDATU in SP$00002", the program check the full table VBEP (15 544 589 records)
Thanks for your help
2006 Dec 13 3:28 AM
Hi eric,
Fist you paste your code then we can suggest.
2006 Dec 13 5:55 AM
Hi ,
Give select statement fetch record by dividing it into few sections .
Suppose you have 1000 records ,break it into 100's .And then process.
2006 Dec 13 3:19 PM
Hi,
select
VBEPEDATU VBEPPOSNR VBEPVBELN VBAPWERKS VBAPMATNR VBAPVRKME VBAPKBMENG VBAPKWMENG VBAPABGRU VBAPUEPOS VBAPPOSNR VBAPVBELN VBAPMEINS VBUPLFSTA VBUPLFGSA VBUPABSTA VBUPGBSTA VBUPPOSNR VBUPVBELN VBUKGBSTK VBUKABSTK VBUKCMGST VBUKLFSTK VBUKSPSTG VBUKVBELN VBPAKUNNR VBPAPARVW VBPAVBELN
from ( VBEP
left outer join VBAP
on VBAPPOSNR = VBEPPOSNR
and VBAPVBELN = VBEPVBELN
inner join VBUP
on VBUPPOSNR = VBAPPOSNR
and VBUPVBELN = VBAPVBELN
inner join VBUK
on VBUKVBELN = VBAPVBELN
inner join VBPA
on VBPAVBELN = VBAPVBELN )
where VBEP~EDATU in SP$00002
and VBUP~LFSTA in SP$00010
and VBUP~LFGSA in SP$00011
and VBUP~ABSTA in SP$00012
and VBUP~GBSTA in SP$00013
and VBUK~GBSTK in SP$00005
and VBUK~ABSTK in SP$00006
and VBUK~CMGST in SP$00007
and VBUK~LFSTK in SP$00008
and VBUK~SPSTG in SP$00009
and VBPA~PARVW in SP$00016 .
endif.
I see my problem is on "where VBEP~EDATU in SP$00002", the program check the full table VBEP (15 544 589 records)
Thanks for your help
2006 Dec 13 3:38 PM
EDATU is just one of your problems. There is only one index field in the entire where clause. VBUK~SPSTG is a secondary index, but probably not very selective.
As a test, try running this with SP$00009 set that it only picks up une status (but not blank).
Also - how many records in <b>each</b> of the tables in your select?
Rob
Message was edited by:
Rob Burbank
2006 Dec 13 4:03 PM
I would suggest you first select orders and then go for VBEP.
If you need to select based on material - you can start form VAPMA table.
OR you can create a view with VBAK&VBUK (or just select from these tables first) to limit docs by status (exclude rejected & complete docs, since I assume you are doing it anyway in your join)...you can limit by VBAK-ERDAT here since obviously VBEP-EDATU can't be less than VBAK-ERDAT.
Then, based on that - select form VBEP.
Even if you are going to have a tablescan - better to do it on the table with less volume
VBAK < VBAP < VBEP as far as number of records is concerned usually.
2006 Dec 14 12:48 PM
Hello,
1. Can you let us know what are the keys you have specified in your select query?
2. If you are using edatu directly in where condition surely it will take lot of time to scan required records. therefore create one secondary index on edatu. It will surely improve select query performance.
*********Poorna***********
2006 Dec 14 4:54 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |