331
SCM380 SAP MII - Manufacturing- Integration and Intelligence - Basics SAP ERP Production Date Training Center Instructors Education Website Participant Handbook Course Version: 73 Course Duration: 5 Days Material Number: 50086053 An SAP course - use it to learn, reference it for work

sap

Embed Size (px)

Citation preview

SCM380SAP MII - ManufacturingIntegration and Intelligence BasicsSAP ERP Production

Date Training Center Instructors Education Website

Participant HandbookCourse Version: 73 Course Duration: 5 Days Material Number: 50086053

An SAP course - use it to learn, reference it for work

CopyrightCopyright 2008 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Trademarks Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint and SQL Server are registered trademarks of Microsoft Corporation. IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX, S/390, AS/400, OS/390, and OS/400 are registered trademarks of IBM Corporation. ORACLE is a registered trademark of ORACLE Corporation. INFORMIX-OnLine for SAP and INFORMIX Dynamic ServerTM are registered trademarks of Informix Software Incorporated. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, the Citrix logo, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, MultiWin and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. JAVA is a registered trademark of Sun Microsystems, Inc. JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies.

DisclaimerTHESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.

g200842941358

About This HandbookThis handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study.

Typographic ConventionsAmerican English is the standard used in this handbook. The following typographic conventions are also used. Type Style Example text Description Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options. Also used for cross-references to other documentation both internal (in this documentation) and external (in other locations, such as SAPNet). Example text EXAMPLE TEXT Emphasized words or phrases in body text, titles of graphics, and tables Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE. Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program. Exact user entry. These are words and characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.

Example text

Example text

2008

2008 SAP AG. All rights reserved.

iii

About This Handbook

SCM380

Icons in Body TextThe following icons are used in this handbook. Icon Meaning For more information, tips, or background Note or further explanation of previous point Exception or caution Procedures

Indicates that the item is displayed in the instructor's presentation.

iv

2008 SAP AG. All rights reserved.

2008

ContentsCourse Overview ......................................................... viiCourse Goals ...........................................................vii Course Objectives .....................................................vii

Unit 1: Introduction to SAP MII ......................................... 1SAP MII Introduction and System Overview ........................2 SAP MII Installation................................................... 13 SAP MII Help and Support........................................... 31

Unit 2: Data and Visualization Services ............................ 39Workflow: Creating an SAP MII Application ....................... 41 SAP MII Data Server ................................................. 46 Query Templates ...................................................... 61 Display Templates .................................................... 87 Dynamic Page Generator ............................................ 98 Content Generation Wizard.........................................123 Navigation.............................................................134 Data Buffering ........................................................146

Unit 3: Web Scripting in SAP MII .................................... 151Applet Parameters in SAP MII .....................................153 Applet Events in SAP MII ...........................................169 Creating Reports with SAP MII.....................................191 Creating Multilingual SAP MII Applications .......................198 Data Input and Output in SAP MII .................................204

Unit 4: Business Logic Services .................................... 217Transactions in the SAP MII Workbench .........................219 Calling Transactions .................................................233 Creating Additional Transactions ..................................262 User-defined Actions in SAP MII...................................295

Unit 5: SAP MII Connection to an SAP ECC System............ 299JCo and JRA Interfaces ............................................300 SAP MII Message Services ........................................313

Glossary................................................................... 321

2008

2008 SAP AG. All rights reserved.

v

Contents

SCM380

vi

2008 SAP AG. All rights reserved.

2008

Course OverviewThis course introduces you to SAP MII, Manufacturing Integration and Intelligence. Aside from providing an overview of the product and its installation, this course enables you to use the scope of functions provided by SAP MII.

Target AudienceThis course is intended for the following audiences: Members of project teams and consultants who use Manufacturing Integration and Intelligence (SAP MII) to extract, aggregate and transform data from existing systems.

Course PrerequisitesRequired Knowledge Basic knowledge of the manufacturing industry. Basic knowledge of web technologies such as HTML, JavaScript, XML, XSL and CSS Basic knowledge of the creation of database queries Basic knowledge of SAP ERP

Course GoalsThis course will prepare you to: Gain an understanding of the functions and possible uses of SAP MII 12.0 so that you can collaborate successfully in its introduction in a company. Use SAP MII 12.0 to integrate data from the systems in production with the data of SAP ERP systems.

Course ObjectivesAfter completing this course, you will be able to: Describe the different services provided by SAP MII: data services, visualization services, business logic services, message services, security services and navigation services Use the different SAP MII services to support companies in the area of manufacturing with the integration of data (Manufacturing Integration) and process optimization (Performance Management and Manufacturing Intelligence)

2008

2008 SAP AG. All rights reserved.

vii

Course Overview

SCM380

viii

2008 SAP AG. All rights reserved.

2008

Unit 1Introduction to SAP MIIUnit OverviewThis unit provides an overview of SAP MII, its areas of application, and its benefits. You learn about the architecture of SAP MII, its main components and functions. Following that, you find out about the system environment in which SAP MII runs, and also about its installation. After completing this unit you will also know where you can find references and help on the SAP MII topic.

Unit ObjectivesAfter completing this unit, you will be able to: Understand the term SAP MII Name the application areas of SAP MII Name the benefits of SAP MII Describe the integration architecture of SAP MII Describe the range of services of SAP MII Describe the system architecture and name the system requirements for SAP MII Describe the steps of the SAP MII installation Use UME to create and change roles and users for SAP MII Describe the installation steps of other software that is related to SAP MII Describe how you use the SAP MII migration tool to copy contents from an earlier version into SAP MII Version 12.0 Name the sources of help and support for problems with SAP MII

Unit ContentsLesson: SAP MII Introduction and System Overview .........................2 Lesson: SAP MII Installation ................................................... 13 Procedure: Server-Side Installation Process ............................ 18 Lesson: SAP MII Help and Support ........................................... 31 Exercise 1: Finding Help and Solutions to Problems ................... 35

2008

2008 SAP AG. All rights reserved.

1

Unit 1: Introduction to SAP MII

SCM380

Lesson: SAP MII Introduction and System OverviewLesson OverviewIn this lesson, you will find out about the term SAP MII, its areas of application and its benefits. You will get to know the SAP MII integration architecture and get an initial overview of the SAP MII service spectrum.

Lesson ObjectivesAfter completing this lesson, you will be able to: Understand the term SAP MII Name the application areas of SAP MII Name the benefits of SAP MII Describe the integration architecture of SAP MII Describe the range of services of SAP MII

Business ExampleYou are asked for a quick description of SAP MII: What is SAP MII, and for what purposes can it be used.

The Term SAP MIISAP MII - Manufacturing Integration and Intelligence. After the purchase by SAP, SAP MII, previously know as the Lighthammer Collaborative Manufacturing Suite (CMS), was first integrated into the group of xApp products. Since 01.01.08 it is called just SAP MII, rather than xMII. Manufacturing integration: SAP MII enables the seamless integration of production processes with business procedures. The manufacturing systems are integrated with the business applications using open standards. Manufacturing intelligence: SAP MII collects and calculates data and uses events, alarms, and key figures to promptly provide users with all decision-relevant information. MII users can use a role-based web portal to access all important data. This enables fast and well-founded decisions that benefit your company directly. Hint: SAP MII product information is available on the SAP homepage at: http://www.sap.com/usa/solutions/manufacturing/manufacturingintelligence-software/index.epx

2

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Introduction and System Overview

Adaptive Manufacturing: The terms Manufacturing Integration and Manufacturing Intelligence are part of the Adaptive Manufacturing approach: Data from manufacturing is to be retrieved and formatted centrally to enable faster and more flexible responses to customer requirements. Hence, strategic decisions can be implemented successfully.

Figure 1: Adaptive Manufacturing and SAP MII

Hint: For more information about the Adaptive Manufacturing approach, click this URL:http://www.sap.com/usa/solutions/manufacturing/manufacturing-intelligence-software/brochures/index.epx There, you will find the English document titled:Pursuing Manufacturing Excellence Through Real-time Performance Management and Continuous Improvement from the ARC Advisory Group.

Application Areas of SAP MIISAP MII is a very flexible, industry-neutral integration platform.

2008

2008 SAP AG. All rights reserved.

3

Unit 1: Introduction to SAP MII

SCM380

SAP MII helps you create your own applications, from simple to highly complex solutions such as: OEE calculations Creation of reports Analyses Dashboards Integration of manufacturing and ERP systems and so on.

