on 10-06-2014 1:47 PM
Dear all,
I wrote one simple SP with SPTransactionNotification for delete transaction type in user define object with object type 'Master data'.
DECLARE @CALC NVARCHAR(1)
SELECT @CALC = U_Calculated
FROM [@MSD_PERIOD]
WHERE [@MSD_PERIOD].Code = @list_of_cols_val_tab_del
IF @object_type = N'MSD_Period' AND @transaction_type = N'D'
AND @CALC = N'Y'
BEGIN
SET @ErrorID = 2
SET @ErrorMessage = 'Please update this Document' +@list_of_cols_val_tab_del + '_' +@transaction_type
END
But this SP with true conditions do not work and do not send any Error Message and so delete data.
if I clear condition "@CALC = N'Y'" then SP send Error Message and work properly 'Please update this Document139301_D', But with the addition of this condition with true value don't send any Error Message!
when adding Variable "@CALC" to @errormessage , Return an error message is empty and Just return the error number= 2.
IF @object_type = N'MSD_Period' AND @transaction_type = N'D'
-- AND @CALC ='Y'
BEGIN
SET @ErrorID = 2
SET @ErrorMessage = 'Please update this Document' +@list_of_cols_val_tab_del + @transaction_type + @CALC
END
As if the record is already deleted but record is exists!
Regards
Shayan
Hi,
Please refer below SAP note, its similar to your issue:
1909417 - SBO_SP_TransactionNotification does not receive
notifications when deleting Territory
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nagarajan,
I do n't access to SAP note.
Can you email the document to below address?
Thanks
Shayan
Hi Shayan,
Try:
IF @object_type = N'MSD_Period' AND @transaction_type = N'D'
BEGIN
IF Exists (SELECT Code
FROM [@MSD_PERIOD]
WHERE Code = @list_of_cols_val_tab_del AND U_Calculated='Y')
Begin
SET @ErrorID = 2
SET @ErrorMessage = 'Please update this Document' +@list_of_cols_val_tab_del + @transaction_type + @CALC
End
END
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gordon,
thanks for reply,
I try with your code and also Several similar code.
But this SP with true conditions do not work with transaction type 'D' and do not send any Error Message and so delete data.
when debugging this code in SQL it is ok and set Error Message and Error id.
Also,when try this code with transaction type 'U',it is ok.
but with transaction type 'D', do not work and delete data.
Thanks & Regards
shayan
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.