SAP Equipment Maintenance


Process description

This app template generates a process mining model for the SAP ECC Equipment Maintenance module. The scope of this module is the End-to-end maintenance operations; from the creation of a maintenance requirement to the closing of the work order along with all the states and tasks that are recorded in the work orders.

Notification

The Maintenance process begins with a new Notification, either generated simultaneously with the associated Work Order (eg. planned work orders) or manually by a user who has identified an issue with a specific piece of equipment that needs to be inspected or repaired. The Notification provides relevant information regarding the piece of equipment to be worked on, the type of work to be done, as well as relevant Work Center, Client and Plant information. The Notification will move through the outstanding, assigned and in process status before finally closing with the Work Order.

Work Order

Once a Notification is reviewed and attended, a Work Order is created order to properly follow the maintenance process; an estimated cost is defined based on the work to be done and the work hours that will be consumed. Further description of the work is incorporated into the Work Order such as the type of Order, the Priority of said order, the controlling area and business area that will absorb the cost. In this section of the process the Work Order will be created, reviewed and released by a superior, the material availability will be verified and the operations required for the work order to be completed will be set.

Operations

With the creation of the Work Order, the Operations required for the Work Order to be completed are assigned. The responsible operator will then start working on the equipment and execute the Operations. Operations are confirmed, either partially or completely, depending on the result of the Operation. Once all operations are completed, the Work Order is confirmed and the process continues.

Closed Work Order

Once all Operations are completed and the Work Order is confirmed, a Technical Completion review is done on the equipment Work Order to verify that the Operations done were the ones expected and that they were done correctly. With this verification, the Work Order is closed, along with the the associated Notification.

Available tags & due dates

The following tags are available by default.

Tag Description Business value
Rescheduled Work Order Tags work orders that have had more than 1 change in their time planned field A change in planned activities either shows and issue with execution or and error in the planning estimates.
Multiple Work Orders by equipment Identifies all those cases where an equipment has had consecutive work orders within a certain period. By default that period is 30 days. This tag might show issues with the way maintenance is being executed or with the excessive wear of the equipment.
Notification not closed Identifies notifications that haven't reached the closed status All notifications should be attended and closed in order to keep a proper maintenance for failing equipment. Open notifications could show inefficiencies in the first response to an equipment issue.
Priority 1 or 2 work order with late confirmation Select the priority 1 or 2 work orders that took more than certain time (5 days by default) between its release and the first time an operation is confirmed Not attended high priority orders might require attention to identify assignment problems in the process or any other issue that could generate those delays.
Operations without time planned Identifies Work Orders with any associated Operation with time planned set as zero An Operation should never have no time planned, as this implies that the activity requires no man hours in order to be completed, and it could also cause issues in the tools cost estimation logic. Could signal issues in Work Order planning.
Multiple users for same activity A work order has the same activity executed multiple times by different users.

The following due dates are available by default.

Due date Description Business value
Notification assignment Status of notification remains in "Outstanding notification" for more than certain time (7 days by default) Unattended Notifications imply issues with equipment that aren't being treated, which could lead to bigger problems in the equipment
Work order release date Work order remains in “Created” status for more than certain time (7 days by default) An inactive work order may show issues in the work assignment process
Work Order completion date Due date based on the Technical completion date vs the planned date for completion (Basic finish date) Highlights cases when cases go past the planned work finish dates; identifies planning issues
Work Order confirmation date Difference between the Confirmation timestamp for a work order and its Scheduled finish date Highlights confirmations that came in out of term; this shows an error in planning

Extraction

System configuration

This app template uses the SAP Plant Maintenance module within the SAP Enterprise Central Component (ECC).

Extraction tool configuration

The data extraction is developed for SAP and is using Theobald Xtract Universal. In general, you should follow the steps as described in Loading Data Using Theobald Xtract Universal (Automation Cloud) to set up data loading using Theobald Xtract Universal. Note: If you are using Automation Suite, make sure to select AUTOMATION SUITE as the DELIVERY option on the documentation page. In addition, select the Automation Suite version you are using to open the appropriate Loading Data Using Theobald Xtract Universal page.