In doing so, SAP MII usually does not replace existing systems but builds on these. SAP MII can therefore also be called Composite Application Platform for Manufacturing Operations. Composite Applications refer to: Business-process oriented applications composed according to the building block concept. They combine data and functionalities from existing sources and applications with new functions on several levels (people, processes, information, and applications). In a service-oriented architecture, composite applications enable you to very quickly map those business processes that represent a real competitive advantage to the company.

Figure 2: Application Areas of SAP MII

Examples for the different areas of application: Human to ERP integration: An operator operates the production end on his screen. The production end is transmitted to the ERP system.

4

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Introduction and System Overview

ERP to human to machine integration: Entry, monitoring and forwarding of QM data to the ERP system. Transaction-based exchange between older production system and ERP: Automatic exchange of information between automation level and ERP. Transaction-based exchanged between modern manufacturing applications and ERP, based on standards: Standardized integration of ERP and MES applications, for example, using ISA-95.

Benefits of SAP MIISAP MII offers your company the following advantages: Low total costs of ownership: SAP MII establishes a real time link between manufacturing and ERP systems. Prefabricated connectors based on standards reduce the launch costs, complexity and system costs. Increased productivity in manufacturing: The application collects data from different systems and makes relevant information in the form of alarms, reports, and key figures available to manufacturing employees. A company-wide uniform display of analysis data using a role-based, configurable dashboard supports fast, sound decisions. Continuous optimization of processes and performance: The real time analysis of the production processes enables you to use SAP MII to increase production activity in the long term. The employees in manufacturing can monitor, measure, and control initiatives for process improvement. These include Six Sigma, Lean Manufacturing and Right-First-Time Manufacturing. Better equipment utilization: SAP MII enables you to compare the activity of individual pieces of equipment or plants. Using the comparative values, you can optimize equipment utilization and rationalize unproductive equipment. Short amortization time: SAP MII can usually be implemented within 90 to 120 days and therefore pays for itself very quickly.

The following excerpt from the article: Talking to the Shop Floor by Torsten Kipping, SAP Marketing Manager EMEA Central, from December 2005 illustrates the benefits of SAP MII particularly well: More than 400 successful installations of the predecessor product emphasize the significance of SAP MII for the manufacturing industry. A cost comparison for a company with 20 manufacturing locations and a comprehensive, integrated

2008

2008 SAP AG. All rights reserved.

5

Unit 1: Introduction to SAP MII

SCM380

manufacturing solution over a five year period makes the advantages of SAP MII clear. Without an integrated solution, at least 50 interfaces to SAP components are required. Programming and maintenance - with standard costs of about 20,000 dollars per interface - cause costs of about 5 million dollars over this period. Since SAP MII directly integrates into the existing applications on the ERP side and in manufacturing, maintenance work and costs are not applicable. This calculation is not fictitious. New ERP and MES architectures based on web services form a basis for composite applications that synchronize manufacturing locations using standardized, global processes. Dow Corning, Whirlpool, Procter & Gamble, Colgate Palmolive, and others have demonstrated that it is possible to introduce composite applications such as SAP MII within a few months and to achieve a return on investment within a few weeks, documents AMR Research. Hint: You can read the full article here:http://www.sap.info/public/INT/int/index/Category-28943c61b1e60d84b-int/-1/articlesVersions-560343998ef53c4c6

The SAP MII Integration Architecture

Figure 3: The SAP MII Integration Architecture

SAP MII enables the data exchange between the operational and administrative level of your company using pure visualization of data between very different systems in manufacturing. This way, you can model and display business processes across applications. Besides a large number of connectors in the production environment, SAP MII also has excellent options for communicating with SAP ERP.

6

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Introduction and System Overview

SAP MII not only enables access to all SAP ERP and NetWeaver components but also makes its services and functions available to other SAP NetWeaver components such as XI, Enterprise Portal, and Visual Composer. You can also integrate products from third party providers using the SAP NetWeaver XI technology.

The SAP MII Range of ServicesNo administration on the client necessary (Zero Client Administration) SAP MII is installed only on the web server. No installation is required on the client. SAP MII has a service-based architecture SAP MII provides the services that are listed here, which are explained in more detail later on: Data services Visualization services Business logic services Message services Security services Navigation services

Figure 4: SAP MII Services

2008

2008 SAP AG. All rights reserved.

7

Unit 1: Introduction to SAP MII

SCM380

Data services The data services include all functions for connecting data sources or systems in SAP MII. Connectors to external systems MES, PLS, HMI, Historians, LIMS, and so on. SAP ERP connection (using SAP MII business logic services) JRA, JCO, WAS and IDocs SQL databases OLAP databases Importing and processing XML files

The result of each query against a data source is available in an SAP MII-specific XML format. Hence, we can speak of an XML abstraction layer with regard to database queries. Visualization services The visualization services include all functions for visualizing data. Display of data using Java applets Diagrams (iChart); tables (iGrid); ticker (iTicker); calendar (iCalendar) and list control elements (iBrowser) Display of SAP diagrams (iSPCChart) incl. the most important alarms as well as calculation of SPC-relevant statistical figures. Dashboard components Measuring instruments, status traffic lights Rendering of SVG graphics Besides a selection of graphics, which are included in the SAP MII delivery, you can use your own XML-based graphics for visualization. Supports XSLT to display data in pure HTML format

8

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Introduction and System Overview

Figure 5: Examples of Java Applets in SAP MII

Business Logic Services The business logic services include all functions that are available in transactions within SAP MII. Transactions are programs that are written using the graphical programming interface of SAP MII. Transactions in turn consist of individual parts, the actions, which provide you with individual functions. Within transactions, you can implement complex calculations or the consolidation of data from various sources. But actions for creating PDF documents or sending e-mails are also available.

2008

2008 SAP AG. All rights reserved.

9

Unit 1: Introduction to SAP MII

SCM380

Figure 6: SAP MII Transaction: Querying the Material List in SAP ERP

The SAP ERP connection is established exclusively by means of corresponding actions within a transaction. Every transaction is automatically available as a web service. Transactions can also be executed as time-controlled. Message services The message services include all functions for sending and receiving messages from other systems, such as: IDocs from SAP ERP RFCs from SAP ERP Web services

The messages can be processed further immediately or buffered for further processing. Security services The security services include all functions for authorization management. Besides (read, write) access to data, you can also administer authorizations for individual SAP MII functions. Navigation services The navigation services include all functions for setting up the SAP MII-integrated web portal with user and role-specific menu structure.

10

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Introduction and System Overview

SAP MII also helps you develop multilingual web applications.

2008

2008 SAP AG. All rights reserved.

11

Unit 1: Introduction to SAP MII

SCM380

Lesson SummaryYou should now be able to: Understand the term SAP MII Name the application areas of SAP MII Name the benefits of SAP MII Describe the integration architecture of SAP MII Describe the range of services of SAP MII

12

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Lesson: SAP MII InstallationLesson OverviewIn this lesson you will learn how to install SAP MII and what you have to keep in mind during the installation.

Lesson ObjectivesAfter completing this lesson, you will be able to: Describe the system architecture and name the system requirements for SAP MII Describe the steps of the SAP MII installation Use UME to create and change roles and users for SAP MII Describe the installation steps of other software that is related to SAP MII Describe how you use the SAP MII migration tool to copy contents from an earlier version into SAP MII Version 12.0

Business ExampleYour task is to introduce SAP MII in your company (new installation or upgrade) and to ensure that your manufacturing systems are connected to the SAP ERP system.

SAP MII: System Architecture and System RequirementsSAP MII architecture at one location/plant

2008

2008 SAP AG. All rights reserved.

13

Unit 1: Introduction to SAP MII

SCM380

Figure 7: SAP MII Installation at One Location

The location installation that is depicted as an example here uses SAP MII to visualize data from production to map business processes in production and to exchange data with the ERP system. For several plants, you need one SAP MII installation per location. SAP MII architecture for several locations/plants

14

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Figure 8: SAP MII Installations at Several Locations

