cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Procedures for blocking all transaction in SAP B1 for particular date

Former Member
0 Kudos

Hi Experts,

Stored Procedures for blocking all transaction in SAP B1 for particular date.

I tried below query it still allows me to book AP, AR etc.

If (@object_type = '30') and @transaction_type IN ('U','A')

BEGIN

   If exists (SELECT  Distinct 'Error' FROM OJDT T0 INNER JOIN OUSR T1 ON t0.UserSign = T1.USERID

where  T0.TransId =@list_of_cols_val_tab_del and (t0.RefDate = '2015-03-30' and T1.USERID in ('5','6','15')))

  Begin

  SET @error = '777'

SET @error_message = 'No enteries in the 30.03.2015'

End

END

thanks to support on this query

Regards,

Dwarak

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member

Hi Dwarak,

If you want to block all transactions for a particular date, an easy way would be locking your posting period for that day. SP_TN may not work here.

Thanks,

Gordon

silambarasan_rajendran
Active Contributor
0 Kudos

Hi,

In my view,It won't work in Journal Entry . You have to write for each document.

thanks & Regards

Silambu

Rafaee_Mustafa
Active Contributor
0 Kudos

Hi Dawarakanath,

I think the issue with the Object Type = 30 is only appear when you post manual JE. else it uses base doc ObjType

you can try with

If (@object_type in ( '30', 13, 15, 18, 20)) and @transaction_type IN ('U','A')



regards

Rafaee M

former_member209066
Active Contributor
0 Kudos

Hi,

Please Check this

If (@object_type = '30') and @transaction_type IN ('U','A')

BEGIN

   If exists (SELECT  Distinct 'Error' FROM OJDT T0 INNER JOIN OUSR T1 ON t0.UserSign = T1.USERID

where  T0.TransId =@list_of_cols_val_tab_del and T0.TransType in ('13','18') and (t0.RefDate = '2015-03-30' and T1.USERID in ('5','6','15')))

  Begin

  SET @error = '777'

SET @error_message = 'No enteries in the 30.03.2015'

End

END

Thanks,

Nithi