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

Commit Work Failed.

Former Member
0 Likes
1,511

Hi experts,

A weird problem hits me so much. After I insert a table item and of course commit work following the insert clause in a function module, and I want to read the inserted item out and change it, but after I commit work for the update clause and go to the table to see the item you have changed, nothing happened. It seems that there are two threads for the insert and update clause. I want to know why, and how to solve the problem properly. Actually I use wait up to 1 seconds to solve the problem, but I do not want to wait for 1 second for each table item, as there are many items should be processed at one time, so it will take a long time to complete the whole processing which can not be accepted by the user.

Thx in advance, points will be rewarded.

Vincent.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
897

hi

dont write commit work inside the function module. it wont work

write it in the report program after the function modulew gets executed.

regards

ravish

<b>plz dont forget to reward points if helpful</b>

3 REPLIES 3
Read only

Former Member
0 Likes
898

hi

dont write commit work inside the function module. it wont work

write it in the report program after the function modulew gets executed.

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Read only

former_member150733
Contributor
0 Likes
897

My suggestion is to do all the intermediate changes in the internal table itself first and only "SAVE" updates the database.

You may have to do without the first Insert and have the data in the internal table itself. and when user modifies some data, the changes happens to the data in internal table rather than the Database. You can have a SAVE button (which updates to Database & commit work) to save the changes at one go.

Regards,

Anish Thomas

Read only

Former Member
0 Likes
897

After your code calling the function

Write:

commit work and wait.