Skip to Content
Former Member
Jul 14, 2008 at 02:07 PM

Error while triggering program through output type while saving invoice



I have a scenario where in my Z program needs to be triggered when saving a invoice.

For that we have attached out Z program to output type which gets picked while saving invoice.

In the Z program we have written the entire code in Form Entry subroutine.

In the Z program we have called a FM "SD_SALESDOCUMENT_CREATE", to create a sales order.

After sales order is created we have used a Commit statement.

If I run the Z program individually, Salesorder gets created perfectly.

How ever as per scenario when trying to save the invoice, output type gets picked. But program doesn't get called.

and when I go to the saved the invoice I get the following error immediately:

"Error document - Update was terminated"

I have found that the problem is with COMMIT statement through transaction SM13.

Can anybody help me with this. I cannot save the sales order without COMMIT, so I have to use it.

Thanks in Advance,