‎2006 Aug 21 4:01 PM
Hi,
i have few questions to share.
1.When you have a select statement with in Loop..Endloop
and a Select and Endselect, which one do you prefer? and Why and which is best on performance wise.
2.What method do you suggest when you have some 10000 records to post to R/3 from legacy Vendor Master/Material Master (Master Data)
Thanks
Seshu
‎2006 Aug 21 4:05 PM
hi Sheshu,
1.When you have a select statement with in Loop..Endloop
and a Select and Endselect, which one do you prefer? and Why and which is best on performance wise
<b>both the methods are not advisable to use speaking in terms of performance related issue ... but among both the methods select statement within loop and endloop is preferable ...</b>
2.What method do you suggest when you have some 10000 records to post to R/3 from legacy Vendor Master/Material Master (Master Data)
<b>LSMW..</b>
Regards,
Santosh
Message was edited by: Santosh Kumar P
‎2006 Aug 21 4:05 PM
hi Sheshu,
1.When you have a select statement with in Loop..Endloop
and a Select and Endselect, which one do you prefer? and Why and which is best on performance wise
<b>both the methods are not advisable to use speaking in terms of performance related issue ... but among both the methods select statement within loop and endloop is preferable ...</b>
2.What method do you suggest when you have some 10000 records to post to R/3 from legacy Vendor Master/Material Master (Master Data)
<b>LSMW..</b>
Regards,
Santosh
Message was edited by: Santosh Kumar P
‎2006 Aug 21 4:05 PM
‎2006 Aug 21 4:05 PM
Hi Seshu,
1). Both are not good. Select within a loop will lead to database access for each pass of the loop.
Select endselect is definitelly a no no as its a loop by itself.
Instead using ARRAY table select and using read with binary search is more useful and more efficient. Infact in companies they dont allow both the options mentioned by you in point 1. You will have to change the code.
2).You can use LSMW or CATT or use IDOC with COllect and Process options.
A simple BDC also would be fine at times.
Cheers
VJ
If it helps dont forget to reward points.
‎2006 Aug 21 4:06 PM
hi,
we will prepfer select and endselect instead of select in loop-endloop. the select and endselect also act as a loop.
for 10k records use call transaction method.
‎2006 Aug 21 4:06 PM
SELECT/ENDSELECT requires and fetch for each record.
LOOP/ENDLOOP loads everything into an itab, and is much faster.
Try to avoid the first method if you can.
‎2006 Aug 21 4:33 PM
For vendor masters, you can use standard SAP program RFBIKR00. I'm not sure about material masters, but you can look at RM07MMBL. They are both documented.
Rob
‎2006 Aug 21 4:38 PM
Instead of doing select in a loop , use select on the other table using for all entries of previous table key fields. and in the loop endloop use read.
Regards.
‎2006 Aug 21 5:15 PM
> 1.When you have a select statement with in
> Loop..Endloop
> and a Select and Endselect, which one do you prefer?
> and Why and which is best on performance wise.
The best way is to use the SELECT statement with for all entries in itab variation..in the above case. Basically it points to SELECT statement within Loop..Endloop.
> 2.What method do you suggest when you have some 10000
> records to post to R/3 from legacy Vendor
> Master/Material Master (Master Data)
LSMW
Regards
Anurag