We have two UDT, one is the document table '@IOU_Main' and another document rows table '@IOU_Sub'. I have created an SBO transaction notification stored procedure which tries to update the field SAmt once the Amt field is updated. The command runs successfully when executed but the field remains unchanged whilst updating from SAP. Below is the sample code, please advice where i'm going wrong with my coding
IF @transaction_type = 'U' AND @object_type = 'T009'
BEGIN
IF EXISTS (SELECT T0.DOCENTRY FROM [dbo].[@IOU_Sub] T0 WHERE T0.U_SAmt = 0 and T0.DOCENTRY= @list_of_cols_val_tab_del )
BEGIN
UPDATE dbo.[@IOU_Sub] SET U_SAmt = (SELECT U_Amt FROM dbo.[@IOU_Sub] T0, inner join dbo.[@IOU_Main] T1 on T0.Docentry=T1Docentry WHERE T0.LineID = @list_of_cols_val_tab_del) WHERE DOCENTRY = @list_of_cols_val_tab_del
END
END
Thanks