Application Development 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: 

hi guru's in ABAP loop with in the loop is possible

Former Member
0 Kudos

hi guru's in ABAP loop with in the loop is possible

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Possible, but may cause performance problems. See:

<a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">The Performance of Nested Loops</a>

Rob

8 REPLIES 8

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi sri

Absolutely possible.

But that's recommended guideline.

Regards,

Sree

Former Member
0 Kudos

Hi Sri,

Loop inside loop is possible but on certains conditions where its unavoidable.

Regards

Avi

Former Member
0 Kudos

Possible, but may cause performance problems. See:

<a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">The Performance of Nested Loops</a>

Rob

Former Member
0 Kudos

Hi sri,

it is posible clearly.

see this code.

data: t_spfli type table of spfli with header line,

t_sflight type table of sflight with header line.

select * from spfli into table t_spfli.

select * from sflight into table t_sflight.

loop at t_spfli.

write:/ t_spfli-carrid,

t_spfli-connid.

loop at t_sfplight where carrid eq t_spfli-carrid

and connid eq t_spfli-connid.

write / t_sflight-fldate.

endloop.

endloop.

Plz Reward if useful,

Mahi.

Message was edited by:

Maheswari Chegu

Former Member
0 Kudos

yes, its possible but performance my decrease. But there are some way to improve it check this links:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40729734-3668-2910-deba-fa0e95e2...

http://sapstore.blogspot.com/2006/12/performance-tips-netsed-loops.html

So depending on ur requirement u can use different alternative.

Plz reward points if useful

Thanks & Regards,

Vikram

Former Member
0 Kudos

Hi,

It is definitely possible but it depends how you want to use it.. If your loop has selects from database tables it is really not feasible and should not be done but if it is reading from the internal tables it will not cause problems with database but your ABAP memory will be affected.

Also loop in loop means that your performance will always take a beating.

Prince

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi vasu

If you are satisfied with given answers, please close your threads by giving points for useful answers which u feel.

Regards,

Sree

Former Member
0 Kudos

Hi sri,

Loop inside a loop is possible until you are not using a SELECT inside a LOOP.