‎2007 Oct 04 10:21 AM
Hi,
am using ranges in below select..
is there any performance issue..can u suggest a beeter way other than ranges..
SELECT bukrs belnr budat blart awkey
INTO TABLE ibkpf
FROM bkpf
WHERE bukrs = p_bukrs
AND gjahr = gjahr
AND monat IN s_monat
AND blart IN r_blart
AND budat IN s_date.
‎2007 Oct 04 10:24 AM
hi,
no there is no performance issue at all.
you are doing it rightly.
only remember place the fields in select query as they are in database table i.i first primary keys and then other if they are on selection screen.
‎2007 Oct 04 10:24 AM
hi,
no there is no performance issue at all.
you are doing it rightly.
only remember place the fields in select query as they are in database table i.i first primary keys and then other if they are on selection screen.
‎2007 Oct 04 12:43 PM
Hi Tuborg,
Nice, But it is always better to warn / Inform the user when Empty date ranges are used Particularly with Date on Tables like BKPF, MKPF, CDHDR, .... tables. Better to Schedule the Program in Backgroud.
Volume of Data will be very large..
your program need not fail because of time out error.
Regards,
Sureshkumar.AL
‎2007 Oct 04 12:48 PM
Hi,
No performance issues, however to avaoid empty date fields assed to the select query, make them atory in the selection screen.
Otherwise if date is not given it will fetch large number of data
‎2007 Oct 04 2:20 PM
Yes there is. Your SELECT will try to use either index 2 or 3 depending on your database statistics, but won't be able to do it effectively because you are not using BSTAT in the WHERE clause. It may seem counter-intuitive, but simply adding all values of that field to the WHERE may speed it up considerably:
SELECT bukrs belnr budat blart awkey
INTO TABLE ibkpf
FROM bkpf
WHERE bukrs = p_bukrs
AND gjahr = gjahr
AND bstat IN (' ', 'A', 'B', 'D', 'M', 'S', 'V', 'W', 'Z') "<=======
AND monat IN s_monat
AND blart IN r_blart
AND budat IN s_date.
As the others have suggested, make sure that either r_blart or s_date is not empty and does not contain any 'NE'
Rob