I know there are a ton of questions already answered about UDF and preventing them from being updated by using SP_TransactionNotification. However, none of them address blocking updates on the line item level.(or none that I have found)
I added a field to capture the Original order quantity from the customers PO. This UDF XX_POQty updates the SAP Quantity field RDR1.Quantity. Once the order is saved I want to prevent XX_POQty from being changed. I still want to be able to change RDR1.Quantity, because by agreement we can over ship to customers by 5% and to over ship we need to change the order quantity. I know we can go back in the ADOC and ADO1 to see the original amount but it is easier to have it right on the order. If we do not change the RDR1.Quantity the order would auto close the line after 1,000 were shipped. And No, they do not want to add a line for the overage, that would be too easy. :-)
added this code to SP_TransactionNotification but it does not work. Any ideas?
if (@object_type ='17') and ( @transaction_type ='U') begin if EXISTS (select U_U_XX_POQty from RDR1 T0 where T0.DocEntry = @list_of_cols_val_tab_del and T0.LineNum =@list_of_cols_val_tab_del and U_U_XX_POQty is not null) begin set @error = 152 Set @error_message = 'Original Order Amount Cannot be changed' end end