cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict A User From Changing A Payment Term While Adding A/R Invoice

Former Member
0 Kudos

Dear Experts,

We want to restrict our users from changing payment terms while adding A/R Invoice.

We use SAP B1 2007 b.

Thanking you

Pradnya

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello,

Have you solved the issue and finding the solution ?

because first you define that which user can change your payment terms then your SP will work accordingly.

i have made for same sales order.

Thanks

Manvendra Singh Niranjan

Former Member
0 Kudos

Hi Pradnya.....

Try this.....

If @object_type='13' and @transaction_type='A'
BEGIN 
If Exists (Select * from [dbo].[OINV] T0 Inner Join INV1 T1 On T0.DocEntry=T1.DocEntry Left Join DLN1 T2 On T2.DocEntry=T1.BaseEntry Left Join ODLN 
T3 On T2.DocEntry=T3.DocEntry
Where T0.DocEntry = @list_of_cols_val_tab_del and T0.GroupNum <>T3.GroupNum)
BEGIN
Select @error = -1,
@error_message = 'You can not change Payment terms'
End
End

Regards,

Rahul

Former Member
0 Kudos

Hi Rahul,

I have already tried something like this in test database on BP master.

But no results.

If @object_type='2' and @transaction_type='U'

BEGIN

If Exists (Select groupnum from ocrd Where T0.DocEntry = @list_of_cols_val_tab_del )

BEGIN

Select @error = -1,

@error_message = 'You can not change Payment terms'

End

End

Thanking you

Pradnya

Former Member
0 Kudos

Hi Rahul,

I have already tried something like this in test database on BP master.

But no results.

If @object_type='2' and @transaction_type='U'

BEGIN

If Exists (Select groupnum from ocrd Where T0.DocEntry = @list_of_cols_val_tab_del )

BEGIN

Select @error = -1,

@error_message = 'You can not change Payment terms'

End

End

Thanking you

Pradnya

former_member206488
Active Contributor
0 Kudos

Hi,

try below code in transaction notification procedure:

if (@object_type = '13') and (@transaction_type IN ('A', 'U')) 
BEGIN
IF exists (select T0.DocEntry FROM OINV T0 Inner Join OCRD T1 on T0.CardCode=T1.CardCode Where T0.GroupNum  !=T1.GroupNum and T0.DocEntry =@list_of_cols_val_tab_del)
		Begin
			SET @error = 30
			SET @error_message =N'You are not authorized to change payment terms'	
		end

END

for how the transaction notification works or how to use :

check

Thanks,

Neetu

Former Member
0 Kudos

Hi Neetu,

Hi Rahul,

I have already tried something like this in test database on BP master.

But no results.

If @object_type='2' and @transaction_type='U'

BEGIN

If Exists (Select groupnum from ocrd Where T0.DocEntry = @list_of_cols_val_tab_del )

BEGIN

Select @error = -1,

@error_message = 'You can not change Payment terms'

End

End

link provided by you gave me an insight. It is very helpful indeed.

Thanking you

Pradnya

Former Member
0 Kudos

Hi Pradnya.........

SP you are trying is wrong i guess........

Regards,

Rahul

former_member206488
Active Contributor
0 Kudos

you need to block users from chaning payment terms on AR invoice but notification script you wrote seems wrong as it is checking for BP master payment terms.

Former Member
0 Kudos

Hi Neetu,

have already tried something like this in test database on BP master.

But no results.

If @object_type='2' and @transaction_type='U'

BEGIN

If Exists (Select groupnum from ocrd Where T0.DocEntry = @list_of_cols_val_tab_del )

BEGIN

Select @error = -1,

@error_message = 'You can not change Payment terms'

End

End

link provided by you gave me an insight. It is very helpful indeed.

Thanking you

Pradnya

former_member206488
Active Contributor
0 Kudos

this is wrong script if you want to block users from changinf payment terms on AR invoice.

why you are checking BP master ibject type?

Former Member
0 Kudos

Hi all,

My sole purpose is to restrict user from changing Payment terms either through master or through transaction. For testing ,

I tried on master in the test database.

Thanks

Former Member
0 Kudos

Hi Pradnya.......

You can use SP transnotification or better if you use Approval Procedure.

Regards,

Rahul