cancel
Showing results for 
Search instead for 
Did you mean: 

SP Transaction Notification

Former Member
0 Kudos

Hi all.

I have a request from client saying we should create a error message when ever users try to create new vendor and not populating DflAccount field with proper bank account number. I have made a start in SP Transaction Notification, but are having some issues when trying to limit it to only apply for BP of type vendors.The solution I have will actually occur whenever creating a new BP in the system. Maybe I need some modification saying this will only occur when BP is added and not when a BP is updated as well.


If @object_type = '2'

            begin
                                               
                      Declare @PDflAccount as nvarchar(50)
                                               
                      Select @PDflAccount = DflAccount from OCRD where Cardcode = @list_of_cols_val_tab_del
                               
	      If  (@PDflAccount is null)

                        begin
                        set @error = 1
                        set @error_message = 'Please enter a bank account number before saving'
                                                                                end
end

Appreciate all help.

Best regards, Runar Wigestrand.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try it as

If @object_type = '2' and @transaction_type = 'A'

begin

if exists ( Select top 1 1 from OCRD where Cardcode = @list_of_cols_val_tab_del and cardtype='S' and len(coalesce(DflAccount, '')) = 0)

begin

set @error = 1

set @error_message = 'Please enter a bank account number before saving'

end

end

Former Member
0 Kudos

Excellent.

This worked just fine.

Best regards, Runar Wigestrand.

Answers (1)

Answers (1)

Former Member
0 Kudos

Try the following:


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

-- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose

Former Member
0 Kudos

Great, thanks.

Can you also provide the variable for setting the card type to 'S' (Vendor)?

Where can I find more documentation on SP Transaction Notification?

Regards, Runar.

Former Member
0 Kudos

SP_Tranaction Notification Procedure Explanation

[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e991e2b9-0901-0010-0395-ef5268b00aaf]


Select @PDflAccount = DflAccount from OCRD where Cardcode = @list_of_cols_val_tab_del and cardtype='S'