Skip to Content

MODIFY or UPDATE + with/without Commit Work

I am modifyng a ztable using Modify Ztable within a subroutine.(not using any workarea or internal table).

Sometimes it doesn't modify the ztable.I think it is because I am not using the Commit work

after the modify statement.

ADD 1         TO zmff-fileno.
  g_fno = zmff-fileno.   "zmff is the ztable
  MODIFY zmff.

Now,my question is

1.can we avoid this kind of issue without using COMMIT WORK and WAIT ?

2.Instead of Modify if I use UPDATE can I avoid such kind of issues ?

3.As I am using this within a subroutine using COMMIT is a MUST ? (read in one of the threads in SDN)

Thanks,

K.Kiran.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 23, 2011 at 05:38 AM

    Hi,

    1.can we avoid this kind of issue without using COMMIT WORK and WAIT ?

    A. If you use COMMIT WORK after MODIFY statement, the Ztable is updated with immediate effect. If you don't use COMMIT WORK after MODIFY statement, the Ztable is udated once COMMIT WORK to the data base has done by the system.

    2.Instead of Modify if I use UPDATE can I avoid such kind of issues ?

    A. It is not statement dependent, either you use MODIFY or UPDATE, you need to use COMMIT WORK statement to immediate updation of Ztable

    3.As I am using this within a subroutine using COMMIT is a MUST ? (read in one of the threads in SDN)

    A. It is not subroutine dependent. Where ever you use MODIY or UPDATE, you need to use COMMIT WORK statement to immediate updation of Ztable

    Regards

    Dande

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2011 at 05:10 AM

    > 1.can we avoid this kind of issue without using COMMIT WORK and WAIT ? -

    No. If you want the data to be "committed" to the database, you've to trigger the (Database) commit.

    > 2.Instead of Modify if I use UPDATE can I avoid such kind of issues ? - N.O.

    > 3.As I am using this within a subroutine using COMMIT is a MUST ? (read in one of the threads in SDN) - Completely misleading information! This has nothing to do with the MODIFY being inside a subroutine.

    You should read the SAP documentation on [COMMIT WORK|http://help.sap.com/abapdocu_702/en/abapcommit.htm] if you've any further qns.

    BR,

    Suhas

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Kiran K

      Hi,

      modify ztable.

      if sy-subrc = 0.

      *Ztable has been successfully modified but updation will not reflect immediately in the database

      commit work.

      *Ztable updation will reflect in the database with immediate effect.

      else.

      *Updation of Ztable failed

      message.

      endif.

      Regards

      Dande