Skip to Content
0
Mar 07, 2007 at 10:03 AM

use of CL_BCS to send email in user exit

484 Views

Hi,

I need some help from experts in this forum.

I use CL_BCS to send email if a certain condition is met inside a customer exit.

This exit is called before a confirmation dialog pop up asking whether we want to save or cancel.

I did not put commit work statement in this exit since it will commit all database update even though the transaction can still be canceled. Email will also be sent if the transaction is save. Hence, I'm relying on commit statement that come from the transaction itself.

However, this logic has create one problem for me.

If user hit cancel in the confirmation dialog that pop up after the exit is called, no commit will be executed. Hence, no email will be sent.

The problem is when the user change the data and re-save the data, there will be 2 email sent. One email come from the save action from the user and the other come from previous email that was not sent before due to no commit statement executed.

Is there any way to prevent this to happen? Please help.

PS: Points will be rewarded for those with helpful answer

Message was edited by:

Abraham Bukit