Importing the template extractions

  1. Download the XU_template_extractions.zip file with template extractions for Automation Cloud or the XU_template_extractions_AS.zip file with template extractions for Automation Suite.
  2. This file contains the folders destinations, extractions, and sources. Copy the folders from the downloaded zip file to the config folder of Xtract Universal. The location of this folder is [XU_installation_path]/config.
  3. Open Xtract Universal Designer and click on the refresh button to load all extractions.

Configuring the extraction script

  1. Download the extract_theobald.zip file to load data for Automation Cloud or extract_theobald_AS.zip to load data for Automation Suite.
  2. This file contains the extract_theobald.ps1 script and the config.json file. Unzip the content on the server where Theobald Xtract Universal is installed.
  3. Configure the variables for the script.

Minimal setup

Depending on which fields have field history tracked, different change events will be recorded. Tracking of changes for fields and objects status must be configured for each table within SAP configuration. Recommended minimal setup is having the following table being tracked in CDPOS and JCDS tables:

Environmental settings

The following data is required to establish the connection to the SAP server where the Plant Maintenance objects are located:

System specific settings

The SAP Equipment Maintenance app template works on the End-to-end maintenance operations process; from the creation of a maintenance requirement to the closing of the Work Order along with all the states and tasks that are recorded along the way.


Input data

Input types

The following table provides an overview of the different field types and their default format settings.

Field type Description
date yyyymmdd , if inverse then 99999999 - date = yyyymmdd
time HH24MISS
double Decimal separator: . (dot); thousand separator: none
integer Thousand separator: none
text N/A

Input tables & fields

The following tables are extracted from the source system:

AFIH

Input table for Maintenance Work Order master data, containing Work Order properties.

Field Type Description
MANDT text Client Identifier (Primary Key).
AUFNR text Work Order identifier (Primary Key).
EQUNR text Identifier of the equipment to be worked on.
ILART text Indicates the type of activity to be executed.
WAPOS text Describes which preventive maintenance tasks should take place regularly at a technical object or a group of technical objects.
PLKNZ text Indicates the planning state of the Work Order, planned, unplanned or immediate.
WARPL text Indicates the associated maintenance plan of the Work Order.
IWERK text Indicates the Plant that assigns and schedules the Work Order.
IPHAS text Indicates the Maintenance phase the Work Order is currently on.
QMNUM text Notification identifier.
AKKNZ text Characterize the technical characteristics of the order.
PRIOK text Identifies the priority of the Work Order.
ARTPR text Indicates the type of Priority assigned to the Work Order, PM is the standard type.
GEWRK text Identifies the Work Center associated to the Work Order.

Filtering: This table doesn't have any date field that can be used for filtering purposes. Therefore, it was join with AUFK table to bring the filter by date when loaded from source

AFKO

Input table for the Production Planning Work Order master data. It contains Work Order properties.

Field Type Description
MANDT text Client Identifier (Primary Key).
AUFNR text Work Order Identifier (Primary Key).
GLTRP date Indicates the date by which the Work Order should be completed.
GLUZP time Indicates the time by which the Work Order should be completed.
GETRI date Indicates the date by which the Work Order was completed.
GEUZI time Indicates the time by which the Work Order was completed.
AUFPL text Foreign key which identifies activities or operations need to be carried out to close the Work Order.
GLTRS date Identifies the planned date for the Work Order to be completed.
GLUZS time Identifies the planned time for the Work Order to be completed.

Filtering: This table doesn't have any date field that can be used for filtering purposes. Therefore, it was join with AUFK table to bring the filter by date when loaded from source

AFVC

Input table for the Operations data. It contains Operations description and times.

Field Type Description
MANDT text Client Identifier (Primary Key).
APLZL text Operation (Primary Key).
AUFPL text Operation set identifier (Primary Key).
OBJNR text Identifier of the operation object.
ARBID text Identifier of the assigned center of the Operation.

Filtering: This table gets filtered by "STEUS" field. Extractor is only bringing records when value is not like 'QM%'_

AFVV

Input table for the Planification of an Operation. It contains Operations time planned.

