Searching for the “Operational Analytics on Steroid” Formula – SAP MII on HANA
SAP MII has come a long way since its inception as Lighthammer and then erstwhile acquisition by SAP and re-branded as SAP MII, which paved the path to manufacturing intelligence as a new domain of operational analytics. With time as the product got matured enough to foraying into the integration aspects of manufacturing automation and execution systems with ERP and thereby positioning itself as the middleware solution for “business to manufacturing” system integration.
Having the matured analytics platform now available on MII which can do trend analysis, multi-dimensional analysis and KPI modeling on near real-time data, along with the self-service composition environment (SSCE), the next expectation comes in to handle huge volume of time-series and tabular data collected from operations at the manufacturing plants, to do long-term trend and regression analysis on it. Moreover, manufacturers now want to predict and prevent operational issues such as machine downtimes, material quality and performance bottlenecks in production lines.
SAP MII in its traditional architecture on SAP NetWeaver Java and standard databases, may not be the ideal platform to do such analytics using huge data set, as it uses a standard database used by NetWeaver WebAS to store and manage the data. With SAP MII 15.0 now it is possible to install SAP MII on NetWeaver 7.4 which can use HANA as the database, thereby opening gateway for MII to leverage the power of HANA as an in-memory platform. But the question is – whether MII as a solution is now mature and capable enough to leverage the power of HANA? Let us explore and try to find an answer to this burning question.
The power of HANA lies in couple of major aspects – columnar and in-memory storage of data and ability to embed complex data processing and calculations in data layer as calculation views. You can create tables in HANA as columnar tables and then define the attribute views (fact tables), analytic views (measure and dimenions) and calculation views (complex calculations and data processing), which can be accessed from the user interfaces or business logic layer as OData services or by JDBC.
Let us now explore different options and use cases for MII on HANA to understand how MII can leverage the power of HANA and provide the “operational analytics on steroid” formula.
MII uses Manufacturing Data Objects (MDO) which is a framework in MII to model custom data model as per the application requirements. It creates database tables in the underlying database which NetWeaver uses. When MII is installed on HANA, the MDO are created as column tables on HANA database as I understand. But there is a caveat – the database tables and its columns created from MDO do not use the same name of the MDO provided by the user, instead it uses some cryptic names e.g. MDO100, FIELD100, etc, which is mapped to the user-defined MDO names in an internal application database table. So it is difficult to identify the table created for a MDO from the database layer. I understand from SAP MII product development team that this issue will be addressed in future release of MII to have the MDOs created in the database with the same user-defined names as in the MII catalog.
So having columnar tables and in-memory storage with fairly massive database capacity of HANA, large amount of data can be stored on the MDO and KPI, which is not otherwise recommended when MII is installed on traditional database. But if MDO is used, database operations or additional objects (such as HANA views) cannot be easily created at the database layer as MDO tables have cryptic names which makes it difficult to identify.
The workaround may be creating the tables in HANA database itself instead of using MDO. From SPS09 of SAP HANA there is support for storing time-series data as well, which is useful to store data from Historian or SCADA queried by MII/PCo.
Reporting & Analytics
Usually for analytics and reporting on MII, MDO, KPI or SQL queries are used to query the data from MDO, KPI or custom database tables (when external databases are used). The queries are created and managed on MII which are executed from Business Logic Transactions or web pages in MII. When HANA is used, it is not recommended to create queries directly on the column tables, rather create attribute, analytic and calculation views on the tables at the HANA database layer, on which the queries can be used or those can be executed directly as ODATA services from the consumer layer. As explained above, while using MDO it is not possible to create those views from HANA database layer as it is difficult to identify the correct MDO from there due to the cryptic names. So directly MDO queries can be developed on MII, which may not get the maximum performance benefits which HANA provides. Otherwise the tables need to be created in HANA database layer itself, instead of using MDO, and on which the HANA views can be developed. This way it may get the maximum performance benefit from HANA, but shall bypass the content management and other features of MII. Also it may require sometime to use some other data such as plant hierarchy (stored in Plant Information Catalog) or other configuration data available in MII for the analytics and queries.
One possible approach is developing the tables and views in HANA database layer, which can be accessed from MII SQL query interface by JDBC connection, on which the SQL queries can be developed on MII. BLS transactions can be then developed on MII to incorporate the business logic which will consume the queries and develop the end to end application logic. User interfaces then can be developed using SAPUI5 on MII consuming the BLS transactions as Xacute queries.
The architecture overview of the same is explained in the diagram below:
MII provides KPI framework using which multi-dimensional KPI objects can be defined to persist measures with the different dimensions (e.g. Time, Plant, Material, Workcenter, etc.). With MII on HANA, KPI objects are also created a column tables in HANA. The KPI objects are anyway created in the HANA database layer as multi-dimensional cubes on which KPI queries can be developed on MII to query the data based on different aggregation and time-periods with one or more dimensions. Having MII on HANA it makes it much easier to store long-term and huge volume of data in KPI objects and create analytics on it.
Plant Hierarchy Management
SAP MII provides a framework called Plant Information Catalog (PIC) to manage hierarchy of assets and objects in manufacturing plants and map the individual objects to tags which are the sensor data points maintained in Plant Data Historian or SCADA/DCS. The plant hierarchy with different tags (each object can have multiple data points or tags) can be quite complex and huge. Querying the hierarchy in real-time is usually performance intensive, if the structure is complex and have huge number of nodes. As PIC objects leverages HANA persistency mechanism on MII on HANA, working with PIC is supposed to be much easier in terms of performance.
PCo Notification Processing
SAP Plant Connectivity (PCo) provides an external adapter with SAP MII to send notification messages on change of tag values or files in an external system such as Plant Historian, SCADA or a remote folder. This is useful to trigger certain business logic in MII when the value of one or more data points changes to a certain extent e.g. machine input power tag value in SCADA becomes zero signifying a machine shut-down which may need a plant maintenance notification to be created in SAP ERP via SAP MII. In a large plant with many machines and mostly automated production lines with multiple data points, the number of notifications generated from SAP PCo and sent to MII can be quite huge. Based on the notifications sent from PCo, custom logic in MII can decide an event (e.g. machine breakdown) or a trend. When MII running on HANA, this can be another scenario which can leverage the performance boost provided by HANA in-memory processing. Moreover, additional features such as complex event processing and predictive algorithm can be developed on HANA using the Predictive Analysis Library (PAL) to provide more insight and intelligence on the data from notification messages.
Streaming Analysis by Smart Data Access
In SAP MII 15.0 SP03 and above, a new connection type is available for Smart Data Access (SDA), using which a HANA system can access and query the MII data as virtual tables dynamically. Through the SDA connector all PCo and Xacute queries are exposed (Xacute queries are BLS transaction queries which can embed any logic or any other queries) to the HANA system, on which real-time queries can be performed from HANA. So it provides a feature enable real-time monitoring or streaming data processing (by synchronous queries) for events or predictive analysis. One good example of streaming data processing using SAP Event Stream Processor (ESP) with SAP MII is explained in this blog by Sam Castro.
Centralized HANA as Analytics Hub
It is also possible to have HANA as a central instance with MII installed on traditional databases (may at each production site) and pushing the data from MII to HANA central instance for long-term and heavy analytics. This is more suitable when having MII deployed at each plant and is the same architecture followed by SAP OEE solution. This way the central HANA instance collates the data from individual instances at each plant by SLT replication, and can provide cross-plant analytics with drill-down and comparative metrics. But when it requires plant hierarchy (PIC) to be used or other configuration data from MII it may be a bit difficult to replicate the same from MII, which may need creating additional complex data models in HANA.
As I understand there is not any major enhancement done on MII 15.0 product for leveraging the power of HANA, but still it can use its massive storage and faster analytics capability as explained above. But it may need fairly good level of HANA development skill rather than only MII development skill. I am expecting to see more tighter integration of MII with HANA in the forthcoming releases to leverage the HANA features to the maximum extent possible from the MII platform itself.
As a conclusion I can say it definitely looks promising having HANA with MII to provide high-performance analytics on manufacturing operations and deep insights on trend and help in predicting and providing early warnings, but MII as a platform should also need to get matured more to leverage the capability of HANA to the fullest extent.
As of now if MII is installed on HANA, trend and KPI analysis on long-term and large amount of operational data may be some of the quick scenarios to try out.
I had some quite interesting discussion with Sam Castro and Rajeev Kansal on this topic in