How to Check Validity of an Accounting Period in Sage X3
As an ERP user it is quiet mandatory that whenever we do any accounting transaction, it should
be carried in Open Fiscal Year/Open Period.
Now if we design a custom screen that deals with financial transactions in Sage X3, it should
check for the validity of transaction date. In other words, it needs to be confirmed if the
transaction is being created for an open period/open Fiscal Year.
The Validation of this Accounting date may be difficult as we need to check for all the possible
conditions which can make this date valid.
But in Sage X3 this minor but vital task can be done by calling an inbuilt method. Please refer
the below given code snippet:
If [M:XXX0]ACCDATE <> [0/0/0]
Call CONTPER (VALEUR, [M: XXX0] LEDTYP, [M: XXX0] FCY) From CPTSUB
In the above code snippet the parameters for the sub program are mentioned below:
VALEUR = Date Value
LEDTYP= Ledger Type
Now if you select an invalid transaction date, i.e. Transaction Date of the Period/Year which is
closed, you would receive message stating “Period Not Open”/ “Fiscal Year Closed”.
This snippet can be added as per the technical requirement of your system. Once the Error is
logged you can make the MKSTAT = 2 so that the focus remains on the error field itself.