Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 30, 2015 at 04:01 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 08:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 08:29 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 09:16 AM

    Hi,

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

    thanks & Regards

    Silambu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.