‎2006 Sep 19 9:25 PM
Hi All,
I have a piece of code which is giving me some trouble.
SELECT * FROM s880
INTO CORRESPONDING FIELDS OF TABLE it_s880
WHERE vrsio EQ p_tvrsio OR
vrsio EQ '000'.
DELETE s880 FROM TABLE it_s880.Now, when i'm debugging, i find that even after the Delete has occured, the Data from the table hasn't been deleted. or atleast that i can still see it in SE16. I tried refreshing but no change.
But how ever the data at the end (after the program executes) seems to be OK.
Does this normally happen or am i doing something wrong.
Thanks in advance..!
Jr.
‎2006 Sep 19 9:31 PM
Your syntax looks fine. put a break point on that delete statement and add another line of code after, like .... CHECK SY-SUBRC = 0. Now got to debug and stop at the DELETE statement, check the number of records in your DB table, now hit F5 to step to the next statement, now go back to SE16 and refresh, do you see the number change? It should.........if you are selecting the data correctly, make sure that you are getting data into the IT_S880 table.
Regards
RIch Heilman
‎2006 Sep 19 9:30 PM
Hi,
Try putting a COMMIT WORK after the delete statement.
Hope it helps.
Regards,
Gilberto Li
‎2006 Sep 19 9:31 PM
Your syntax looks fine. put a break point on that delete statement and add another line of code after, like .... CHECK SY-SUBRC = 0. Now got to debug and stop at the DELETE statement, check the number of records in your DB table, now hit F5 to step to the next statement, now go back to SE16 and refresh, do you see the number change? It should.........if you are selecting the data correctly, make sure that you are getting data into the IT_S880 table.
Regards
RIch Heilman
‎2006 Sep 19 9:32 PM
If you are interupting the processing of this program, but exiting the program in debug after the delete statement, then yes, your changes will be rollbacked, but if you all the program to finish completely then the commit will happen automatically, or course you can COMMIT WORK explicitly after the DELETE statement.
Regards,
Rich Heilman
‎2006 Sep 19 9:33 PM
Hi,
Please add this FM 'DB_COMMIT' at the end.
SELECT * FROM s880
INTO CORRESPONDING FIELDS OF TABLE it_s880
WHERE vrsio EQ p_tvrsio OR
vrsio EQ '000'.
DELETE s880 FROM TABLE it_s880
CALL FUNCTION 'DB_COMMIT'.You can also use LIS Copy Management tool (t/code <b>MCSZ</b>) to maintain your custom info structure. It is easy and very handy.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
‎2006 Sep 19 9:33 PM
It's working as expected. There is a commit when the program ends, so the records are really there until then.
Rob