In the exemplary architecture across several locations, an SAP MII server is set up at every production location. The reason for using one SAP MII server for each plant is that an SAP MII application communicates with numerous systems in production producing a large amount of data. These systems, such as Control Systems and Historians, were purchased plant or production-specifically in order to provide optimal production support. Since the volume of data can be very large, it would not make sense for performance reasons to send the data over longer distances across a network (WAN - Wide Area Network). With one SAP MII installation for each plant, you also have the option of running SAP MII applications offline. That is, if the WAN fails or maintenance work is being carried out on the ERP system, you could still use the local installation in production. System Requirements SAP MII 12.0 is installed on the SAP NetWeaver platform and requires the following version: SAP NetWeaver 7.0 (2004s) SPS 10 or above Used as: SAP Web AS 7.00 with SAP Web AS Java instance

2008

2008 SAP AG. All rights reserved.

15

Unit 1: Introduction to SAP MII

SCM380

The requirement for the server-side hardware is based mainly on the requirements of the SAP NetWeaver platform and you can look it up on this page: service.sap.com/quicksizer.

SAP MII: Installation StepsCaution: This section is intended only to give you an overview of the most important installation steps. It does not replace the official SAP documentation for the SAP MII 12.0 installation in any case. The following graphics show an installation on a Windows 2003 server. The SAP documentation is available at: service.sap.com/instguides SAP xApps SAP xApp Manufacturing Integration and Intelligence SAP MII 12.0 Overview of the installation Web server We recommend having at least two servers available for each SAP MII project: one for development and one for the production environment. An additional instance for quality assurance is optional. Time synchronization It is important that the SAP MII system and the systems in the production environment are in the same time zone and that they have the same time. Installation process

16

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Client-side installation Installation of Java Sun JRE (Java Runtime Environment) On the client side, SAP MII requires the following Java Sun versions: JRE 1.4.2_07 or above or JRE 1.5.0_06 or 1.5.0_10+. You can download these versions from http://java.sun.com/products/archive/index.html. For JRE 1.5.0_ Data_access10 select the version in the following menu entry and start the download. Java 2 Platform Standard Edition (J2SE) JDK/JRE [choose version] ]5.0 Download JRE After the installation, activate the JRE in your browser. In Microsoft Internet Explorer under Tools Internet Options Advanced. Deactivate the Microsoft Virtual Machine (if it is active) in order to avoid conflicts between the versions. Hint: To avoid unwanted updates of your Java software, you should deactivate automatic updates: Start Settings Control Panel Java Update. Server-side installation Installation of the Java Sun SDK (Software Development Kit) Installation of SAP MII (retrieval of the SCA file) Create or assign the SAP MII users to the corresponding roles in UME Log on to SAP MII Install components and software related to SAP MII

2008

2008 SAP AG. All rights reserved.

17

Unit 1: Introduction to SAP MII

SCM380

Server-Side Installation ProcessPrerequisites The SAP NetWeaver platform (with SAP Web AS Java instance) is already installed and running. Check this by entering this URL http://[Servername]:50000/index.html. Server name is the name of the computer on which SAP NetWeaver is installed. 50000 is the port on which SAP NetWeaver runs by default. Aside from the SAP NetWeaver platform, an SAP Solution Manager with Maintenance Optimizer must be available for downloading the corresponding data from SAP Service Marketplace. You also need the SAP NetWeaver password.

Procedure1. Installation of the Java Sun SDK (Software Development Kit) On the server side, SAP MII requires the following Java Sun version: SDK v1.4.2_13. You can download this version from http://java.sun.com/products/archive/j2se/1.4.2_13/index.html. After the installation, set the JAVA_HOME system variable to the directory in which you have installed the SDK, for example: C:\j2sdk1.4.2_13. Right-click My Computer Properties Advanced Environment Variables System variables to create a new JAVA_Home variable or edit an existing one. Then activate support for JRE (part of the SDK) for your browser and deactivate automatic updates of your Java software as described above, under client-side installation. 2. Installation of SAP MII (retrieval of the SCA file) You can download the platform independent SCA file for the installation of SAP MII from SAP Service Marketplace (http:/service.sap.com) by means of the Maintenance Optimizer of the SAP Solution Manager. Now start the RemoteGui.bat file by changing to the following directory in your Windows Explorer: \\usr\sap\[System ID\Instance Name]\JC00\SDM\program

Continued on next page

18

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

The Software Deployment Manager starts. 3. At the top left, select the Connect to SDM Server symbol and log on with the SAP NetWeaver administrator. Switch to the Deployment tab and select the Add icon at the top left. Open the SCA file, select all components of the file and select Choose. Confirm your selection by choosing Next several times. The installation process starts. Log off from the Software Deployment Manager once the SCA file has been installed successfully. SAP MII is now installed.

Create or assign the SAP MII users to the corresponding roles in UME (User Management Engine) Open the User Management Engine (UME) under the following URL (you need the SAP NetWeaver administrator password to log on to the UME): http://[Servername]:50000/index.html 1. Creating a new user Choose Create User and fill out the following required fields on the General Information tab: Logon ID Last Name Initial password that the user has to change when he logs on to SAP MII for the first time. The password must consist of numbers and letters. Assigning the SAP MII roles

2.

Switch to the Assigned Roles tab and search for XMII *. You will find the following roles: XMII Administrators The MII administrator role has the most authorizations within SAP MII. It can, for example, create new data sources and automatically gets access to these. XMII Developers Compared to the administrator, the SAP MII developer role only has limited authorizations. XMII Users The SAP MII user role has a minimum of authorizations that are required for working with SAP MII. Continued on next page

2008

2008 SAP AG. All rights reserved.

19

Unit 1: Introduction to SAP MII

SCM380

Assign the appropriate role to the user you have just created and save the changes. Hint: You should create a user with the SAP MII administrator role first. If you want the user with the SAP MII administrator role to be able to create new users in UME as well, assign it the Administrator role as well. For more information on user and role administration in SAP NetWeaver see http://help.sap.com/saphelp_nw04s/helpdata/en/b2/4f9b3e1f1e7c7de10000000a114084/content.htm. Creating your own roles for use in SAP MII: In the UME you can also create own roles for use in SAP MII. Please not that you must then assign a user the role you have created and the XMII users role. This role contains all settings required for working with SAP MII. 4. Log on to SAP MII To log on to SAP MII, enter the following URL in your browser: http://[Servername]:50000/XMII/Menu.jsp Note that this is case sensitive.

Figure 9: Logging on to SAP MII

20

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Installation of Components and Software Related to SAP MIIOverview of components JCO libraries JRA connector Installation of JDBC drivers Installation of PDF libraries Installation of SAP MII wizards Installation of SAP MII SPC components Installation of components for SAP MII Metric Alert and Services Installation of XML schemas for BatchML and B2MML

Installation of JCO libraries Required for the SAP ERP connection with the JCO actions in the transactions. Download JCOLIBSxxx.SAR from SAP Service Marketplace Use SAPCAR to unpack the SAP-specific pack program: sapcar -xvf JCOLIBS00_0.SAR Replace unpacked files in the System32 directory (only the older ones) Enter the path to the files in the PATH variable %SystemRoot%\System32\librfc32.dll %SystemRoot%\System32\sapjcorfc.dll Hint: If the SAP ERP GUI is installed on the server after SAP MII is installed, the DLLs must be installed again. To test the JCO connection, you have to set up a connection from SAP MII to the SAP ERP system and use the JCO action. Unit 5 of the course describes this procedure. Setting up the JRA Connector (Java Resource Adapter)

2008

2008 SAP AG. All rights reserved.

21

Unit 1: Introduction to SAP MII

SCM380

Required for the SAP ERP connection with the JRA actions in the transactions. Start DeployTool.bat: \\usr\sap\[System ID\ Instance Name]\...\j2ee\deploying\ Create a new project in the user interface. Give the project a meaningful name, such as JRA_ECC6. Choose OK and go to the Deployer tab. Load the file. \usr\sap\[System ID\ Instance Name]\SYS\global\ra\sapjra.rar by choosing Deploy EAR Load Module. Go to the Properties tab. Enter all the connectivity information for the SAP ERP system. You find this information in the connection properties of your SAP GUI. Port number = system number Server name = router string/application server

22

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Figure 10: Properties of the JRA Connection

Go to the Additional Settings tab. Assign a meaningful JNDI name, such as: ECC6_800. The JNDI name will be visible in the JRA action in the transactions later on.

Go to the Identify Subjects tab. Set the Auth Type to: Caller Impersonation. Don't forget to save your entries now. Connect to the J2EE server by choosing Deploy Connect from the menu. You also need the SAP NetWeaver administrator password. Select the Deploy Module menu item and confirm the suggested name by choosing OK.

