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: 

Delete statement is working fine in Quality but not in Production

Former Member
0 Kudos

Hello Experts,

I am using Delete statement with in loop to delete some records on the basis of condition.

This is working fine in Devlopement and Quality but not working in Production.

What is the cause.

my code is like this

Loop at itab.

some condition.

delete itab index sy-tabix.

endloop.

7 REPLIES 7

Former Member
0 Kudos

Hi,

It's hard to tell what the reason could be unless you show us the actual code, but at a first glance of your code, it seems the condition is not getting true in production ? So I suggest you check the condition.

regards,

Advait

Former Member
0 Kudos

Hi Mahesh,

I agree with Advait,

Check once your condition & it may not be satisfying in PRD.

please update with code for further help.

Thanks & regards,

Dileep .C

Former Member
0 Kudos

Hi,

Can you give us the error message so as to make it more clear?

Thanks and regards,

Chris Gu

Former Member
0 Kudos

>

> Hello Experts,

> I am using Delete statement with in loop to delete some records on the basis of condition.

> This is working fine in Devlopement and Quality but not working in Production.

> What is the cause.

>

> my code is like this

> Loop at itab.

> some condition.

> delete itab index sy-tabix.

> endloop.

it must due to the condition not satisfied in the PRD

one more thing that u can try is

loop at itab where condition.

delete itab index sy-tabix.

endloop.

faisal_altaf2
Active Contributor
0 Kudos

Hi, Mahesh

if you are using LOOP AT or READ TABLE inside your main LOOP than index sy-tabix while deleting can also Create problem. Please Check and let us know if any.

Best Regards,

Faisal

Former Member
0 Kudos

HI,

1st consult your BASIS person that did he allowed the maintainance configration in PRD server bcoz in PRD server u cannot delete the data as it is the most crucial data of the company,i reconmmend to check the settings of it.

revert back if u find any problem.

venkat_o
Active Contributor
0 Kudos

Hello Mahesh, As one of members mentioned, within the LOOP statement, if there is any READ statement, the SY-TABIX value is changed. So what you have to do is define one variable for index and assign Sy-TABIX value to that at the start of LOOP stement and then finally DELETE your internal table record at the end using the index value assigned. Check the sample program


DATA:
      sy_tabix TYPE sy-tabix.

LOOP AT  itab.
  sy_tabix = sy-tabix.
*<staments>
  DELETE itab INDEX sy_tabix.
ENDLOOP.
I hope that it helps you.