cancel
Showing results for 
Search instead for 
Did you mean: 

Error while using B1 DI Event Services

reno1
Active Participant
0 Kudos

Hi Experts,

I am using SAP B1 DI Event Services for my addon functionality. I have downloaded the Required Server and Client installations for B1 DI Event Services. Have followed all the steps mentioned in the document attached for your reference.

We have inserted the code given below in the SBO_SP_TransactionNotification and executed the same. Now when ever i am adding any Marketing Document, I get the following error.

{code}[Microsoft][SQL Server Native Client 10.0][SQL Server]SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system{code}

SBO_SP_TransactionNotification:

@object_type nvarchar(20),    -- SBO Object Type       
@transaction_type nchar(1),  -- [A]dd, [U]pdate, [D]elete, [C]ancel, C[L]ose       
@num_of_cols_in_key int,       
@list_of_key_cols_tab_del nvarchar(255),       
@list_of_cols_val_tab_del nvarchar(255)       
       
AS       
       
begin       
       
-- Return values       
declare @error  int    -- Result (0 for no error)       
declare @error_message nvarchar (200)  -- Error string to be displayed       
select @error = 0       
select @error_message = N'Ok'       
       
--------------------------------------------------------------------------------------------------------------------------------       
     
DECLARE @object int  --declare the object variable
DECLARE @hresult int --declare the hresult variable
DECLARE @db_name nvarchar(120) -- database name
Select @db_name = db_name()

EXEC @hresult = sp_OACreate 'B1DIEventsSender.Profiler', @object OUT
EXEC @hresult = sp_OAMethod @object, logDb,  NULL,
@db_name,
@object_type,
@transaction_type,
@num_of_cols_in_key,
@list_of_key_cols_tab_del,
@list_of_cols_val_tab_del

IF @hresult <> 0
  BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
  END


--------------------------------------------------------------------------------------------------------------------------------       
   
select @error, @error_message       

end

Please request valuable suggestions.

Regards

Rohan S. Kamble

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Rohan ,

If you get error, you  will enable xp_cmdshell to execute , to resolve it run the following script:

USE master

GO

sp_configure 'show advanced options', 1;

GO

RECONFIGURE;

GO

sp_configure 'Ole Automation Procedures', 1;

GO

RECONFIGURE;

GO

Run additional script If you still receive an error :

"SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server."

USE master

GO

EXEC sp_configure 'show advanced options', 1

GO

RECONFIGURE

GO

EXEC sp_configure 'xp_cmdshell', 1

GO

RECONFIGURE

GO

EXEC sp_configure 'show advanced options', 0

GO

Best regards,

Evgeny Gova

Answers (0)