To test the JRA connection, you must use the JRA action in a transaction. Unit 5 of the course describes this procedure. Installation of JDBC drivers Required for connecting SQL data sources such as MS SQL Server Oracle MaxDB and so on.

2008

2008 SAP AG. All rights reserved.

23

Unit 1: Introduction to SAP MII

SCM380

JDBC drivers (Java Database Connectivity) have not been part of the SAP MII scope of delivery since version 12.0 but can be downloaded from the respective provider from the internet. Hint: A list of the most popular drivers is available, for example, at: http://www.minq.se/products/dbvis/drivers.html. The downloaded files must then be made available in SAP MII under System Management JDBC Drivers.

Figure 11: Making the JDBC Drivers available in SAP MII

The use of drivers for establishing database connection is part of unit 2 of this course. Installation of PDF libraries The installation of the PDF libraries is required for using the PDF actions in transactions and documentation for transactions

24

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

Installation of PDF libraries. You can download these from the SAP Service Marketplace (PDFActions.jar): http://service.sap.com SAP Support Portal URL change to /notes search notes for: SAP xMII PDF. You also need the iText library: http://www.lowagie.com/iText/download.html Hint: You have to rename itext-xyz.jar to iText.jar. Note that this is case sensitive. The files are retrieved under System Management Custom Actions. Close the SAP MII Workbench first. Upload the two files, whereby assembly file = PDFActions.jar dependency files =iText.jar

Figure 12: Uploading the PDF Libraries

Restart the SAP MII Workbench. You now find the actions for creating PDF documents, if you create new transactions.

You will learn about the actions for creating PDF documents in unit 4 of the course. Installation of SAP MII wizards

2008

2008 SAP AG. All rights reserved.

25

Unit 1: Introduction to SAP MII

SCM380

Install the following components on clients for SAP MII developers to help them with the creation of SAP MII applications. They are not required for pure users of the SAP MII application. Content Generation Wizard (standalone). Supports the SAP MII developer with the creation of HTML code for the SAP MII applets. Scrip Wizard (standalone) Supports the developer with an SAP MII object model for programming interactive pages with JavaScript. Publish Wizard (standalone) For copying web sites (created on the client) on the SAP MII server. This wizard is comparable to an FTP program. Add-in for Dreamweaver and MS FrontPage Enables the use of the above wizards within the Dreamweaver and MS FrontPage development environments. That is, the wizards do not run independently (standalone) but enable access to SAP MII objects within the development environments. After installing the wizards on the client, additional steps are required in the client to integrate the add-ins into the respective development environment. Refer to the SAP MII help for additional information. Hint: In the SAP MII help, search for FrontPage to get additional information. To install the wizards, proceed as follows: 1. Download the wizards from the SAP SDN page: http://www.sdn.sap.com Downloads (Templates, Plug-ins, and Samples) for Manufacturing SAP MII 12.0 Sample Projects and Tools Content Wizards (SAP MII Productivity Wizards) 2. Unpack the zip file, and start file SAPxMIIProductivityWizards.exe. The InstallShield wizard dialog box appears. 3. 4. Accept the default settings and exit the installation. You can then call up the wizards under Start Programs SAP MII Productivity Wizards.

26

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

The SAP MII Migration ToolThe purpose of the migration tool is to copy your existing SAP MII 11.5 projects to SAP MII 12.0. You can download it from SAP Service Marketplace. The migration tool, just like the SAP MII installation file, is an SCA file that must be installed using the Software Deployment Manager as already described above. After the installation, a zip file containing the migration tool is available on the SAP MII server: \\usr\sap\[System ID\ Instance Name]\SYS\global\migration.zip After unpacking on the SAP MII 11.5 server, it is started by executing the Migration.bat file. Please ensure that you start the migration tool from the SAP MII 11.5 server on which you've installed it. The migration tool recognizes your existing SAP MII projects automatically. Before you use it, however, you should make sure that a folder has been created in the relevant directories for each project (note that the project names are case sensitive). The user with which you perform the migration must have read access to these directories: \Inetpub\wwwroot\[project name] \Lighthammer\Illuminator\Templates\[project name] \Lighthammer\Xacute\Transactions\[project name]

The migration tool converts all relative path information of your pages or transactions automatically. That is, you only have to edit absolute information manually. Projects can also be copied individually. As the destination, enter the address of the SAP MII 12.0 server: http://[Servername]:50000 as well as the user name and password of the SAP MII administrator in the migration tool. You can also copy the users and roles as well as existing SAP MII server entries. Hint: Passwords of users that do not meet the UME rules are changed automatically. You can find the generated passwords in the log file of the migration tool. Caution: Even though you can directly export and import SAP MII objects in the SAP MII Workbench version 12.0, you cannot copy objects of version 11.5 this way. Always use the migration tool for this purpose.

2008

2008 SAP AG. All rights reserved.

27

Unit 1: Introduction to SAP MII

SCM380

SAP MII SPC ComponentsTo use the SAP MII SPC components (Statistical Process Control), you have to set up the Quality database on an MS SQL or Oracle database server in order to establish a corresponding connection to an SAP MII data server. The next unit explains how an SAP MII data server is set up. You can download the database scripts and files for the installation of the SPC components in SAP DSN: http://www.sdn.sap.com Downloads (Templates, Plug-ins, and Samples) for Manufacturing SAP xMII 12.0 Sample Projects and Tools SPC (SAP xMII Quality Portal Project). The download contains a help file that describes the installation. Import of SPC components The SPC components (QualityPortal.zip) are imported to SAP MII as an SAP MII project file in the xMII Menu under System Management Projects. Hint: On this note, see also the SAP MII help for System Management Projects. Import of SPC configuration file Aside from the actual SPC components you must also import a configuration file (Config.zip) for the SAP MII data server and authorizations. You import the configuration file in the xMII Menu under System Management Configurations. Hint: On this note, see also the SAP MII help for System Management Configurations. Hint: The SPC in SAP MII topic is part of the advanced MII course.

SAP MII Metric Alert and ServicesThe SAP MII Metric Alert and Services are also a module that must be downloaded and installed according to the procedure described for the SPC components. Metric (Greek measure, count) generally refers to a system of key figures or a procedure for measuring a quantifiable value. The SAP MII Metric Alert and Services provide a module within SAP MII that can be used to enter key figures in categories. Existing SAP MII queries are used for the periodic, that is, time-controlled determination of key figures. When a

28

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Installation

threshold value is reached, you can also generate alarms for key figures, which an SAP MII user either receives by e-mail or which are entered into his personal alarm log. A confirmation of received alarms by the user is also possible. Hint: The subject of SAP MII Metric Alert and Services in SAP MII is part of the advanced SAP MII course.

BatchXMLSAP MII is very well suited to the data exchange with other systems in XML format. Information about the installation of the BatchML schemas for ISA-88 and the B2MML schemas for ISA-95 (Business to Manufacturing Markup Language) is also available on the SAP SDN page: http://www.sdn.sap.com Downloads (Templates, Plug-ins, and Samples) for Manufacturing SAP xMII 12.0 Sample Projects and Tools Specification Sheets (BatchXML ReadMe).

2008

2008 SAP AG. All rights reserved.

29

Unit 1: Introduction to SAP MII

SCM380

Lesson SummaryYou should now be able to: Describe the system architecture and name the system requirements for SAP MII Describe the steps of the SAP MII installation Use UME to create and change roles and users for SAP MII Describe the installation steps of other software that is related to SAP MII Describe how you use the SAP MII migration tool to copy contents from an earlier version into SAP MII Version 12.0

30

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Help and Support

Lesson: SAP MII Help and SupportLesson OverviewThis lesson tells you where you can find help and references for SAP MII.

Lesson ObjectivesAfter completing this lesson, you will be able to: Name the sources of help and support for problems with SAP MII

Business ExampleYou are in the process of developing an SAP MII application when you encounter a problem. As an SAP MII developer you should always try to solve the problem yourself by using the sources introduced here.

SAP MII HelpIf you are logged on to SAP MII and have access to the SAP MII administrator menu, you access the SAP MII help under Support Documentation. Alternatively, you can also click the Help link. In the SAP MII Workbench you can also call up the context help for every object by using the key combination Ctrl+F10. Besides the title of the respective help text, there is an icon with the tool tip text Locate document in navigation tree on the left. You can select this icon to display the structure of the help and view all topics in a navigation tree. The search field that is now available, also enables you to search for specific terms within the help.

