Skip to Content
0
Former Member
Jun 03, 2008 at 09:09 AM

Loops within loops

30 Views

Greetings Abapers

I keep getting a runtime error where the system tells me that my program has terminated because it has exceeded the runtime limit. I suspect this is because i have a loop within another loop and they both take a while to execute. I was wondering if you could suggest how i can improve my code. Currently what i want to do is

Get all active sales codes and assign them to a table

Read org relationships for all BP's linked to Salescodes for all date ranges

The code is :

loop at lt_/ccdev01/a2scode.

  • Read all organisational relationships for all business partneru2019s linked to sales codes for all date ranges

select * from hrp1001 into table lt_hrp1001

where plvar = '01'

and relat = 'Z40'

or relat = '008'.

loop at lt_hrp1001.

.........

endloop.

endloop.