Skip to Content
0

SP_Transaction Notification should not applicable to Manager User

Apr 15, 2017 at 10:00 AM

88

avatar image

Dear Experts,

Whatever the controls we are using in SP_Transaction Notification should not applicable to Manager User. Is there a way to solve this.

Please give me the solution ASAP.

Thanks in Advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
DIEGO LOTHER Apr 16, 2017 at 06:36 PM
0

Hi Amith,

It's possible but there is no a generic way to do this. If I'm not wrong every SAP B1 table that have object associated contains two columns that are called UserSign and UserSign2. When you create an invoice for example the field UserSign is filled with the id of the user that did the invoice. If you update the same invoice the field UserSign2 will be filled with the id of the user that updated the invoice.

Based on this scenario you can build your validations like this:

If (@object_type = '13') 
BEGIN
	DECLARE @UserSign AS INT, @UserSign2 AS INT
	SELECT @UserSign = UserSign, @UserSign2 = UserSign2 FROM OINV WHERE DocEntry = @list_of_cols_val_tab_del
	--If you an add an object you, then, need check UserSign field, if you update an object, then, you need check UserSign2
	IF ((@transaction_type = 'A' AND @UserSign <> 1) OR (@transaction_type = 'U' AND @UserSign2 <> 1))
	BEGIN
		--Write you validation here
	END
END

Hope it helps.

Kind Regards,

Diego Lother

Share
10 |10000 characters needed characters left characters exceeded
Kennedy T Apr 16, 2017 at 07:49 AM
0

Yes , In the Notification code you should key the manager id..

Regards,

Kennedy

Share
10 |10000 characters needed characters left characters exceeded
Amith D Apr 17, 2017 at 10:26 AM
0

Thanks, Diego Lother!!!

It resolves my issue.

But my client having 50 validations. Whether I need apply this SP to 50 validations??

Or, Is there any way that one SP that works to all validations.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Amith,

In this case yes, you need apply to your 50 validations. But you can try to write a generic query to fit your purpose, but remember you always should look the field UserSign and UserSign2 for the current table that you are validating.

P.S: If my answer solved your doubt, don't forget to click on button accept below my answer.

Kind Regards,

Diego Lother

0