Skip to Content

Transaction notification SAP b1

Hi
I am just learning about transaction notification, but my code is not working correctly

I want to block someone from closing the Sales order when there are lines released to pick lists (status = R or Y)

Please could you check if something needs to be changed?

Thanks

Vicky

--ADDYOURCODEHERE

---- Block closing SO when items released to pick list

IF @object_type in ('17') and @transaction_type IN ('U','C', 'L') BEGIN IF Exists (SELECT T0.[DocEntry] FROM RDR1 T0 where T0.DocEntry = @list_of_cols_val_tab_del and (T0.PickStatus) in ('R','Y')) BEGIN Select @error = 001, @error_message = 'TN: Cannot CLOSE SO Rows are released to pick list.' END END

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 26 at 06:16 PM

    Here is an example you can have idea what you are missing

    IF @transaction_type IN ('A','U') AND @Object_type = '17' BEGIN IF EXISTS (SELECT T0.[DocEntry] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T1.[BaseType] = '-1' and t0.DocType = 'I' and T0.DocEntry = @list_of_cols_val_tab_del) BEGIN SELECT @Error = 17, @error_message = 'Sales Order without Sales Quotation' END END

    Add comment
    10|10000 characters needed characters exceeded