03-30-2010 5:45 AM
Hi Gurus,
I have a report which displays purchase info records.
If I am selecting from tables i need to use EINA, EINE, EORD and some other tables.
There is a BAPI which gets all purchase info records specific to a vendor , material , purchasing organisation.
QUESTION: Performace wise which is the better Approach, either selecting from tables or BAPI for Purchase info records
Regards
Avi.
03-30-2010 5:49 AM
If you are able to get all the details from 1 bapi then you can go with
that option instead of using select on multiple tables.
You can also check the trace difference between both using SM30 transaction.
03-30-2010 5:49 AM
If you are able to get all the details from 1 bapi then you can go with
that option instead of using select on multiple tables.
You can also check the trace difference between both using SM30 transaction.
03-30-2010 5:52 AM
Hi Gautam,
If I am using BAPI i need to use it inside a LOOP, so is it advicable?
Regards
Avi
03-30-2010 5:57 AM
Whether it using BAPI or select. you need to check the performance. If you have full key for these tables EINA, EINE, EORD then mak a select outside of the loop and within loop use READ TABLE statement with binary search. of if you want multiple records within loop then use loop insdie loop.
Your final objective is to minimise the database hits . If you use bapi inside loop then your database hits will be more
select from EINA
select from EINE
select from EORD
loop at itab,
read table EINA
read table EINE
read table EORD
endloop
a®
03-30-2010 5:57 AM
Hi,
Check the run time analysis for both cases. You are saying that you need to pick up data from 4 tables. Hence, you should be able to write a better select query using JOINs which should not cause much performance drain.Instead of picking data from the tables each time in a loop , i feel its better to fetch the data from the tables at one go using SELECT.Run SM30 and check Database time.
Regards,
Lakshman.
03-30-2010 5:59 AM
hi,
yes you can use BAPI inside a loop..
and its give u better performance then a select statement ..
regards
RItesh
03-30-2010 5:51 AM
Dependent's on you requirement again..coz if you want only selected data in report the BAPI will fetch unnecessery data also and you also can check if the BAPI has parameter for fetching Specific data if it suffice your requirement ..but again you can filter the data if you directly access table s by having a strong selection criteria ..!
you can very well try using in SE30
Edited by: Anup Deshmukh on Mar 30, 2010 6:51 AM