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

Nesting: LOOP/ENDLOOP Loop Inside LOOP/ENDLOOP

Former Member
0 Likes
1,900

LOOP AT i_supr_summ_format.

i_supr_summ_format-le1week = 0.

i_supr_summ_format-2weeks = 0.

i_supr_summ_format-tran_total = 0.

......

......

......

LOOP AT i_supr_summ_format_t

WHERE zzuserid = i_supr_summ_format-zzuserid.

i_supr_summ_format-le1week = i_supr_summ_format-le1week +

i_supr_summ_format_t-le1week.

i_supr_summ_format-2weeks = i_supr_summ_format-2weeks +

i_supr_summ_format_t-2weeks.

......

......

......

i_supr_summ_format-tran_total = i_supr_summ_format-tran_total +

i_supr_summ_format_t-tran_total.

ENDLOOP.

MODIFY i_supr_summ_format transporting le1week 2weeks 3weeks 4weeks 5weeks 6weeks gt6weeks tran_total.

ENDLOOP.

Enhanced code check gives me a warning " Nesting: LOOP/ENDLOOP Loop Inside LOOP/ENDLOOP '

What am I doing wrong?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
887

Please see:

[The Performance of Nested Loops|]

Rob

2 REPLIES 2
Read only

Former Member
0 Likes
888

Please see:

[The Performance of Nested Loops|]

Rob

Read only

former_member156446
Active Contributor
0 Likes
887

loop in side a loop is not generally accepted in many client locations and even SAP doesnot recommend it .. alternative for loop in a loop is ..

loop at itab...

Do...

read table Itab2 into wa_itab index sy-index... or sy-tabix..

enddo.

endloop.