Save Plan Publish log

The SCV log records are used to save the Plan Publish log records (SZ_PLAN_PUBLISH_LOG) using the LOG_PLAN program.

The LOG_PLAN program considers these input parameters:

C2
SCV database connection details.
JOBID
The ID of the External Job. This parameter is used when the program is being executed as part of another job in SCV.
Note: If the value is specified:
  • The value must be retrieved from the SZ_EXECUTION_LOG table with the Started status. If data is not available for the specified execution_id value, an error message is logged.
  • The LOG_PLAN program must not generate a new execution_id, however, the specified value is used as execution_id.
PLAN_NAME
The name of the plan that is being published.
PLAN_CATEGORY
The category name of the plan that is being published.
Note: If the specified value is not related to ‘Production’, ‘Purchase’, ‘Transfer’, ‘Inventory’ or ‘Sales, an error message is logged.
PLAN_SOURCE
The profile name of the SCP application which is used for publishing the plan.
PLAN_TABLE_NAME
The name of the SCV Core Plan in which the plan is being published.
Note: 
  • The specified value must be available in the SZ_REG_TABLE table.
  • If data is not available for the specified plan_table_name, an error message is logged.
SCP_CALENDAR_ID
The ID of the SCP calendar that is used by the plan being published.
SCP_CYCLE
The name of the SCP cycle from which the plan is being published.
SCP_CYCLE_PERIOD
The SCP cycle period from which the plan is being published.
SCP_SCENARIO
The name of the SCP scenario from which the plan is being published.
PLAN_START_DATE
The horizon Start date of the plan that is being published.
PLAN_END_DATE
The horizon End date of the plan that is being published.
PLAN_VERSION
The version details of the plan that is being published.
PLAN_TYPE
The type of the plan that is being published.
PLAN_SUBTYPE
The sub-type of the plan that is being published.
SCP_ORDER_STATUS
The SCP order status for the plan that is being published.
SCV_CYCLE_PERIOD_ID
The SCV cycle period ID for the plan that is being published.
SCV_SCENARIO_ID
The SCV scenario ID for the plan that is being published.

The log record is saved as follows:

  1. A new record is saved in the SZ_PLAN_PUBLISH_LOG table. For example:
    plan_log_id = <new unique number> 
    plan_name = <PLAN_NAME> 
    plan_category = <PLAN_CATEGORY> 
    plan_publish_time = <current timestamp in UTC> 
    plan_source = <PLAN_SOURCE> 
    plan_table_name = <PLAN_TABLE_NAME> 
    scp_calendar_id = <SCP_CALENDAR_ID> 
    scp_cycle = <SCP_CYCLE> 
    scp_cycle_period = <SCP_CYCLE_PERIOD> 
    scp_scenario = <SCP_SCENARIO> 
    plan_start_date = <PLAN_START_DATE> 
    plan_end_date = <PLAN_END_DATE> 
    plan_version = <PLAN_VERSION> 
    plan_type = <PLAN_TYPE> 
    plan_subtype = <PLAN_SUBTYPE> 
    scp_order_status = <SCP_ORDER_STATUS> 
    scv_cycle_period_id = <SCV_CYCLE_PERIOD_ID> 
    scv_scenario_id = <SCV_SCENARIO_ID> 
    created_by = "LOG_PLAN" + <current execution id> 
    creation_time = <current timestamp in UTC> 
    modified_by = "LOG_PLAN" + <current execution id> 
    modification_time = <current timestamp in UTC> 
    
  2. The changes are committed, if the log record is saved successfully.
  3. The status of the log record is set to the actual status.