Field Type Description
MANDT text Client Identifier (Primary Key).
APLZL text General counter for order (Primary Key).
AUFPL text Routing number of operations in the order (Primary Key).
DAUNO double Normal duration of the activity.

AUFK

Input table for general Work Order master data. It contains Work Order properties and foreign keys.

Field Type Description
MANDT text Client Identifier (Primary Key).
AUFNR text Work Order Identifier (Primary Key).
GSBER text Business of the assigned area.
BUKRS text Identifier of the Company for whom the Work Order is being executed.
KOKRS text Controlling area of the Work Order, cost center to which the Work Order will be computed.
ERDAT date Date the Work Order was created.
ERFZEIT time Time the Work Order was created.
KTEXT text Description of the Work Order.
USER4 double Estimated cost of the Work Order.
STORT text Location of the Work Order.
SOWRK text Location of the plant the Work Order is assigned to.
OBJNR text Identifier for the object (Work Order) status changes, foreign key to JCDS table.
WAERS text Identifies the currency type being used for the Work Order.
AUART text Identifies the type of PM Order referred.
WERKS text Plant that executes the Work Order.
IDAT2 date Date on which the Work Order was closed.
VAPLZ text Main work center for maintenance tasks.
ERNAM text Creator of the Work Order.

Filtering: 'ERDAT' is used for time-based filtering. This table is also filtered by "AUTYP" field which must have value = '30'

CDHDR

Header input table for object changes.

Field Type Description
MANDANT text Client Identifier (Primary Key).
CHANGENR text Change record identifier (Primary Key).
OBJECTCLAS text Object class category (Primary Key).
OBJECTID text Object value (Primary Key).
UDATE date Date the change was executed.
UTIME time Time the change was executed.
USERNAME text User who executed the change.

Filtering: 'UDATE' is used for time-based filtering.

CDPOS

Log table for field change events for Work Orders, Operations and Notifications.

Field Type Description
TABKEY text Change table record identifier (Primary Key).
CHNGIND text Identifies the type of change made (insertion, update) (Primary Key).
MANDANT text Client Identifier (Primary Key).
CHANGENR text Change record identifier (Primary Key).
FNAME text Field which was updated (Primary Key).
OBJECTCLAS text Object class category (Primary Key).
OBJECTID text Object value (Primary Key).
TABNAME text Table name where the change was executed (Primary Key).
VALUE_NEW text Value which was updated into the table.
VALUE_OLD text Value which was updated out of the table.

Filtering: 'FNAME' != 'KEY' and 'TABNAME' in ('QMEL', 'AFIH', 'AFKO', 'AUFK', 'AFVC')

JCDS

Log table that contains all status changes for Work Orders, Operations and Notifications.

Field Type Description
CHGNR text Change number record identifier (Primary Key).
MANDT text Client Identifier (Primary Key).
INACT text Indicates if the status is currently active.
OBJNR text Object number where the Status change will be impacted.
STAT text Status to which the Object was update to.
UDATE date Date on which the change was made.
UTIME time Time on which the change was made.
USNAM text User that executed the change.

Filtering: 'UDATE' is used for time-based filtering. Additionally,STAT != 'I0001' INACT = '' or is null.

QMEL

Transactional table for the notifications.

Field Type Description
MANDT text Client number identifier (Primary Key).
QMNUM text Notification identifier (Primary Key).
ERNAM text Creator of the Notification.
QMDAT date Date of the Notification.
QMTXT text Description of the work required by the Notification.
MZEIT time Time of the Notification.
OBJNR text Object number of the Notification record.
AUFNR text Order number of the Notification record.

Filtering: "HERKZ" field must take any of the following values:'01', '02', '03', '04'._ and 'AUFNR' is not null.

ADCP

Input table for Person/Address Assignment (Business Address Services) data.

Field Type Description
ADDRNUMBER text Address Number of the Business (Primary Key).
CLIENT text Client number identifier (Primary Key).
DATE_FROM date Date from which record applies (Primary Key).
NATION text Identifier for International Addresses.
PERSNUMBER text Identifier of the person/user (Primary Key).
DATE_TO date Date to which record applies.
DEPARTMENT text Department the user is assigned to.
FUNCTION text Function or role of the user.