2008

2008 SAP AG. All rights reserved.

31

Unit 1: Introduction to SAP MII

SCM380

Figure 13: SAP MII Help on the Internet

Hint: You can also access the help on the internet without logging on to SAP MII by calling up http://help.sap.com/: SAP xApps SAP xApp Manufacturing Integration and Intelligence. General information about SAP MII is available on the SAP homepage at: http://www.sap.com/germany/solutions/xapps/xmii/index.epx.

SAP MII in the SAP Developer Network (SDN)The SAP Software Developer Network is a very rich source of information about SAP MII: http://sdn.sap.com. Logging on to the SDN You must register before you get access to the information in the SDN. You only need a valid e-mail address to do so. The registration in SDN only takes a few minutes. The SAP MII Forum In SDN, there has been a forum dealing exclusively with SAP MII for some time: Forums (in the top menu bar) Emerging Technologies SAP xMII. Aside from SAP MII enthusiasts from all over the world, SAP MII developers from the SAP Labs in Exton, PA, USA answer your questions on a regular basis. SAP MII instructions Aside from the forum, the SDN also contains complete instructions for a range of subjects relating to SAP MII, but first and foremost for the integration of SAP MII with SAP. To find these, simply search the SDN page for the key word xMII. The SAP MII Wiki

32

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Help and Support

SAP MII has its own Wiki within SDN. You can call it up by choosing Wiki xMII in the top menu bar. The SAP MII Wiki provides you with a structured view of the different areas around SAP MII. http://www.sdn.sap.com SAP MII Templates Under Downloads (Templates, Plug-ins, and Samples) for Manufacturing on the SDN page, you can download different templates for transactions dealing with the SAP ERP integration. There, you will also find additional SAP MII sample applications. The samples have been compiled by SAP to give users who already have some SAP MII experience further insight into the product's potential. Samples and templates also provide help: How do I do what in SAP MII?. Hint: There is no official SAP support for samples and templates offered in SDN. If you are having difficulties, however, you can ask for help in the SAP MII forum.

The World Wide WebAs a web-based platform, aside from knowledge about using SAP MII itself, SAP MII requires experience in a range of web technologies: HTML CSS JavaScript XML XSLT X-Path SVG

Furthermore, knowledge about operating databases is an advantage. Aside from specialist literature, the World Wide Web is the best source of information and help for the above-mentioned subject areas. Hint: The following page hosted by the World Wide Web Consortium is a good reference: http://www.w3schools.com .

2008

2008 SAP AG. All rights reserved.

33

Unit 1: Introduction to SAP MII

SCM380

