‎2010 May 11 8:37 PM
Hello Guys,
Please see the below code and its not working. please help if thers is any bug.
UPDATE table
SET field1 = 'X'
WHERE condition.
Thanks in advance,
Angelo
‎2010 May 11 8:39 PM
‎2010 May 11 8:39 PM
‎2010 May 11 9:00 PM
alright, here is the complete code.
LOOP AT itab INTO work_area.
UPDATE Ztable
SET field1 = 'X'
WHERE field2 = work_area-field2.
ENDLOOP.
Thank guys,
Angelo
Edited by: SAPBW2010 on May 11, 2010 10:01 PM
‎2010 May 11 9:06 PM
‎2010 May 11 9:07 PM
Hi,
Are you sure that you have a record in Ztable as per WHERE condition? What is the SY-SUBRC after update? If zero, add COMMIT WORK statement after update.
Thanks,
Vinod.
‎2010 May 11 9:21 PM
added COMMIT WORK but its not working.
Yes we have matching records.
Thanks
Angelo
‎2010 May 11 9:29 PM
If you really want help, don't say things like "it's not working". This gives no information. You have to say what is not working. Are you getting a dump? A return code? No changes?
And you haven't given you real source code. You also have to look at the WHERE to see if there really are any matches. Conversion exits may be confusing the issue as well.
Please do some analysis and let the forum know what the problem is.
Rob
‎2010 May 11 9:30 PM
Hi,
There may be a possibility of having conversion exit for that field. If yes, you can convert and then use in update statement.
Check if the where clause field is case sensitive.
For testing purpose, can you write a select query on that table with the same WHERE condition just before the update statement and see if you have the data. I am sure that your select should also fail.
By the way, you didn't tell the sy-subrc value after the update statement.
Thanks,
Vinod.
‎2010 May 11 9:30 PM
‎2010 May 11 10:20 PM
Hi,
If sy-subrc is zero and commit work is used, i can't see any possibility of failure. Check with your basis team if the update work processes are fine.
Thanks,
Vinod.
‎2010 May 14 7:40 PM
Thank you all guys, there was some problem in code, now its fixed.
Good luck yuo all,
Angelo