Filtering: 'NATION' = 'I' or is null or = ''.

ADRP

Input table for Persons (Business Address Services) data.

Field Type Description
CLIENT text Client number identifier (Primary Key).
DATE_FROM date Date from which record applies (Primary Key).
NATION text Identifier for International Addresses (Primary Key).
PERSNUMBER text Identifier of the person/user (Primary Key).
DATE_TO date Date to which record applies.
NAME_FIRST text Name of the User.
NAME_LAST text Last name of the User.

Filtering: 'NATION' = 'I' or is null or = ''.

EQKT

This input table relates the Equipment descriptions to the model.

Field Type Description
MANDT text Client number identifier (Primary Key).
EQUNR text Equipment number identifier (Primary Key).
EQKTU text Name/description of the related equipment.
SPRAS text Language key identifier.

Filtering: 'SPRAS'= var("language").

T001W

Input table for plant information.

Field Type Description
MANDT text Client number identifier (Primary Key).
WERKS text Plant code identifier (Primary Key).
NAME1 text Plant name.

T003P

Input table for Order Type Descriptions data.

Field Type Description
CLIENT text Client number identifier (Primary Key).
SPRAS text Language key identifier (Primary Key).
AUART text Order code identifier (Primary Key).
TXT text Translation of the Order Type.

Filtering: 'SPRAS'= var("language").

TCURF

Input table for Conversion Factors data.

Field Type Description
MANDT text Client number identifier (Primary Key).
KURST text Represents the exchange rate type used for the conversion (Primary Key).
FCURR text Original currency (Primary Key).
GDATU date Date in which the record was created (Primary Key).
TCURR text Destination currency of the exchange rate (Primary Key).
FFACT double Ratio for the "From" Currency Units.
TFACT double Ratio for the "To" Currency Units.

Filtering: 'KURST' = var("exchange_rate_type").

TCURR

Input table for Exchange Rates data.

Field Type Description
MANDT text Client number identifier (Primary Key).
KURST text Represents the exchange rate type used for the conversion (Primary Key).
FCURR text Original currency (Primary Key).
TCURR text Destination currency of the exchange rate (Primary Key).
GDATU date Date on which the exchange rate is valid (Primary Key).
UKURS text The absolute exchange rate on the specific date.

Filtering: 'KURST' = var("exchange_rate_type").

TCURX

Input table for Decimal Places in Currencies.

Field Type Description
CURRKEY text Currency identifier (Primary Key).
CURRDEC integer Number of decimal places.

Filtering:

TJ02T

This input table relates the Status names to the model.

Field Type Description
ISTAT text Equipment number identifier (Primary Key).
SPRAS text Language key identifier.
TXT30 text Name/Description of the related Status.

Filtering: 'SPRAS'= var("language") and 'TXT30' != ''.

TKA01

Input table for controlling area information.

Field Type Description
MANDT text Client number identifier (Primary Key).
KOKRS text Controlling area key identifier (Primary Key).
BEZEI text Billing area description.

Filtering:

USR02

Input table for User type information.

Field Type Description
MANDT text Client number identifier (Primary Key).
BNAME text User key identifier (Primary key).
USTYP text Classification of the user.

USR21

Input table for User Name/Address Key Assignment data.

Field Type Description
MANDT text Client number identifier (Primary Key).
BNAME text User key identifier (Primary key).
ADDRNUMBER text Address Number of the Business.
PERSNUMBER text Identifier of the person/user.

Configuring transformations

Seed files

Automation_estimates_raw

This seed file is used to add automation-related properties to each activity, used for the automation potential dashboard. For more information, see Simulating Automation Potential.

Field Type Description
Activity Text Display name for the activity
Event_cost Double Cost associated with the activity
Event_processing_time Integer Processing time associated with the activity (in milliseconds)

Due_dates_configuration_raw

This seed file is used to define properties for the due dates. For more information, see Due Dates.

