10-16-2006 7:30 PM
Hi all,
Iam using the following code .
Does this gives any problem.
when sy-ucomm eq 'SAVE'.
DELETE FROM Zxxx WHERE record = 9999.
MODIFY Zxxx FROM TABLE ITAB.
itab has multiple records for record number 9999.
I AM MAKING LOT OF CHANGES TO THE LINE ITEMS OF RECORD 9999.
I WANT WHETHER THIS WOULDNOT CREATE ANY PROBLEM, BECAUSE IAM DELETING AMD INSERTING IN CONSECUTIVE STEPS
DO I NEED TO DO ANYTHING LIKE COMMIT WORK ETC--
THANKS
10-16-2006 7:47 PM
Suchitra,
I dont see any problems with that unless you want to delete and create new rows.
In your case modify works just like an insert statement as u deleted records with record number 9999 and inserting new records with 9999 record number.
10-16-2006 7:53 PM
Hi Suchitra,
As long as the data in itab is accurate there should not be a problem. The delete will delete all the records from you Z table where record is 9999.
The modify will update a record in Z table if a record with same key exists already ELSE it will insert a new record.
Cheers
10-16-2006 8:20 PM
Hi,
I presume you are doing delete on a Ztable or some table based on the values you have on the itab..
It is better to do an update statement as it would automatically see if your condition is satisfied and only then will it update.
Thanks,
Amit
10-16-2006 8:46 PM
Hi Suchitra,
You can also use commit work to make sure that DB entries are deleted. Also your intrenal table should not have any duplicate records.