SAP MII SupportIf you encounter an application error in SAP MII or do not find the information you are looking for in the above-mentioned references, you can create a customer message using the SAP Support Portal on SAP Service Marketplace (http://service.sap.com). You find the SAP MII Version and Build number in the xMII Menu under: Support Info. Hint: You find the SAP MII error logs in the administration menu of SAP NetWeaver. http://[Servername]:50000/index.html SAP NetWeaver Administrator Monitoring Logs and Traces.

34

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Help and Support

Exercise 1: Finding Help and Solutions to ProblemsExercise ObjectivesAfter completing this exercise, you will be able to: Name the sources of help and support for problems with MII

Business ExampleYou are in the process of developing an SAP MII application when you encounter a problem. As an SAP MII developer you should always try to solve the problem yourself.

Task:Answer the questions. 1. Name the sources where you can find help on the subject of SAP MII and related subject areas.

2.

The SAP Developer Network (SDN) contains the following on the subject of SAP MIIChoose the correct answer(s).

A B C D E

An SAP MII Forum. An SAP MII Wiki. Instructions and documents on the subject of SAP MII. SAP MII examples for downloading. Finished projects that you only have to download and install.

2008

2008 SAP AG. All rights reserved.

35

Unit 1: Introduction to SAP MII

SCM380

Solution 1: Finding Help and Solutions to ProblemsTask:Answer the questions. 1. Name the sources where you can find help on the subject of SAP MII and related subject areas. Answer: 2. SAP MII Help SAP Developer Network (SDN) World Wide Web SAP Support Portal

The SAP Developer Network (SDN) contains the following on the subject of SAP MII Answer: A, B, C, D

36

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Help and Support

Lesson SummaryYou should now be able to: Name the sources of help and support for problems with SAP MII

2008

2008 SAP AG. All rights reserved.

37

Unit Summary

SCM380

Unit SummaryYou should now be able to: Understand the term SAP MII Name the application areas of SAP MII Name the benefits of SAP MII Describe the integration architecture of SAP MII Describe the range of services of SAP MII Describe the system architecture and name the system requirements for SAP MII Describe the steps of the SAP MII installation Use UME to create and change roles and users for SAP MII Describe the installation steps of other software that is related to SAP MII Describe how you use the SAP MII migration tool to copy contents from an earlier version into SAP MII Version 12.0 Name the sources of help and support for problems with SAP MII

38

2008 SAP AG. All rights reserved.

2008

Unit 2Data and Visualization ServicesUnit OverviewThis section shows you step-by-step how you create an SAP MII application. You learn about handling SAP MII data, visualization and navigation services.

Unit ObjectivesAfter completing this unit, you will be able to: Create an SAP MII application by following the approach introduced here Structure your SAP MII application according to this approach Name the steps required to create an SAM MII application Name the different types of connectors with which SAP MII data servers can be set up Copy, add, edit and delete data servers Describe how you can use the SAP MII UDC framework to connect data sources from your production systems. Name the different query types that SAP MII supports depending on the data source Create query templates for the different types Name the different types of Display Templates Create these Display Templates in SAP MII Describe the tasks and function of the Dynamic Page Generator Create an applet using the Dynamic Page Generator Use the source code created with the Dynamic Page Generator on a web page Use the SAP MII Content Generation Wizard to create web pages Describe how to use the SAP MII Content Generation Wizard as an add-in for MS FrontPage or Dreamweaver Understand the relationship between roles and the security services in SAP MII Call the role-based SAP MII web portal Use the Navigation Editor to include a previously created page in the navigation menu of the web portal

2008

2008 SAP AG. All rights reserved.

39

Unit 2: Data and Visualization Services

SCM380

Use role- and user-specific attributes Describe what data buffering is Display data buffer jobs and data buffer entries

Unit ContentsLesson: Workflow: Creating an SAP MII Application ....................... 41 Lesson: SAP MII Data Server .................................................. 46 Procedure: Adding an SAP MII Data Server............................. 51 Procedure: Installation and Configuration of the UDC Frameworks for OPC ........................................................................... 54 Exercise 2: Creating an SAP MII Data Server........................... 57 Lesson: Query Templates....................................................... 61 Procedure: Creating a Query Template in the SAP MII Workbench .. 62 Exercise 3: Creating Tag Queries in MII.................................. 73 Exercise 4: Additional Query Templates.................................. 77 Lesson: Display Templates ..................................................... 87 Lesson: Dynamic Page Generator ............................................ 98 Exercise 5: Charts with SAP MII .........................................101 Exercise 6: First SAP MII Web Page ....................................105 Exercise 7: Other Display Templates ....................................109 Lesson: Content Generation Wizard .........................................123 Exercise 8: Content Generation Wizard .................................129 Lesson: Navigation .............................................................134 Exercise 9: Using the Navigation Editor .................................139 Lesson: Data Buffering.........................................................146

40

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Workflow: Creating an SAP MII Application

Lesson: Workflow: Creating an SAP MII ApplicationLesson OverviewThis lesson shows you step-by-step how you create an SAP MII application.

Lesson ObjectivesAfter completing this lesson, you will be able to: Create an SAP MII application by following the approach introduced here Structure your SAP MII application according to this approach Name the steps required to create an SAM MII application

Business ExampleYou are supposed to create an SAP MII application. How do you start? How do you continue?

2008

2008 SAP AG. All rights reserved.

41

Unit 2: Data and Visualization Services

SCM380

Type of SAP MII ApplicationIn general, we can distinguish between two types of application: 1. Using SAP MII purely as an interface. This type of use is designed for the time or event-controlled exchange of data between different systems, for example, between a system in production and an SAP ERP system. An interface in SAP MII is basically limited to the connectors used in SAP MII. You can execute queries on data sources on the basis of these connectors. These queries can the be executed in an SAP MII transaction in the way described above. Every SAP MII transaction is available as a web service and external applications can simply call it in an event-controlled manner. If this is not possible, transactions can also be time-controlled. In version 12.0, SAP MII also has a mechanism for buffering data and subsequently processing it according to the FiFo principle (first-in first-out) if communication errors occur during write access to the system. When you are using SAP MII as a pure interface, you should think about which type of event logging is required. Database-supported logging is generally recommended. However, SAP MII also provides the option of logging messages in simple XML files or using the database or the error log of SAP NetWeaver. 2. Using SAP MII with visualization components This type of SAP MII application offers users numerous possibilities. Aside from the simple display of the production status and the visualization of data from production in different diagrams, you can also display information from any other applications, for example, from the ERP system or a laboratory information system (LIMS). Beyond display only, SAP MII enables you to easily implement a workflow between several applications and thus gain a real time and cost advantage through an integrated exchange of information.

Procedure for Creating SAP MII ApplicationsSince the second type of use in the sense of an application development is the somewhat more complex type, the following steps refer to using SAP MII with visualization components. Just like with every other project, you should clearly outline the objectives of the application. Aside from the successful installation of SAP MII, which has already been discussed, the next step is to define the systems that are supposed to be used in SAP MII. The connectors in SAP MII must be set up according to this definition. Appropriate test systems should be available at the start of a project.

42

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Workflow: Creating an SAP MII Application

Depending on the type of application, it is analyzed which TAGs are available in the production system to implement the requirements or which type of standard BAPIs are available in the SAP system and whether these suffice for the implementation. In some rare cases, the SAP standard BAPIs are not the best option for implementation with regard to performance. Hence, you might have to adjust these. Of course, the required systems are defined primarily through the processes to be mapped. They should be defined clearly before the start of the project. You can derive the individual web pages, which must be created using SAP MII, from the processes. It is important to have a general agreement on the look and operation of the pages before the project starts. That is, future users should be included as soon as possible. Aside from the definition of processes, you should also have possible threshold values, key figures and their calculation bases before the start of the project.

Implementing SAP MII ApplicationsSAP MII is modern, web-based toolbox that gives users significant levels of autonomy in the implementation of applications by using open standards. With regard to the development environment, SAP MII offers a comfortable standard that saves developers a significant amount of time. The open web standards include, amongst others: HTML JavaScript CSS XML XSL WSDL If the SAP MII scope of functions does not suffice, you can also develop your own action blocks for SAP MII transactions in Java as required.

2008

2008 SAP AG. All rights reserved.

43

Unit 2: Data and Visualization Services

SCM380

After setting up the connectors to the different systems, you should observe the following procedure: 1. 2. 3. Design the web page using HTML, taking CSS into account where necessary. Integrate the SAP MII applets into the HTML page. The prerequisite for integrating the SAP MII applets into the web is that you create the necessary queries to the underlying systems (SAP MII Query Templates) and define the parameters for the SAP MII visualization objects (SAP MII Display Templates) first. One you have integrated the SAP MII applets into the HTML page, all applets or HTML elements receive a unique ID. This is crucial for using JavaScript for interaction on a web page. You now program the JavaScript functionality on the page in order to design an interactive web page.

4.

5.

At this point, I'd like to mention that you should use the irpt file extension for the SAP MII web pages. The irpt pages (Illuminator Report pages) are ordinary HTML pages that are parsed by the SAP MII framework before they are sent back to the client. Special SAP MII specific expressions are replaced on these pages, for example, expressions that help developers create multilingual web applications. Furthermore, irpt pages also enable the use of Servlet Calls. That is, instead of using Java applets to visualize data, normal HTML graphics or tables can be displayed. In general, we can say that you should always use this option when the user does not interact with the visualized elements. The browser takes significantly less time to load graphics than Java applets. In general, it must also be pointed out that an SAP MII project, like every web project, should be structured clearly with regard to its subdivision into directories. First of all, create a separate subfolder for every page, if possible. The same also applies to style sheets and pictures used, which should be grouped in appropriate folders. For suggestions on the correct structuring of SAP MII projects as well as recommendations for HTML and JavaScript, see the xMII Best Practice Guide, which is available on the SAP Developer Network.

44

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Workflow: Creating an SAP MII Application

Lesson SummaryYou should now be able to: Create an SAP MII application by following the approach introduced here Structure your SAP MII application according to this approach Name the steps required to create an SAM MII application

2008

2008 SAP AG. All rights reserved.

45

Unit 2: Data and Visualization Services

SCM380

Lesson: SAP MII Data ServerLesson OverviewThis lesson explains what is meant by SAP MII connectors and SAP MI data servers, and how you create them.

Lesson ObjectivesAfter completing this lesson, you will be able to: Name the different types of connectors with which SAP MII data servers can be set up Copy, add, edit and delete data servers Describe how you can use the SAP MII UDC framework to connect data sources from your production systems.

Business ExampleTo create a query using a query template, you must first specify a data source that you wish to access. You are prompted to create a data server for a data source in SAP MII.

SAP MII ConnectorsSAP MII supports a large number of connections to numerous data sources. You can integrate not only databases but also numerous systems in the production environment of a company. The systems in production are either connected directly or using the SAP MII Universal Data Connector (UDC). We will deal with the UDC framework in more detail below. The connections to the individual systems are implemented using connectors. Depending on the type of connector, you later select the corresponding type of query template to execute a query against the data source.

Types of ConnectorsThe different connectors are introduced sorted according to the type of query template required for querying the data source. Alarm Enables a connection between SAP MII and the Wonderware AlarmSuite. Tag

46

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

Tag-based connectors always expect a time stamp and a corresponding reading from systems in production. AspenTech InfoPlus (IP21) Wonderware IndustrialSQL Servers (InSQL) Open Connector The SAP MII Open Connector enables you to treat values from an SQL database as tag values. This means that tag-based access to data takes place without the need for writing SQL statements later. Tag (using the SAP MII UDC Framework) CitectSCADA, Historian and so on (Citect) iFIX (GE Fanuc Automation) iHistorian (GE Fanuc Automation) InTouch (Wonderware) OPC (Open Connectivity in industrial automation) OPC HDA (OPC - Historical Data Access) PI (OSIsoft) RSView32 (Rockwell) Hint: OPC is a standard interface to systems in the production area, which is used mainly in process automation. The task of the OPC server is to deliver OPC clients, machine data or values from a wide range of systems: PLC (Programmable Logic Controller) SCADA (acronym for Supervisory Control And Data Acquisition) DCS (Distributed Control System) HMI (Human Machine Interface)

For more information about OPC see: http://www.opcfoundation.org. SQL (JDBC) Enables a connection between SAP MII and a JDBC (Java Database Connectivity) or ODBC (Open Database Connectivity) data source.

2008

2008 SAP AG. All rights reserved.

47

Unit 2: Data and Visualization Services

SCM380

Using JDBC (Java Database Connectivity): MS SQL Server Oracle DB2 MaxDB Other JDBC connectors from third party providers: http://java.sun.com/javase/technologies/database/index.jsp http://developers.sun.com/product/jdbc/drivers Hint: Before you set up a connection using a JDBC connector, you have to make available the respective driver as described in the SAP MII installation lesson. Using ODBC (Open Database Connectivity): MS Access MS Excel and so on. Caution: Many ODBC drivers are prone to memory and resource leaks, crashes and other errors. Since these are not written in Java, they could cause the web server and SAP MII to crash. We recommend you select and test your ODBC drivers carefully before you use them in a web server production environment. SQL (OLE DB) OLE DB (Object Linking and Embedding Database), from Microsoft Data Access Components (MDAC) Version 2.8, using SAP MII OLE DB UDS. Depending on the OLE DB provider, access to: MS SQL Server Oracle MS Access MS Excel and so on.

XML (SAP MII) SAP MII specific connector for reading XML data available in SAP MII XML format. Xacute (SAP MII)

48

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

Xacute - today's transactions in the SAP MII Workbench. This connector is the link between the transactions and their execution and visualization on the web. Hint: The connection of SAP MII to SAP ERP takes place exclusively using corresponding actions in the transactions of the SAP MII Workbench. Unit 5 of this course provides a detailed description of how this works. Note: The Xacute connector has an AutoBind property. This property is to be viewed in connection with the session variables, which you will get to know during this course. Since the AutoBind topic is of no further relevance in this course, I would like to refer to the following article in SDN Autobind and Environment Variables in SAP MII: http://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5266. Aggregate (SAP MII) SAP MII internal connector for summarization of up to 32 SAP MII queries in a single result query. Hint: In the creation history of SAP MII, the aggregate connector existed long before the introduction of transactions and should no longer be used to combine data. Transactions are much better suited to this: http://www.sdn.sap.com/irj/sdn/thread?messageID=3371966#3371966. OLAP OLAP (Online Analytical Processing), for querying multidimensional databases, which support the specification for XML for Analysis (XMLA). The connector supports MDX (Multidimensional Expressions) for querying. MS Analysis Services SAP BW

DataSource (NetWeaver J2EE) This connector is used to access data sources that were configured in SAP NetWeaver J2EE Administrator, for example, JDBC connections. Access in SAP MII then takes place in the DataSource parameter using jdbc/[name of connection in J2EE Administrator] . Hint: For more information about the configuration of data sources in SAP NetWeaver see: http://help.sap.com/saphelp_nw04s/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm

2008

2008 SAP AG. All rights reserved.

49

Unit 2: Data and Visualization Services

SCM380

Simulator (SAP MII) This connector enables access to a tool for simulating tag-based data from production, which is included in SAP MII. The simulator is often used for development and demonstration purposes, for example, if there is no real connection to data sources in production. You can edit the values of the simulator by using Simulator Editor: xMII Menu Data Services Simulator Editor. The SAP MII help describes how the Simulator Editor is operated. Caution: For each query that you execute against it, the simulator returns random numbers. That is, you always get different results. This also happens if you try to execute two queries at the same time. Virtual connectors (SAP MII) On this note please see also Virtual Server in the next section. System connector (SAP MII) This hidden connector provides SAP MII system information only by calling the corresponding URL. It allows system information such as servers, system parameters, users, and roles to be queried, as well as emptying the SAP MII Query cache.

SAP MII Data ServerData server SAP MII has a large number of connectors. For the actual connections to a data source of the connector type there are templates for which you only have to define the parameters. Within SAP MII, templates with parameters are referred to as data servers. Caution: Time synchronization of SAP MII server, SAP MII clients and data server In general, you should make sure that all mentioned systems run as time-synchronized as possible. Virtual servers Virtual servers are used to exchange data between different SAP MII servers without having to define the parameters for the actual data source again on the destination server. Virtual servers are available for every type of connector and even enable you to enter a delta for the time difference between two SAP MII servers. TZOffset, the connector property for balancing time zones only works with applets though.

50

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

Adding an SAP MII Data ServerPrerequisites IDBC data sources. The corresponding drivers were set, for example, for JDBC: SAP MII Administration menu System Management JDBC Drivers For connections using the UDC Framework, its installation and configuration should be completed (see also next section). System information such as server name, IP address, user name, password, and so on are known.

Procedure1. 2. 3. 4. 5. 6. 7. 8. From the xMII Menu, select Data Services Data Servers. The input screen for the data servers appears. Click New. In the New Server dropdown box, select the SAP MII connector or the type of data source that you want to configure. Click OK. Enter a server name. You have to activate the server to use it. Set the Enabled indicator. Now edit the parameter values of the data server. Click Save and confirm the message by choosing OK.

ResultYour database connection has been added to the system as an SAP MII data server. Check connection status You can check the status of your connection by either clicking Status or choosing xMII Menu Data Services Connection Status. Hint: The Connection Status displays only information about Java Database Connectivity Servers (JDBC Servers). Most tag-based servers do not respond to a status check. Displaying the summary The Summary shows an overview of the entered parameter values. Data access Continued on next page

2008

2008 SAP AG. All rights reserved.

51

Unit 2: Data and Visualization Services

SCM380

Only the XMII Administrator role has access to newly created SAP MII data servers. You can assign additional roles to the data server in SAP MII by using the Data Access menu item. Only assigned roles are authorized to access the server. In the xMII Menu under Security Services Data Access you choose the data server from a dropdown list and assign the role using the arrow keys. Then save your settings.

Example1. Setting up an MS SQL Server connection Depending on the JDBC driver you are using, you might have to adjust the following parameters: JDBC Driver Describes the Java package and the class that contains the driver. This value is prefilled with: com.inet.tds.TdsDriver. URL This value specifies the location of your server and is prefilled as follows: jdbc:inetdae:localhost:1433?database=db&sql7=true Instead of localhost enter the name or the IP address of your MS SQL server and a valid Port. If you want to connect, for example, to a database called Production, you have to replace db with the name of this database. Enter user name and password. Then save the connection and check its status. Hint: The value of parameter ValidationQuery is prefilled with the SQL statement SELECT GETDATE(). If you do not connect to an MS SQL server, you must modify or delete this statement. GETDATE() is a function that only works on the MS SQL server. Even if you have correctly entered all other parameter values for another SQL server, you would get an error in the connection status otherwise.

SAP MII UDC FrameworkTo communicate with other systems, SAP MII uses its UDC framework (Universal Data Connector). It consists of a Universal Data Server (UDS) which can communicate with the respective connector UDC via TCP/IP sockets. The SAP MII UDS/UDC framework is based on a COM architecture and can thus also run on a computer other than the actual SAP MII server (system requirements: Windows 2000 Server SP2 or above).

52

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

You can download the UDC and the available connectors (UDC) from SAP Service Marketplace. Architecture of the SAP MII UDC Framework

Figure 14: Architecture of the SAP MII UDC Framework

The SAP MII Framework consists of the following components that enable the extraction of data from other applications: UDS Host works as the host of the UDS instance. SAP MII UDS DLL COM DLL, which connects the specific logic for extracting the data from a third party application. On the computer on which the UDS Framework is installed, the API/SDK of the respective provider must be installed as a minimum. SAP MII UDC AdminConsole Application for configuring the UDS instances. SAP MII UDS Host Acts as the host of the UDS instance. SAP MII UDS DLL Contains the specific logic for extracting the data from a third party application. On the computer on which the UDC Framework is installed, the API/SDK of the respective provider must be installed as a minimum.

2008

2008 SAP AG. All rights reserved.

53

Unit 2: Data and Visualization Services

SCM380

Installation and Configuration of the UDC Frameworks for OPC1. 2. 3. Install the SAP MII UDS/UDC Framework (Admin Console). Install the SAP MII OPC UDC connector Create a new UDS server instance in the Admin Console 4. Open the Admin Console. Click the plus icon Select the type (for example, OPC). Enter a name for the connection (for example, Matrikon).

Configure the new UDS server instance in the Admin Console Select the instance you just created. Enter the OPC Server Name (for example: Matrikon.OPC.Simulation.1). Port 8085 is the standard port on which the UDS instance runs. Start the instance by clicking the arrow button (Start UDS). The light bulb icon is now glowing.

5.

Create a new UDC as the SAP MII data server xMII Menu Data Services Data Servers Choose UDC (Universal Data Connector) as the type. Assign a name. Set the Enabled indicator. Assign an IP. Set the port to 8585. Set a checkmark for Writable if you want to write values back to the OPC server. Save your settings.

Continued on next page

54

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

ResultThe connection to the OPC server is now set up using the SAP MII UDC Framework. Hint: You can find additional information in SDN http://sdn.sap.com, if you search for the following documents: SAP- xMII Universal Data Servers (UDS) Overview and Troubleshooting.pdf Connecting to an OPC server using SAP xMII 11.5.pdf Under http://help.sap.com SAP xApps SAP xApp Manufacturing Integration and Intelligence you find the help for the UDS Framework 4.0.

2008

2008 SAP AG. All rights reserved.

55

Unit 2: Data and Visualization Services

SCM380

56

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

Exercise 2: Creating an SAP MII Data ServerExercise ObjectivesAfter completing this exercise, you will be able to: Create an SAP MII data server for an MS SQL server

Business ExampleTo create a query using a query template, you must first specify a data source that you wish to access. You are prompted to create a data server for a data source in SAP MII.

Task:Create a connection to an MS SQL server database. To do so, use the IDBC template in the server editor. As the name of the SAP MII data server use: SCM380+_your initials Before you start the exercise, please write down the following connectivity information, which your instructor will provide: Database user Database password Server name: Port Database name 1. 2. 3. 4. Create a new server for the connection. Configure and save the connection. Check the status of the connection. Set up the access authorization for the XMII user role.

2008

2008 SAP AG. All rights reserved.

57

Unit 2: Data and Visualization Services

SCM380

Solution 2: Creating an SAP MII Data ServerTask:Create a connection to an MS SQL server database. To do so, use the IDBC template in the server editor. As the name of the SAP MII data server use: SCM380+_your initials Before you start the exercise, please write down the following connectivity information, which your instructor will provide: Database user Database password Server name: Port Database name 1. Create a new server for the connection. a) b) c) d) 2. a) b) c) In the xMII Menu choose: Data Services Data Servers. The input screen for the data servers appears. Choose New. In the New Server dropdown box, select the SAP MII connector: IDBC. Choose OK. Enter a server name: SCM380+_your initials Set the Enabled indicator. Edit the ServerURL. jdbc:inetdae:localhost:1433?database=db&sql7=true Instead of localhost enter the name or the IP address of your MS SQL server and a valid Port. Replace db with the name of the database. d) 3. a) Enter UserName and Password. Save your connection. You can check the status of your connection by either clicking Status or choosing xMII Menu Data Services Connection Status. Check the status of the connection.