Field Type Description
Due_date Text The name of the due date
Due_date_type Text The Due date type
Fixed_costs Boolean An indication whether costs are fixed or time based
Cost Double Fixed costs: The amount of costs. Variable costs: The amount of costs per Time and Time_type
Time Integer A number indicating the amount of time in case of time-based costs
Time_type Text Type of time period for cost calculations. This can be any of the following values: day, hour, minute, second or millisecond

Automated Users

This file is used to set the users that are automated.

Field Type Description
User Text Name of a user.
Automated Text Indicates whether the user is a person or automation.

Automated Activities

This file is used to set activities that are automated.

Field Type Description
Activity Text Name of an activity.
Automated Text Indicates whether the activity is manually executed or automated.

Activity configuration

The Activity configuration file is used to translate activities and assign activity order.

Field Type Description
Foreign_key_id Text Foreign key to link to an activity.
Object Text Object to which the activity belongs.
Activity_name Text Name of the activity.
Activity_order Text Ordering of activity.

Dbt variables

Variable Type Description
schema_sources string Specifies the schema in the database where the source tables will be located.
start_date date Valid start date.
language string This variable specifies the system language, set accordingly to the default SAP system language. Default value is E (English).
use_operation_events boolean This variable adds additional Operation Object events, these events are usually created , updated and confirmed simultaneously, and the addition of these can interfere in the interpretation of the process ; in case these events are not essential, set the variable to false. Default value is true.
display_currency string This variable defines the currency to be displayed. Default value is USD.
exchange_rate_type string Defines the exchange rate to be applied on client currency in order to convert it into a single currency. Default value is M.
additional_days_for_notification_assignment_due_date integer Amount of days to be added to the creation of the notification to set the due date. Default value is 7.
additional_days_for_work_order_release_due_date integer Amount of days to be added to the creation of the Work Order to set the due date. Default value is 7.
days between_orders integer Days between consecutive orders for the same equipment. Default value is 30.
days_to_confirm_priority_work_orders integer Allowed time (in days) that a priority 1 or 2 Work Order can take before being worked on (partially confirmed). Default value is 7.

Design specifications

Objects

The following diagram shows all objects that are used for the process.

Object Input Data
Notification QMEL
Work Order AUFK,AFIH,AFKO,EQKT, TCURR,TKA01,T001W, T003P
Operations AFVC

Activities

Activity Object Description
Create Notification Notification Notification is generated in the system. Identified through the Created_date field on the Notification Object.
Change Notification status to Status Notification Notification status is modified. Identified based on the JCDS object record
Change Notification Field Notification Indicates a change in relevant fields in the Notification
Create Work Order Work Order Work Order is created in the system. Identified through the Created Date field in Work Order
Change Work Order status to Status Work Order Work Order status is modified. Identified through the JCDS object record
Change Work Order Field Work Order Indicates a change in a relevant field in the Work Order. The change is registered through the CDPOS and CDHDR tables
Change Operation status to Status Operation Operation status is modified. Identified based on the JCDS object record

Design details

Work Order Object definition Work Order is a single Object comprised of three different SAP objects, not including master data. The AUFK (Work Orders), AFIH (Maintenance Orders), and AFKO (Plant Production Orders) all represent a single record/Case Id, but are classified differently in order to be processed. Changes to one imply changes to the other, that is why they are considered a single Work Order Object. Every object provides a different attribute or key which is necessary for the model.

Case Value attribute Case value attribute gets populated based on header information in the relevant SAP objects. Case value is defined based on the Estimated cost of a Work Order but this is an approximate value the client manually inputs and can be null if the client is not using it. There is no other simple way to get a value for the WO.

Case Status Definitions Case status is defined by the final status of the Work Order, registered in the JCDS table. Despite the AUFK object having a specific field referencing the status, ASTNR field does not provide a reliable status for each case represented, thus the status was obtained from the last active Work Order status in the change log.

Known limitations

No Event Start

Event start information is not present.

Troubleshooting

Data not recorded in CDHDR/CDPOS or JCDS objects

Change and Status events have to be configured in the environment in order to be tracked; these configurations are not retroactive to previously registered records.