cancel
Showing results for 
Search instead for 
Did you mean: 

SBO_SP_TransactionNotification - error message not displaying

Former Member
0 Kudos

I have modified the stored procedure SBO_SP_TransactionNotification to generate some error messages, only the error number is correctly showing but the error messages are not being displayed on SAP B1.

The codes that I've used are:

SET @error = 1

SET @error_message = 'Error Message one'

I am currently using SAP 2007 A (note that the above works fine on SAP 2005).

Anyone can help?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

It should be easier with the full query...

Personally, I use the following:

SELECT @Error = 1, @error_message = N'Error Message one'

Regards,

Eric

Former Member
0 Kudos

Thanks for your reply Eric, but the error message is still not being displayed. Here's the actual code I've tried:

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

go

ALTER proc .[SBO_SP_TransactionNotification]

@object_type nvarchar(20), -- SBO Object Type

@transaction_type nchar(1), -- dd, pdate, elete, 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 (

Wendy dit :

-- 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'

-

-


-- ADD YOUR CODE HERE

IF @object_type = '2'

BEGIN

Declare @BPname as numeric -- error 10

-- START ERROR 10

-- Check for duplicate BP Name for same BP Type

SELECT @BPname = COUNT(T0.CardName)

FROM OCRD T0

WHERE T0.CardName IN (SELECT T1.CardName

FROM OCRD T1

WHERE T0.CardType = T1.CardType

AND T1.CardCode = @list_of_cols_val_tab_del)

IF @BPname > 1

BEGIN

select @error= 10, @error_message = N'BP name already exists'

END

END -- IF @object_type = '2'

-- Select the return values

select @error, @error_message

end

Former Member
0 Kudos

OK

I guess I understand...

The last SELECT @Error... override the one with the real error informations: you just have to comment it and it should work.

Regards,

Eric

Former Member
0 Kudos

Did try to comment the last select statement, but still not working.

Actually, the correct error number (10) is being displayed, but the actual error message 'BP name already exists' is not being displayed. We get only this message at the bottom of the screen :'Internal error(10) occurred.'

Any idea?

Former Member
0 Kudos

I never tried with an error code different from 1....

Regards,

Eric