05-03-2009 5:29 PM
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.
05-03-2009 6:42 PM
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
05-04-2009 2:33 AM
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
05-04-2009 2:39 AM
Hi,
Can you give us the error message so as to make it more clear?
Thanks and regards,
Chris Gu
05-04-2009 4:15 AM
>
> 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.
05-04-2009 4:22 AM
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
05-04-2009 4:34 AM
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.
05-04-2009 4:48 AM
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
I hope that it helps you.
DATA:
sy_tabix TYPE sy-tabix.
LOOP AT itab.
sy_tabix = sy-tabix.
*<staments>
DELETE itab INDEX sy_tabix.
ENDLOOP.