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

Select on VBEP-EDATU

Former Member
0 Likes
2,602

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

13 REPLIES 13
Read only

Former Member
0 Likes
2,064

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

Read only

0 Likes
2,064

Thanks for your answer ...

But in my case I have about 500 000 records ...

Read only

0 Likes
2,064

Can you paste your select query here?

- Guru

Read only

0 Likes
2,064

Hi Sturni,

Are you filling the internal table using table in select statement?

Can you paste your query once?

Regards,

Vivek

Read only

0 Likes
2,064

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

Read only

0 Likes
2,064

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

Read only

Former Member
0 Likes
2,064

Hi eric,

Fist you paste your code then we can suggest.

Read only

Former Member
0 Likes
2,064

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.

Read only

0 Likes
2,064

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

Read only

0 Likes
2,064

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

Read only

0 Likes
2,064

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.

Read only

Former Member
0 Likes
2,064

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***********

Read only

0 Likes
2,064

Hi,

I use EDATU and WERKS

Bye