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 & Data

Former Member
0 Likes
839

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
807

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

8 REPLIES 8
Read only

Former Member
0 Likes
808

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
807

1) I suggest to always avoid a SELECT ENDSELECT. Why? Because each pass is a hit to the DB, you will want to use INTO TABLE of ITAB instead as it is one rould trip to the DB.

2) I like to use LSMW for standard objects.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
807

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.

Read only

Former Member
0 Likes
807

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.

Read only

Former Member
0 Likes
807

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.

Read only

Former Member
0 Likes
807

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

Read only

0 Likes
807

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.

Read only

Former Member
0 Likes
807

> 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