Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Trigger not working while changeing the values of UDF

Dear Freind,

I have created one Trigger for ORDR for Sales order. It is working fine. For that i have created two UDF to Title level. When i fill all fields it shows the correct result in DocTotal. But problem is that, while updateing specific record it also update but only refresh the DocTotal.

Means suppose i change the value of UDF fields that time it is not working it gives following error.

"There is difference between the document total and component total"

ALTER TRIGGER AmountForPC1

ON dbo.ORDR

AFTER INSERT,

UPDATE

AS

SET NOCOUNT ON

UPDATE x

SET x.DocTotal = COALESCE(i.DocTotalSy, 0) + COALESCE(i.U_Ref, 0) + COALESCE(i.U_Sub, 0)

FROM dbo.ORDR AS x

INNER JOIN inserted AS i ON i.DocEntry = x.DocEntry

Thanks

Swapnil

Former Member
Not what you were looking for? View more on this topic or Ask a question