‎2010 Aug 02 2:10 PM
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
‎2010 Aug 02 2:21 PM
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
‎2010 Aug 02 2:22 PM
‎2010 Aug 02 2:34 PM
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.
‎2010 Aug 02 2:30 PM
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