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

BCS Email and Commit Work

Former Member
0 Likes
770

I created a small email class that is basically a wrapper around the BCS document classes. Everything works fine when used in normal programs. Then, I tried to update some code that was behind a smartform for our order confirmations. When I tried to test this, I got a dump because of the Commit Work after the send. The error I got was that I was doing a commit work during an update task, which SAP doesn't like. Apparently the commit work is needed for the BCS send method. Does anyone have any ideas I can get around this? Any idea would be appreciated.

Thanks in advance,

Curtis

4 REPLIES 4
Read only

Former Member
0 Likes
708

Commit should automatically happen after the SAP transaction is completed.

You should never use Commit within the standard code as it will lead to inconsistencies.

G@urav

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
708

Remove the commit work and try.

Did you check it ?

Read only

0 Likes
708

When I remove the commit work, there is no error, but I never receive an email in the other programs. In the order confirmation smartform, I get a POSTING_ILLEGAL_STATEMENT dump on a call screen. When testing, I'm opening up and order, then I go to EXTRAS > OUTPUT > HEADER > EDIT and try to repeat the order confirmation statement.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
708

What i understand is that your code is getting executed in an Update Work Process & as you've guessed SAP doesn't allow COMMIT WORK to be used inside an Update Task.

What Gaurav is trying to suggest is may be there are some Implicit Commits later on which might trigger your email.

Without further inputs it's difficult to analyse.

BR,

Suhas