cancel
Showing results for 
Search instead for 
Did you mean: 

Posting date lock for PO

Former Member
0 Kudos

Dear All,

   Can any one provide me the stored procedure in sap business one for lock for PO and GRPO.

For Example:-

I have made two series name for purchase order one is PoDomestic and another is PoExport

I create one purchase order document of posting date 18.04.2012 of series PoDomestic

and create another purchase document of posting date of 19.04.12 of series PoExport

now when i want to make one new purchase order of posting date of 17.04.2012 for series PoDomestic it should not allow to add the document.Should throw an error that

'you can not make purchase order of earlier posting date'

and when i want to make one new purchase order of posting date of 18.04.2012 for series PoExport it should not allow to add the document.Should throw an error that

'you can not make purchase order of earlier posting date'

I mean to say that it should throw error for series wise.Means it should check the date and series both.

Thanks & Regards,

Aswini KUmar

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member218051
Active Contributor
0 Kudos

Hi Aswini,

You can use SP_TN to validate your posting date.

Try this ,At backend under

Database ---> Programmability ---> Stored Procedures ---> SP_TransactionNotification

If (@object_type = '22') and (@transaction_type in ('A' , 'U'))

BEGIN

        Declare @Lstdate  as datetime

        Declare @CurDate  as datetime

        set @Lstdate = (select MAX(opor.docdate) from OPOR where OPOR.Series = 420)

        set @CurDate = (select OPOR.DocDate from OPOR where OPOR.DocEntry

        = @list_of_cols_val_tab_del )

        if @CurDate < @Lstdate

        Begin

              set @error = -1

              set @error_message = 'Can Not Place Backdated Purchase Order'

        end

end

This is for purchase order. It is assumed that series number for domestic one is 420. You can get this from NNM1 table. similarly you can add for export series and OPDN table by capturing objtype from opdn table.

Thanking you

Malhaar

oliver
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aswini,

please repost this question into the correct forum again. Maybe have a look at the Forum Finder for the New SCN to see where this could fit best.

I'll put this post into moderation and it will get removed in the next days.

Best,

  Oliver