Purge planning data

The purge planning data process deletes planning data from SCV tables. This process is implemented using the PURGE_PLANNING_DATA program.

The PURGE_PLANNING_DATA program considers these input parameters:

C2*
The SCV database connection details.
JOBID
An external job ID. This parameter is used when the PURGE_PLANNING_DATA program is executed as part of another job in SCV.
Note: If this parameter is specified:
  • An existing entry must be available in the SZ_EXECUTION_LOG table with the Started status. An error message is logged, and the execution is stopped if an entry with the Started status is not available for the specified execution_id value in the SZ_EXECUTION_LOG table.
  • The PURGE_PLANNING_DATA program uses the specified value as the execution_id value without creating a new execution_id.
TABLE_NAME
The name of the table to be deleted.
Note: If this parameter is specified:
  • An existing entry must be available with the specified table name in the SZ_REG_TABLE table. An error message is logged, and the execution is stopped if an entry with the specified table_name value is not available in the SZ_REG_TABLE table.
  • Only one of the TABLE_NAME, TABLE_GROUP_NAME, or TABLE_AREA can be used at a time. An error message is logged, and the execution is stopped if more than one parameter is specified.
TABLE_GROUP_NAME
The name of the table group to be deleted.
Note: If this parameter is specified:
  • An existing entry must be available in the SZ_REG_TABLE_GROUP table. An error message is logged, and the execution is stopped if the entry with the specified table_group_name value is not available in the SZ_REG_TABLE_GROUP table.
  • Only one of the TABLE_NAME, TABLE_GROUP_NAME, or TABLE_AREA can be used at a time. An error message is logged, and the execution is stopped if more than one parameter is specified.
TABLE_AREA
The name of the table area to be deleted.
Note: If this parameter is specified:
  • An existing entry must be available in the SZ_REG_TABLE table. An error message is logged, and the execution is stopped if the entry with the specified table_area value is not available in the SZ_REG_TABLE table.
  • Only one of the TABLE_NAME, TABLE_GROUP_NAME, or TABLE_AREA can be used at a time. An error message is logged, and the execution is stopped if more than one parameter is specified.
SOURCE
The source system from which the planning data is to be deleted.
VERSION_COLUMN
The name of the column that maintains the business object version.
Note: If this parameter is specified:
  • The specified column must be available in all related tables.
  • An error message is logged, and the execution is stopped if the specified column is not available in one or more tables.
VERSIONS_TO_KEEP
The number of business object versions to maintain after deleting.
Note: If this parameter is specified, the VERSION_COLUMN parameter must also be specified.
DATE_COLUMN
The name of the column that contains the reference date to delete older data.
Note: If this parameter is specified:
  • The specified column must be available in all related tables.
  • An error message is logged, and the execution is stopped if the specified column is not available in one or more tables.
DAYS_TO_KEEP
The number of days data to retain.
Note: If this parameter is specified, the DATE_COLUMN parameter must be specified.
INCLUDE_XREF_TABLES
Indicates whether xref tables must also be deleted.
Note: By default, this option is set to Off.
PURGE_SCOPE
Determine the tables that must be considered during deletion. This parameter is only considered when the specified table is a core table. Possible values:
  • 0: All tables. The core and extension tables are included, if available.
  • 1: Only the base table in scope. Selected by default.
  • 2: Only the extension table is included.
Note: 
  • If the specified value is greater than 2, an error message is logged, and the execution is stopped.
  • If the PURGE_SCOPE value is set to 0 or 2, and the VERSION_COLUMN and DATE_COLUMN parameters are specified, the specified version and date columns must be available in the related extension table. Else, an error is logged, and the execution is stopped.

This table lists the default values for the input parameters of the PURGE_PLANNING_DATA program:

Parameter Default value Description Possible values
C2_PROVIDER sqlserver SCV database connection parameters: SCV database type. sqlserver
C2_HOSTNAME <scv-server> SCV database connection parameter: SCV database server name or IP number.
C2_PORT <scv-port> SCV database connection parameter: SCV database port number.
C2_DATABASE <scv-database> SCV database connection parameter: SCV database name.
C2_INSTANCE <scv-instance> SCV database connection parameter: SCV database instance name.
C2_USER <scv-user> SCV database connection parameter: SCV database username.
C2_PASSWORD <scv-password> SCV database connection parameter: SCV database password.
JOBID <external-jobid>

Program logic parameter: External Job ID.

This parameter is used when the PURGE_PLANNING_DATA program is executed as part of another job.

SOURCE Program scope parameter: Source.
TABLE_AREA This must be a valid table in SCV Table Registry.
TABLE_GROUP_NAME Program scope parameter: Table Group Name. This must be a valid name in SCV Table Groups.
TABLE_NAME Program scope parameter: Table Name. This must be a valid table name in SCV Table Registry.