Configure and save the connection.

Continued on next page

58

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: SAP MII Data Server

4.

Set up the access authorization for the XMII user role. a) Only the XMII Administrator role has access to newly created SAP MII data servers. You can assign additional roles to the data server in SAP MII by using the Data Access menu item. Only assigned roles are authorized to access the server. In the xMII Menu under Security Services Data Access you choose the data server from a dropdown list and assign the XMII Users role using the arrow buttons. Then save your settings.

2008

2008 SAP AG. All rights reserved.

59

Unit 2: Data and Visualization Services

SCM380

Lesson SummaryYou should now be able to: Name the different types of connectors with which SAP MII data servers can be set up Copy, add, edit and delete data servers Describe how you can use the SAP MII UDC framework to connect data sources from your production systems.

60

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Query Templates

Lesson: Query TemplatesLesson OverviewSAP MII supports different query types, depending on the data source. This lesson shows you how to create an appropriate query template for the different query types.

Lesson ObjectivesAfter completing this lesson, you will be able to: Name the different query types that SAP MII supports depending on the data source Create query templates for the different types

Business ExampleYou are asked to create different query templates for various data sources in SAP MII.

Query (Query Templates) in xMIIQueries in SAP MII are created in the SAP MII Workbench.

2008

2008 SAP AG. All rights reserved.

