Hi Experts,
One of our clients is currently running SAP Business one 9.1 PL09. For their Sales Process they have a three (3) Way match where they must have a Sales Order > Delivery > Invoice. We therefore created a Transaction Notification Stored Procedure in SQL Server End that blocks an end user from adding a Delivery without a Sales Order and also blocks creation of an Invoice without a Delivery. The transaction notification was tested and is working well on SQL. I recently copied it from the client's server and pasted it to another SQL Server and it worked well without any changes or adjustments.
The Client has raised a complaint that there was a delivery created without a sales order. The remarks field has 'Based on Sales Order .....'. This sales order is closed and doesn't match the Delivery in question. We checked the relationship map and it only displays the delivery note and the invoice but no sales order.
There are two end users who post Deliveries concurrently. Could this concurrency have had an effect on the system such that the stored procedure wasn't able to work well? This is the Transaction Notification Code that we used:
--Creating a delivery without a sales order
IF @transaction_type IN ('A','U') AND @object_type = '15'
BEGIN
IF EXISTS (select ItemCode from [dbo].[DLN1] T0
INNER JOIN ODLN T1 ON T0.DocEntry= T1.DocEntry
where T0.BaseEntry IS NULL and T1.DocType='I' and T0.DocEntry=@list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 5, @error_message = 'EIM Error - Cannot Add Document without SALES ORDER'
END
END
What could have caused creation of the delivery without the sales order and why is the remarks displaying a completly different sales order?
Reply will be highly apreciated. Thanks
Kind Regards,
Pascale.