Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Executable program - commit work

lakshminarasimhan_n4
Active Contributor
0 Likes
1,344

Dear All,

I am using an executable program and trying to update a Z* table. But unfortunately it does not get updated until I specify explicitly "commit work", so using commit work in the executable program is that fine or any precautions to be taken. I have multiple conditions in my program and I have to use commit work multiple times. Our database is Hana.

4 REPLIES 4
Read only

FredericGirod
Active Contributor
1,243

When your program finish (with no errors) there is an implicit COMMIT WORK.

You could use explicit COMMIT WORK in your code, you just have to be sure to commit only what you are supposed to commit. The statement COMMIT, will commit all the waiting update you have done. So if some have to be escluded, just do a rollback

Read only

1,243

Here, I'm just nitpicking, as usual :). It's not a COMMIT WORK, it's a database commit. It's not when the program finishes that there's an implicit database commit, it's when the (next) screen "flushes" (is displayed).

It's always good to mention explicitly COMMIT WORK (except if you don't want to commit on purpose) because if you have a program doing SUBMIT AND RETURN, right after SUBMIT, the database updates have not been committed.

Read only

0 Likes
1,243

sandra.rossi, you want a Miss Capello badge ? 😉

Read only

1,243

of course not, I'm not here to get any kind of reward (I would refuse any reward anyway, even Nobel price, as you like joking ;-)), just providing the most precise answers to people. Okay probably only experts can understand, but some people are very curious.