Skip to Content
0
Former Member
Oct 03, 2016 at 11:20 PM

SAP Stored Procedure - Block Document Add If...

21 Views

Hey there,

Trying to code in some business rules that I thought would be simple. I guess I was wrong, haha.

Basically, trying to stop the addition of a Sales Delivery if the business partner and warehouse meet certain criteria...

IF @object_type = '15' AND @transaction_type = 'A'

BEGIN

IF (SELECT CardCode from ODLN where CardCode = @list_of_cols_val_tab_del) IN ('BUSINESSPARTNER1','BUSINESSPARTNER2')

BEGIN

SELECT @error = -2425

SELECT @error_message = N'Failure!'

END

END

This doesn't work at all, doesn't seem to check the document being added.

Help please? 😊

Thanks in advance!