61

Unit 2: Data and Visualization Services

SCM380

Creating a Query Template in the SAP MII WorkbenchUseQueries on data sources or SAP MII data servers are executed using SAP MII query templates in the SAP MII Workbench.

Procedure1. 2. 3. 4. 5. Open the workbench under Data Services SAP xMII Workbench. On the Catalog tab, select an existing project for which you want to create a query or select a new project, if desired. File New Project. Then choose File New and select the corresponding query depending on the connector type or query type (tag, SQL). Before you can access other tabs, you must configure the Data Source tab. The handling of tabs is explained in the next section. Once you have configured and tested the query template, you can save it by choosing File Save. We deal with the testing and executing of queries below.

Figure 15: Query Templates in the SAP MII Workbench

62

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Query Templates

General Information about Query TemplatesThis section deals with the SAP MII query template tabs that all connector types have in common. Special tabs for each connector are explained subsequently. You will learn about the different modes of queries during the course and in the exercises. Common tabs of an SAP MII query template: Data Sources General Date Range Parameters Transformation Security

Data Sources Tab1. 2. Select the data source. Select the mode. It is only now that the remaining tabs are released for input. The release of a tab can also depend on the selected mode. Mode/method: The available modes depend on the type of query selected. Whether the mode is supported depends on whether the chosen connector supports the corresponding function/mode. For example: TagQuery. Writing values back to the OPC server. Mode: CurrentWrite. If the connector does not support write back, this mode can be selected but executing the query has no effect. Some modes can be combined with methods, if they are supported by the connector, for example: tag query, mode: Statistics, method: AVG (Average) shows the average of all values of the query for each selected day.

General TabNumber of rows (Row Count): Number of rows that are returned by the query. Caution: Even if you expect 100 data records as the result of your query, this query will only ever return the number, for example, 50 that is entered under Row Count. To prevent this from happening, you can enter a very

2008

2008 SAP AG. All rights reserved.

63

Unit 2: Data and Visualization Services

SCM380

large number. It is, however, better to determine the number of rows dynamically during the runtime of an SAP MII application and to set it by means of JavaScript before you execute the query. Number Format: Format of numbers that are returned by the query. Using Query Caching: When activated: duration the query result is held on the SAP MII server. Enables faster access time when another query is executed with the same parameters. If the query parameters change, the result with the new parameters is entered into temporary storage. Caching does not take place as soon as date ranges are used in the query. Allow Buffering: If the indicator is set, data that is supposed to be written to other systems is buffered in SAP MII, if these systems cannot be reached. We will deal with the options of this function later on.

Date Range Tab

Figure 16: Configuring Date Ranges for SAP MII Queries

SAP MII has different options for executing date-based queries. You can specify a date format, which is displayed when the data is returned, for each query.

64

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Query Templates

The possible date parameters can be divided into the following groups, which cannot be used in combination with each other. 1. 2. 3. 4. Schedule Time Period Time Start Date and End Date

Schedule: You can group several periods under a schedule (xMII Menu Data Services Time Period Schedules). Time Period: SAP MII contains predefined time periods that you cannot change, for example CurrentMonth. You can use these periods in your query in SAP MII. You can also define your own periods in the xMII Menu under Data Services Time Periods. When you are using time periods, the Duration is ignored. Time: In this field, you can use the following expressions to navigate to a certain starting point: yesterday@14:00:00, today@13:00:00 as well as all days of the week: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday. The time is always transferred in 24 hour format. Start Date and End Date: Is only used if the query can establish a time reference to the data to be queried. In case of an SQL query this is not achieved, for example, if the [SD] or [ED] parameters reserved for this purpose are used in a "fixed" query, or the date column is used for a query in "Query" mode. For tag or alarm queries, the date filter is automatically applied to the time column (DateTime). Duration: Affects tag-based queries in History mode. If no date parameters are specified, the query goes from the current point in time into the past, using the Duration and the Row Count (General tab). Allow Future Dates: Dates for periods in the future are not simply truncated. Interval Count: Divides the total time of the query into even intervals. Example:

2008

2008 SAP AG. All rights reserved.

65

Unit 2: Data and Visualization Services

SCM380

If a query returns data in a period of 24 hours and the IntervalCount = 12, then 12 value pairs are output based on a 2 hour time interval. Not every connector supports this property.

Parameters TabSAP MII enables the use of parameters on queries. A web page can then dynamically transfer these parameters to the query. You will find out how this works in a later unit of this course. You can test the parameters you've set on the Parameters tab whilst you are developing your query. Example: Select * From Customers Where CustomerID = 'K-4711' Can be replaced with the following in xMII: Select * From Customers Where CustomerID = '[Param.1]' The example value "K-4711" can be set for this parameter on the Parameters tab. For numeric values, the quotes around the parameter expression are not used: [Param.1] .

Transformation TabOn the Transformation tab, SAP MII queries can be transformed using an XSLT (XSL Transformations, XSL = Extensible Stylesheet Language). All query results in SAP MII are available as an XML structure in SAP MII XML format. We will deal with this SAP MII XML format in more detail below. Purpose: Data from databases can be "manipulated" relatively easily with an appropriate SQL statement, for example, it very easy to add additional columns for a calculation. SQL cannot be used for tag-based queries. Every SAP MII query is always returned as an XML structure by the SAP MII server. This XML file always looks the same. Every XML file can be manipulated with an XSL stylesheet. XSL (eXtensible Stylesheet Language) are stylesheets for XML files and their purpose can be compared to CSS stylesheets for HTML files. So SAP MII has options to manipulate each of its queries (including SQL queries) subsequently by means of a stylesheet. This manipulation is also referred to as Inline Transform. SAP MII provides some predefined stylesheets, which are

66

2008 SAP AG. All rights reserved.

2008

SCM380

Lesson: Query Templates

available in version 12.0 on the web under Samples/WEB/Stylesheets/. Since this course does not cover the Inline Transform in more detail, please read the note on information in the SAP MII help. Note: Manipulations to XML structures can also be performed by means of an SAP MII transaction. That is, you do not have to learn about XSLT, you can also achieve the same result by using a corresponding transaction, as you will see in this course. Hint: An example of how you can write an XSL yo