Skip to Content
author's profile photo Former Member
Former Member

GENERAL DOUBT REG MODIFY AND DELETE

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 07: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.