cancel
Showing results for 
Search instead for 
Did you mean: 

A/P Invoice

Former Member
0 Kudos

Hi

I want to restrict through S.P that a particular user should not be able to create A/P Invoice directly . User must copy it from GRPO.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

kvbalakumar
Active Contributor
0 Kudos

Hi RS,

Try this

IF @Object_type = N'18' and @transaction_type in (N'A', N'U')
BEGIN 
 declare  @line5 int
 SELECT @line5 = (T1.LineNum + 1)
 From OPCH T0 inner join PCH1 T1 on T0.DocEntry = T1.DocEntry
 Where T1.DocEntry = @list_of_cols_val_tab_del
 and T1.[BaseType]!= N'20' and T0.DocType = 'I' and T0.UserSign = N'2'
 Order by T1.LineNum
	If (not ISNULL(@line5, 0) = 0)
	BEGIN
		Set @error = 10
		Set @error_message = N'Line ' + CONVERT(nvarchar(4), @line5) + N' is not copied from GRPO!'
	END
END

Change the usersign = '2' according to your requirement.

Regards,

Bala