‎2008 Mar 07 3:33 PM
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.
‎2008 Mar 07 3:43 PM
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
‎2008 Mar 07 3:46 PM
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.
‎2008 Mar 07 3:56 PM
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.
‎2008 Mar 07 4:24 PM
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.
‎2008 Mar 07 4:25 PM
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.
‎2008 Mar 07 4:52 PM
I don't think there's much you can do with this other than run it in the background.
Rob