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.
Showing results for 
Search instead for 
Did you mean: 

Commit - Within Loop

Former Member
0 Kudos

Hello All,

I am stuck up with ABAP Dump - DBIF_RSQL_ERROR.

In my code i am fetching data from database tables ZOMLT and ZOMLG. The main objective being delete the orphan entries

available in ZOMLT. (ZOMLT and ZOMLG have 5 primary keys in common)

Step 1 : Based on conditions i have retrieved data from ZOMLT.

Step 2 : Retrieved data from ZOMLG and placed them into i_ZOMLT and i_ZOMLG internal tables respectively.

The total records that are selected are for ZOMLT - *38838 and for ZOMLG - 10622.

I have declared a variable of size 6 as a counter to get the total number of records in internal table, that is the reason

why the * (So, the reords fetched cross the 6 digits).

Step 3 : Then i am looping at i_ZOMLT and reading i_ZOMLG.

If the records available in ZOMLT does not match with the record present in ZOMLT i build the Orphan internal table (IF

SY-SUBRC NE 0 then build Orphan itab).

The total records in the Orphan tab is *17594, this is the place i get the ABAP/4 processor: DBIF_RSQL_SQL_ERROR - no more

locks available.

Once the Prohan table is populated i use the mass delete statement DELETE ZOMLT client specified from ITAB ORPHAN_TAB.

Would be great if your views/suggestions are provided on how to retrieve a smaller data from ZOMLT and ZOMLG and delete the

entries and then proceed for further data.




Former Member
0 Kudos

Hi Sravan,

The first thing I must ask you is why you're using a character variable (type c or n) to hold the count of the number of records. you should be using an Integer variable for that.

Eben though you have described what you're doing, your subject line confuses me a little. Is there any COMMIT within a LOOP ? Which LOOP are you talking about ? and why do you have the COMMIT at all ?

If it isn't too long, can you paste your code here ?


Anand Mandalika.

0 Kudos

Oops! I have just seen that you have another thread for this question. Could you [please refrain from doing that in future ? It is really confusing to have mutliple threads for the same question.


Anand Mandalika.

Active Contributor
0 Kudos

Hi Sravan,

From your message I understood that the error is due to some issue with locking. Possible reasons for this could be;

Do not have sufficient table space

Size of the rollback segment

If you can send me the shortdump, I can give more specific answer.

Instead of populating all the orphan records in the itab and then delete from ZOMLT, as soon as the orphan itab is filled with 10,000 records, delete from ZOMLT and do a commit work.