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

Performance problem?

Former Member
0 Likes
811

Hi Guys,

When i am executing the below Select statement its taking nearly 8 to 9 minutes to get executed.Can anybody tell me how to increase the Performce of this Below Select statement.?

Select

MSEG~EBELN

MSEG~EBELP

MKPF~BUDAT

into table itab_MKPF

From MKPF as MKPF

Inner join MSEG as MSEG

ON

MKPFMBLNR = MSEGMBLNR AND

MKPFMJAHR = MSEGMJAHR

where MSEGBWART = '101' or MSEGBWART = '102' .

Thanks,

Gopi.

6 REPLIES 6
Read only

Former Member
0 Likes
794

Hello,

Make this change


data: ra_bwart type range of bwart with header line.
ra_bwart-sign = 'I'.
ra_bwart-option = 'EQ'.
ra_bwart-low = '101'.
append ra_bwart.
ra_bwart-low = '102'.
append ra_bwart.

MSEG~EBELN
MSEG~EBELP
MKPF~BUDAT
into table itab_MKPF
From MKPF as MKPF
Inner join MSEG as MSEG
ON
MKPF~MBLNR = MSEG~MBLNR AND
MKPF~MJAHR = MSEG~MJAHR
where MSEG~BWART in ra_bwart.
" This will improve the performance

Cheers,

Vasanth

Read only

Former Member
0 Likes
794

This query depends heavily on how much data is in MKPF and MSEG (which is usually alot) since you are basically joining the entire table for the movements you specified.

I would rethink the query complete and try to break up it up into two separate queries. Select first from MKPF the records you want into an itab, then do a 'for all entries' to select from MSEG using MBLNR and MJAHR.

Read only

0 Likes
794

Hi Daniel,

Thanks for ur response,But i have to get BUDAt also from MKPF table.If i have to do like what u told.

Get MKPF details,Then apply For all entries with MSEG table and get EBELN and EBELP details.then again i have to combine BUDAt adn ebeln and ebelp into single internal table.Do u think it is going to increase performance ?

Thanks,

Gopi.

Read only

0 Likes
794

Hi Gopi,

It depends on how many results you are going to get from MKPF. Assuming that you can filter MKPF to narrow the initial selection using some of the fields (mjahr, budat), it should speed it up.

Read only

0 Likes
794

Hi Daniel,

i treid like what u told but its taking to much of time. like 7 to 8 minutes while executing for All Entries with MKPF and MSEHG tables.is there any other alternative?

Thanks,

Gopi.

Read only

Former Member
0 Likes
794

I don't think there's much you can do with this other than run it in the background.

Rob