on 12-03-2007 12:02 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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?
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.