4.5.2 Undo Mechanism
- Undo Engine will set the
STATUS_FLAG
column inFSI_DATA_IDENTITY
table to 'U' to indicate the start of operation. - The engine code reads all the records from
FSI_DATA_IDENTITY
table. For each record that is read, it checks whether
SOURCE_TYPE = 0
TABLE_NAME = 'ledger_stat'
IDENTITY_CODE = <as entered by user>,
and
AS_OF_DATE = <as entered by user>
After reading all the records from FSI_DATA_IDENTITY
table,
if a matching record is not found then an error message is logged in the
FSI_MESSAGE_LOG
table. However, if a matching record is found, then
the Undo engine starts the undo process as detailed following.
- Based on the
IDENTITY_CODE
and Year specified in theAS_OF_DATE
, engine prepares and executes an update query to set the amount for the month specified in theAS_OF_DATE
to zero and attaches a decode statement to calculate the Year To Date amount values from the Period Start month to Period End month. It also attaches any data filter if present to this query. - Engine also prepares and executes a delete query on
LEDGER_STAT
table, to delete all the records for which all the month values are 0 andIDENTITY_CODE
equals to the value input by user. All entries relevant for theIDENTITY_CODE
are also deleted fromFSI_DATA_IDENTITY
table. - If the undo fails for any reason, status would be set as 'C'. If Undo
is completed successfully, the entry will be removed from
FSI_DATA_IDENTITY
table.