Top Banner
Batch Manufacturing with SAP MII SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany Technical Guide Version 1.1 February 2010
46

Batch Manufacturing with SAP MII

May 18, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Batch Manufacturing with SAP MII

Batch Manufacturing withSAP MII

SAP AGDietmar-Hopp-Allee 1669190 WalldorfGermany

Technical Guide

Version 1.1

February 2010

Page 2: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 2 of 46

Table of Contents

1 Batch Manufacturing with SAP MII – Overview ........................................................................ 42 System & Template Installation ............................................................................................... 6

2.1 Set Up of the Technical Infrastructure............................................................................... 62.1.1 General Set Up ......................................................................................................... 62.1.2 Settings in SAP ERP ................................................................................................. 7

2.1.2.1 Create a RFC connection to SAP MII ................................................................. 72.1.2.2 Create an SAP ERP User for the Connection to SAP MII .................................... 72.1.2.3 Change Function Modules .................................................................................. 7

2.1.3 Import of the MS SQL Data Base for BM4MII ............................................................ 72.1.4 Import of Templates & Settings in SAP MII ................................................................ 8

2.1.4.1 Creation of Roles in SAP UME ........................................................................... 82.1.4.2 Assignment of Roles and Creation of users (optional) ......................................... 82.1.4.3 Import of templates & configuration .................................................................... 92.1.4.4 Update of the database connection .................................................................... 92.1.4.5 Modification of the JCo Connector .................................................................... 102.1.4.6 Message Listener Setup ................................................................................... 102.1.4.7 Check the custom attributes ............................................................................. 112.1.4.8 Check the scheduled jobs ................................................................................ 132.1.4.9 JDBC Drivers ................................................................................................... 132.1.4.10 Credential Editor .............................................................................................. 132.1.4.11 Localization ...................................................................................................... 13

3 MII Template Activation & Description ................................................................................... 153.1 Project Contents ............................................................................................................ 153.2 Manufacturing Cockpit.................................................................................................... 16

3.2.1 Additional Steps for Installation ............................................................................... 163.2.2 Important Transactions ............................................................................................ 163.2.3 Important Javascript Functions ................................................................................ 16

3.3 Material Identification ..................................................................................................... 173.3.1 Additional steps for Installation ................................................................................ 173.3.2 Database ................................................................................................................ 18

3.4 Work Instructions ........................................................................................................... 193.4.1 Additional steps for Installation ................................................................................ 193.4.2 Important Transactions ............................................................................................ 203.4.3 Database ................................................................................................................ 213.4.4 Important Stored Procedures................................................................................... 223.4.5 Important JavaScript Functionalities ........................................................................ 223.4.6 Process Instruction Categories and Process Messages ........................................... 243.4.7 Miscellaneous ......................................................................................................... 31

3.4.7.1 Process message monitor ................................................................................ 313.4.7.2 Changing or Adding Icons ................................................................................ 31

3.5 Quality Control ............................................................................................................... 323.5.1 Additional steps for Installation ................................................................................ 323.5.2 Important Transactions ............................................................................................ 323.5.3 Important XSL Style Sheets .................................................................................... 33

Page 3: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 3 of 46

3.5.4 Important JavaScript Functionalities ........................................................................ 333.6 Production Confirmation ................................................................................................. 34

3.6.1 Additional steps for Installation ................................................................................ 343.6.2 Important Transactions ............................................................................................ 343.6.3 Database ................................................................................................................ 343.6.4 Important JavaScript Functionalities ........................................................................ 35

3.7 Shift book – configuration & description .......................................................................... 363.7.1 Additional steps for Installation ................................................................................ 36

3.7.1.1 Creation of System Status ................................................................................ 363.7.1.2 Assignment of Custom Attributes ...................................................................... 36

3.7.2 Important Transactions ............................................................................................ 373.7.3 Database ................................................................................................................ 383.7.4 Important JavaScript Functionalities ........................................................................ 39

3.8 Log Monitor .................................................................................................................... 403.8.1 Additional Steps for Installation ............................................................................... 403.8.2 Important Transactions ............................................................................................ 403.8.3 Important Javascript Functions ................................................................................ 40

3.9 Manufacturing Performance ........................................................................................... 413.9.1 Definition of KPIs .................................................................................................... 41

3.9.1.1 Plant on Time Delivery ..................................................................................... 413.9.1.2 Production Plan Adherence .............................................................................. 413.9.1.3 Capacity Utilization ........................................................................................... 42

3.9.2 Performance ........................................................................................................... 443.9.2.1 Additional Steps for Installation......................................................................... 443.9.2.2 Important Transactions: .................................................................................... 443.9.2.3 Important JavaScript ........................................................................................ 44

3.9.3 Production report .................................................................................................... 453.9.3.1 Additional steps for Installation ......................................................................... 453.9.3.2 Important Transactions ..................................................................................... 453.9.3.3 Database ......................................................................................................... 45

4 References ........................................................................................................................... 46

Page 4: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 4 of 46

1 Batch Manufacturing with SAP MII – Overview

SAP is delivering preconfigured, best practice templates for the solution SAP ManufacturingIntegration and Intelligence (http://www.sap.com/solutions/manufacturing/manufacturing-intelligence-software/index.epx). Batch Manufacturing with SAP MII is the result of a successfulco-innovation project, leveraging the experience of SAP and partner experts for SAP MII, as wellas customer and industry input. Trebing + Himstedt, Ciber, as well as Systec and Services -experienced implementation partners with proven templates for SAP MII - joined together withSAP to develop and deliver a set of pre-built, harmonized templates to support manufacturingexecution and performance reporting in batch manufacturing industries.

The new batch manufacturing with SAP MII templates meet customer needs for an integrated,plant-specific solution for manufacturing operations. They provide plants with a lean, “smart”approach to support core manufacturing execution processes.

Leveraging the SAP MII development infrastructure and pre-built, standards-compliantintegration to SAP ERP and shop floor systems, the batch manufacturing with SAP MII templatesintegrate and synchronize manufacturing enterprise, operations and device data. In this way,plants and the enterprise benefit from accurate, real-time visibility into manufacturing activitiesand performance to increase plant operational efficiency and reduce costs.

Furthermore, straight-forward, role-specific applications support efficient manufacturingpreparation, execution, documentation and reporting. Batch manufacturing with SAP MII willdeliver preconfigured templates for 9 application areas - role-specific manufacturing operationscockpits, manufacturing order list, material identification, work instructions, quality control,production confirmation, shift book (for shift set-up, management and reporting), monitoring andlogging, as well as manufacturing performance (KPIs and production reports).

Batch Manufacturing with SAP MII – Scope

Page 5: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 5 of 46

Delivering simplified user interfaces, preconfigured business processes and content, as well asfull installation and user documentation, the batch manufacturing with SAP MII templates aredesigned to reduce implementation cost, effort and risk. Furthermore, the “smart approach” ofbatch manufacturing with SAP MII delivers customers a lean solution for core manufacturingexecution processes – with central, single data maintenance and seamless integration with ERPand shop floor systems. Companies can thus leverage existing investments, avoid dataduplication and profit from lower total cost of ownership and time-to-value.

To ensure SAP customers and partners to leverage these templates two documents areprovided:

A technical guide that supports the implementation. It describes technical aspectsneeded to set-up an MII server and implement the templatesApplication guide covers the documentation of all functions and features of the templatesas well as a user guide

For changes to the templates we recommend to contact your local SAP representative, one ofour SAP MII partners mentioned above or to cover your in-house expertise.

In this document you will find information for installing the SAP Manufacturing Integration andIntelligence (MII) Templates for Batch Manufacturing. This document also provides an overviewof these templates and their interaction with common manufacturing focused SAP ERP CentralComponent (ECC) modules.

Page 6: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 6 of 46

2 System & Template Installation

2.1 Set Up of the Technical Infrastructure

2.1.1 General Set UpThe Batch Manufacturing with SAP MII templates have been developed and tested with thefollowing components:

- SAP MII 12.1. SP4- SAP Netweaver Composition Environment 7.1 EhP1 SP3- Microsoft SQL Database 2005- Java is required on client machines. The templates have been tested with Java 1.6.0_7

and Java 1.6.0_12 on client machines- SAP ERP 2005 EhP3 (ECC 603).

For older releases, changes of the templates may be necessary due to differentavailability of used BAPIs or function modules. The table below shows the SAP ERPrelease dependence for the individual batch manufacturing with SAP MII templates.

SAP ERP Release

Templates R/3 4.6C R/3Enterprise4.70

ECC 500 ECC 600 ECC 602 ECC 603+

Manufaturing Operations Cockpit

Production Supervisor XShift Supervisor XOperator X X X X X XManfacturing Order List X X X X X XMaterial Identification X X X X X XWork Instructions X X X X X XQuality Control X X X X X XProduction Confirmation X X X XShift Book X X X X X XMonitoring and Logging X X X X X XManufacturing Performance

Key Performance Indicators XManufacturing Performanc X X X X

"X" indicates that the template is working on the respective release.

For the standard installation of SAP MII and SAP Netweaver Composition Environment seehttps://websmp106.sap-ag.de/~form/sapnet?_SCENARIO=01100035870000000202&_SHORTKEY=01100035870000714218

For the installation of the MS SQL Database see the installation guide from Microsoft.

Page 7: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 7 of 46

2.1.2 Settings in SAP ERPThe following settings are made to connect SAP ERP with SAP MII. These settings are used bythe delivered templates. You might change the user names, passwords and authorizations aftersuccessful installation in both systems.

If you are using Best Practices for Chemicals you can create your own user by logging in withthe user “DEMO”, password “best123” and copying that one to a new account.

2.1.2.1 Create a RFC connection to SAP MII1. Go to transaction “Maintain RFC Connections” via the Tools ALE ALE

Administration Runtime Settings or use transaction code SM59.2. Choose “Create”.3. Add a name, e.g. MII_BM.4. Chose connection type T (TCP/IP connections).5. Add a description.6. On the tab “technical writings” check “Registered Server Program”.7. Enter the program ID MII_BM.8. Check “Unicode”.9. Enter the gateway host, i.e. the server address and the gateway service you got from

your system administrator.10. Save your settings.

For more details see the SAP MII wiki http://wiki.sdn.sap.com/wiki/display/xMII/Connectivity

2.1.2.2 Create an SAP ERP User for the Connection to SAP MII1. Go to transaction SU01.2. The user ID should be MII_BM3.3. Choose create.4. On the tab Address: type MII_BM3 for the Last Name.5. On the Tab Logon data: type in the initial password and repeat it.6. Set the user group to “Super”.7. On the tab Profile: assign the profile “SAP_ALL”.8. Save your settings.9. Log out and log in with the user MII_BM3 and choose sap_1972 as password.

2.1.2.3 Change Function Modules

1. Go to transaction SE372. Search for function module CR_HIERARCHY_FATHER_AND_SONS and open it in

change mode3. Choose tab attributes.4. Check “Remote Enabled Module” in the processing type section.5. Save your settings.6. Repeat steps 2- 5 for the function moldule CR_CAPACITY_AVAILABLE_TIMES.

2.1.3 Import of the MS SQL Data Base for BM4MIIBatch manufacturing for SAP MII is delivered with a database file SAP_BM.mdf and the log fileSAP_BM_log.ldf to facilitate the installation. With the installation of the database all tables andstored procedures are created that are used by the templates.

Page 8: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 8 of 46

1. Store the file SAP_BM.mdf and SAP_BM_log.ldf under the folder MS SQL data file, e.g.C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

2. Open the SQL Server Management Studio.3. Select the folder “Databases”, right mouse click Attach4. Choose “Add” and browse to SAP_BM.mdf, mark the file and press ok

The database should be shown in the tree now.5. Create a new database user

a. Go to security loginsb. Create a new login with the context and make the following entries

Generalo Login Name, e.g. MIIAdmino Check SQL Server authenticationo Enter passwordo Check “Enforce password policyo Default database: SAP_BMo Default Language: English

Server Roles, checko publico securityadmino serveradmin

User Mapping: mark the database SAP_BM and checko db_ownero public

Statuso Grant permission to connect to database engineo Enable login.

c. The delivered user is MIIAdmin, password: miiadmin; please delete it.

2.1.4 Import of Templates & Settings in SAP MIITo run the templates the following general settings have to be made. Additional steps for eachapplication are described in the respective chapter.

2.1.4.1 Creation of Roles in SAP UMEThe SAP MII templates are making use of 3 roles to tailor the user interface for the user:

BM_Operator BM_ShiftSupervisor BM_ProductionSupervisor

These roles have to be created before the project and configurations are imported. This can bedone by logging into the Netweaver Administration page Configuration ManagementIdentity Management. Select “Role” under search criteria and create the mentioned roles.If you want to create other roles, you have to modify the navigation file in the config XML andreplace it with your roles.

2.1.4.2 Assignment of Roles and Creation of users (optional)The roles, created in the previous step have to be assigned to users. You can optionally createnew users or assign the roles to existing users that will work with the templates. The users areimported and can be changed.

1. Log on to SAP MII.2. Choose “User Admin”

Page 9: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 9 of 46

3. Choose “Create user” and create the following users on the tabs “General” and “AssignedRoles”. BM_Operator

Name: Jim OperatorAssigned Roles: BM_Operator, SAP_XMII_USER

BM_ProductionSuperName: Jack ProductionAssigned Roles: BM_ProductionSupervisor, SAP_XMII_USER

BM_ShiftSuperName: Bill ShiftAssigned Roles: BM_Shiftsupervisor, SAP_XMII_USER

4. Create an initial password, save your settings.5. We recommend using a general password for all three users after initial log on to facilitate

demonstrations of the solution.

Create an additional user with more rights for your power user.

2.1.4.3 Import of templates & configurationThe following ZIP files are needed: Configurations.zip and Project.zip

1. Save the files Project.zip and the Configurations.zip onto your computer2. Import the configuration by importing the Configurations.zip - this can be performed on

the main menu under System Management - Configurations. The following settings willbe delivered with the configuration file.

These check boxed values are the only ones needed during import.3. Using the Projects screen under the System Management menu, import the Project.zip

file as a new project in SAP MII.

2.1.4.4 Update of the database connectionLog onto SAP MII, go to MII Data Services Data ServersRemark: Make sure that the JDBC driver is deployed first.

1. Choose “SAP_BM”, Menu Modify the following:

Page 10: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 10 of 46

Server URL, note the SQL DB name is “SAP_BM” for examplejdbc:sqlserver://<server>:1433;databaseName=SAP_BM

Check this path with your system administrator. User: Your DB user Password: DB user password.

2. Save your settings

2.1.4.5 Modification of the JCo ConnectorLog onto SAP MII, go to MII Data Services System Connection Editor

1. Choose connection type JCo from the drop down menu.2. Choose “ERPBatchManufacturing” and change the following settings:

Server: Server address from SAP ERP Client: SAP Client to that MII should be connected, e.g. 100 System: SAP ERP system number, e.g. 00 Leave SSO unchecked Language: English.

3. Save your settings.

2.1.4.6 Message Listener SetupTo receive the control recipes from SAP ERP the message listener has to be set up.

1. Log on to Netweaver and go to NW Admin Configuration Management InfrastructureApplication Resources

2. Select a message listner that is not yet used , e.g. XMIIRFC01 and make the followingentries on the tab “properties” ProgramID: MII_BM MaxReaderThreadCount: 1 SAP client: Client MII should be connected to, e.g. 100 Username and password as described in 2.1.2.2, MII_BM3, password: sap_1972 ServerName: address of the gateway server Portnumber: system number, e.g. 00

Page 11: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 11 of 46

3. In case the message listner is not available or you changed the password on an establishedlistener go to the NW Admin menu Operation Management Systems Start & Stop Go to tab Java EE, Applications Select tc~sapjra~temp Stop the application Wait until all instances are really stopped (refresh the sreen) Start the application again Select xapps~xmii~ear on the same screen. Check if it is up and running, if not start the application. Check the message listner as described in point 3 if is up and running.

4. Check the imported processing rule Go to Message Services Processing Rule Editor Selcect CONTROL_RECIPE_DOWNLOAD Description: Control Recipes Server Name: Choose a message listener from the drop down list, e.g. XMIIRFC01 Message Type: Check RFC Processing Type: Category Category: “CONTROL_RECIPES”.

Remark: the import of the configuration will set the server by default to XMIIRFC01 bydefault in the processing rule. You should change the setting if it is interfering with yourexisting set up.

2.1.4.7 Check the custom attributesCustom attributes are used to set the frequently used selection criteria (e.g. Material, Plant) andto assign authorizations to specific roles or users. The following custom attributes are deliveredwithin the configuration file. Please check if they fit your requirements.

1. Log on to SAP MII2. Choose MII Menu3. Choose System Management4. Choose Custom Attributes

Field BM_DateFormat BM_DateTimeFormat BM_Factory BM_LanguageList

Description -- -- ESB idFactory Language List for the DB table

Required Checked Checked Unchecked Checked

Type Text Text Text Text

Field Size 12 20 2 20

Validation None None Alphanumeric Alphanumeric

Values -- -- -- --

Default Value MM/dd/yy MM/dd/yyyy HH:mm:ss -- en

Field BM_MaterialNumber BM_MaterialNumber_To BM_PlantNumber BM_ProductionScheduler

Description Material Number Material Number (upperlimit) Plant Number --

Required Unchecked Unchecked Unchecked Unchecked

Type Text Text Text Text

Field Size 18 18 20 3

Validation None None Alphanumeric None

Values -- -- -- --

Default Value -- -- -- --

Page 12: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 12 of 46

Field BM_SUBSYSID BM_WI_Discard BM_WI_Edit BM_WI_Unlock

Description SubSystem ID - usedto filter QM operations

Authorization to discardWork Instructions

Authorization forchanging WorkInstructions

Authorization to unlock WorkInstructions

Required Checked Checked Checked Checked

Type Text Radio button Radio button Radio button

Field Size 10 -- -- --

Validation Alphanumeric None None None

Values -- Yes|No* Yes|No* Yes|No*

Default Value MII-BM No No No*Case sensitive

5. Save your settings6. Choose Custom Attribute Mapping from the MII Menu System Management7. Assign the custom attribute to a specific role or user. The following assignments have been

made to the delivered roles:

Custom Attribute BM_Operator BM_ProductionSupervisor BM_Shiftsupervisor

BM_WI_Edit Yes Yes Yes

BM_WI_Unlock - Yes Yes

BM_WI_Discard - Yes Yes

BM_PlantNumber 1000 1000 1000

BM_MaterialNumber CH-3200 CH-3200 CH-3200

BM_SUBSYSID MII_BM MII_BM MII_BM

BM_ProductionScheduler YQ2 YQ2 YQ2

BM_MaterialNumber_To CH-3200 CH-3200 CH-3200

The custom attributes are used in these roles to set default values for selection criteria (e.g. theplant number “1000”) and assign distinct authorizations. The operator is only able to edit thework instructions whereas the supervisor roles are able to unlock and discard the workinstructions.The custom attributes described before have been included in many of the application templates.But not every attribute has been used everywhere. If you want to extend the usage or if youcreate new custom attributes change the IRPT file which includes the selection.Example:

<!--- === plant from ==============================================--><tr>

<td> {##Plant} </td><td>

<input type="text" class="txtField" name="txtPlantFr"id="1"

maxlength="10" size="10" value="{BM_PlantNumber}"></td><td> {##To} </td><td>

<input type="text" class="txtField" name="txtPlantTo"id="2"

maxlength="10" size="10"></td>

</tr>Example: Selection of plant (from / to)

Page 13: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 13 of 46

In red you see the coding section for assigning a custom attribute value to the input element:.

[…] value=”(BM_PlantNumber)”.

If you want to have also a default value for the selection ‘Plant To’, please create a customattribute (e.g. BM_PlantNumber_To),s assign values to roles or users and add the valueassignment inside the input element.

2.1.4.8 Check the scheduled jobsThe following jobs should be imported with the configuration file

SendProcessMessagesToERP SendQMmessagesBackToERP LoggingRetention CreateKPIs parseControlRecipies LoadConfirmationTable

Go to the MII Menu System Management Scheduler and select each job and

Check the box “Enabled” Change the user to an admistrator one In the job “parseControlRecipies” enter the message listener you have entered in

2.1.4.6 for the parameter “RFCServerName”, e.g. XMIIRFC01.

Change or define a new pattern for scheduling by clicking on and save in the pop up Menu.Save your settings again in the main Menu to execute the scheduling. The imported scheduleshave been setup to support scenarios best. Please do not setup schedules to run below the 2minute mark as this will slow down performance of your system.

2.1.4.9 JDBC DriversImport the correct JDBC driver for your SQL Database. You can find the correct driver atMicrosoft’s website. The file can be imported at System Management -> JDBC Drivers

2.1.4.10 Credential EditorCreate a password for the Credential – ERPBatchManufacturing located at Security Services ->Credential Editor. This password will be used in conjunction with the ERPBatchManufacturingJCO connection so the user must have access to that ERP system.

2.1.4.11 LocalizationThe SAP MII templates are delivered and tested in English. The default language is set toEnglish with a custom attribute. If you want to localize the solution to another language you haveto translate the current entries.

Remark: A German localization file is delivered for your convenience but not completelytranslated and tested.

Page 14: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 14 of 46

2.1.4.11.1 General Localization

1. Log onto SAP MII2. Choose MII Menu Data services SAP MII Workbench3. Go to tab Meta-Inf4. Expand SAP_BM META-INF Bundles5. In the file SAP_BM_en.properties you find the current language dependent elements and

their description in Enlish.6. Right mouse click on Bundles and choose “Create New Resource”7. Select the appropriate language.8. You can copy the entries from SAP_BM_en.properties, paste them in the new resource and

replace the English expressions.9. Assign the language in the appropriate users in the user administration (see chapter 2.1.4.7)

on the drop down menu in the tab “General Information”.

2.1.4.11.2 Localization of the Shift Book application

The shift book also enables the language dependency for instructions and needs a differentmechanism for localization in addition to the above described settings.

1. For each new language in the following tables: dbo.InfoState_lang dbo.InfoType_lang dbo.ShiftDefinition_lang

Add the following two colummns: shortDescrXX & longDescrXX where XX should bereplaced by the respective language abbriviation.

2. Change the custom attribute “BM_Language_List” to en_XX or en_de_XX or any othercombination you need for your system.

3. Go to the application and choose “Shift Supervision”.4. Enter the appropriate entries in the master data section of the shift book.

Page 15: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 15 of 46

3 MII Template Activation & Description

3.1 Project Contents

All templates are imported into one MII project but can be used independently if desired. Theinterdependencies -where existing- are described in the detailed sections below.

The structure in the MII workbench is divided into the different templates and is implicitly thesame in the catalog and the WEB tab. Whereas in the catalog all transactions, queries, SQLstatements, screen elements like igrids and ibrowsers could be found, the WEB folders arehosting the entry points for the applications (IRPT’s), CSS files, specific pictures and java scripts.In this chapter the folder should be described briefly and the important functions should behighlighted. Due to the different scope of the templates the content and extend of thedescriptions vary.

Structure of the Common Folder in the MII workbenchThe common folder contains templates for iGrids, Queries and Charts that are used by theapplications. In addition examples for screen elements (calendar, browser, dropdown list) can befound here as well as to sample transactions to write log files (OutputXMLSaver,RequestResponseSaver). All other folders contain in addition data base interactions (dbqueries).

In the WEB section the templates for the user interface are found here, that are used by thedifferent applications. The style sheet, pictures for calendar, navigation symbols and otherscreen elements, templates for certain screen elements like content sections or actions like theGetDate.irpt.

A folder “Themes” and the subfolder “SAP1” can be found in the web area of the common folder.It includes all files needed for the Netweaver Business Client look and feel. The style is called“DynamicHomePage.xsl”. This theme has been assigned to the standard role SAP_XMII_User inthe navigation setup (MII menu Navigation Services Navigation).

Page 16: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 16 of 46

3.2 Manufacturing Cockpit

3.2.1 Additional Steps for InstallationGo to the Scheduler in the SAP MII system management and review the parameters beingpassed in by the CreateKPIs schedule. Modify according to your use case.

3.2.2 Important Transactions1. SAP_BM/Cockpit/KPI/CreateSVGDetermination

This transaction passes all information to the relevant KPI subtransactions in order for thevalue to be calculated. It is called from the CreateKPIs schedule. It creates the SVGimages located on the cockpit pages which are used in the Cockpit/<Role>/<Role>KPIs.irpt.It is currently scheduled to run every 10 minutes.

2. SAP_BM/KPI/Common/UI/KPISVGCreationThis transaction determines how to create the SVG Image. If it is Dynamic it will pass theEncodedImageOutput back to the webpage for rendering. If it is scheduled it will create aimage and store it in the following location “web://SAP_BM/KPI/Images/Scheduled/”.

3.2.3 Important Javascript Functions1. Time_CreationEvent

This will put the current date and time at the top right hand corner of the screen for allcockpit pages.

2. KPI PassThroughProduction and Shift Supervisor only. Passes the current parameters used to create the KPIon the cockpit page to the corresponding KPI webpage for more details.

Page 17: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 17 of 46

3.3 Material IdentificationThe Material Identification module consists of 2 separate interfaces, one meant to be accessedfrom the shift supervisor on a workstation, as a means for triggering a material identification fororders (Initiate Material Identification) and the other one for performing the actual identificationmeant for access via a handheld device (Material Identification). Apart from the dedicated orderlist material identification can also be triggered from the shift supervisor’s work instructionscockpit.

3.3.1 Additional steps for Installation1. Barcode formatA regular expression for matching the barcodes to scan has to be provided. This can beconfigured in the following file

SAP_BM/WEB/MaterialIdentification/IdentifyMaterial/IdentifyMaterial.irpt

There are 2 separate regular expressions that can be configured.

a. reBarcodehas to provide 1 mandatory subpattern for the material number and can alsoprovide 2 additional subpatterns for the batch and the order numberrespectively. The order of the subpatterns is fixed, so that the material number isalways the first subpattern, while the order number is the third

b. reBarcodeOrderwhich only contains just one subpattern for the order number and is meant tofunction as a mere plausibility check.

2. Date/time localizationLocalization of timestamps is being done by utilizing the date/time formatting of MicrosoftSQL Server. These require certain numerical values (style codes) to receive the desireddate/time formatting. “101” for instance would result in a timestamp formatted as“MM/DD/YYYY”. See the Microsoft SQL Server documentation for a full list of style codes.For every supported language a style code for a fitting date/time format should be set in theSQLServerCountryCode token in the localization properties.

3. Sound configurationYou can configure which sounds to play for successful and failed scan attempts in followingfile:

SAP_BM/WEB/MaterialIdentification/IdentifyMaterial/IdentifyMaterial.irpt

The init function in the soundController module provides the urls for the sound files to utilize.On certain systems, namely Pocket IE on Windows Mobile the playing of sound files servedby the Netweaver HTTP server might be impossible. In those cases the utilization of soundfiles present on the local file system of the client appliance is an option. In the standardrelease if the user agent is a browser of the Microsoft IE Mobile family, sound files which areassumed to exist on all Windows Mobile devices are used, while for all other browsers thebundled sound files are utilized.

4. Setting up a barcode scannerThe only requirement is a suffix consisting of a single carriage return character (ASCII code0x13).

Page 18: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 18 of 46

3.3.2 DatabaseThe following tables are created. They rely on the presence of the “ORDER” tables of the WImodule.

Table name Descriptiondbo.BOMS Contains the order specific material listsdbo.MaterialIdentification Contains the initialized identificationsdbo.IdentifiedMaterial Contains a record for every successfully identified

material

Page 19: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 19 of 46

3.4 Work Instructions

3.4.1 Additional steps for Installation

After import of the SAP MII for Batch Manufacturing project the following steps have to beperformed.

1. Activate the sending of process messages:Link the following transactions in the scheduler

a. SAP_BM/WorkInstructions/Transactions/SAPInterface/MessageHandler/handleMessagesFromBuffer

b. SAP_BM/WorkInstructions/Transactions/SAPInterface/MessageHandler/handleQMMessagesFromBuffer

Page 20: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 20 of 46

2. Browser settingsa. Deactivate the popup blockerb. Activate Animations.

3. Create a new control recipe destination, e.g. Z1 in customizing (production planning forprocess industries Process Management Control Recipes Control recipe destinationsOR transaction SM59.

4. Destination Type:2.

5. Description and address: Your RFC connection to SAP MII.

6. If you are using SAP Best Practises for Chemicals, you can copy the control recipedestination Y1 changing the address as described above.

During parsing the SAP MII activates the configuration which is stored in a file that could befound following the path xMII_PI_Sheet_Config/config/config.xml in the WEB tab. The content isdisplayed in the following format. All used modules with a short description can be found there.Also the settings concerning the MII and the SAP ERP system can be found there.

3.4.2 Important TransactionsAll transactions can be found in the folder “Transaction”, all templates in the corresponding“Template” folder. Most folders have subfolders according to the functionality, e.g. transactionsstoring data in the database can be found in the folder “DBInterface”, transactionscommunicating with SAP ERP can be found in the folder “SAPInterface”.

Transaction DescriptionsplitOrder The transaction is executed by MII, receives new control

recipes and calls the transaction “ParseXML”. If more than onecontrol recipe is received in one document (collective sendingby SAP ERP) the transaction can split the document in onecontrol recipe for one order and calls the transaction“ParseXML” several times which has an impact on theperformance.

ParseXML This transaction receives each control recipe and triggerssubsequent transactions for building the HTML pages for theEWI and the quality inspections. All created documents arestored by ParseXML in the database.

buildContent The transaction is the main one for the EWI. It builds thecontent of the EWI in terms of frames and modules and theorder data are stored in the database. The control recipe isprocessed sequentially from the start (table CRFT) andwhenever a module is found (table COSTR) in theconfiguration the corresponding transaction is called viaHTTPost. The module is embedded in a new phase. Thisphase is created as HTML fragment and the HTML modulesare assigned to it and all of them getting the same inputparameters. The triggered transactions are selecting the HTMLfragments from the database, variables are valuated with datafrom the control recipe (table CRFV) and the result is an HTMLstring added to the previously created construct. Modules thatare not visible are processing data in the background and store

Page 21: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 21 of 46

it in the database.The HTML fragments can contain with a JavascriptID todynamically include them into the HTML document. With thismechanism functionality is enabled e.g. for input fields to storethe user input to the database.At the end of each phase an HTML string in created and addedto the previous strings. The complete HTML string at the end ofthe EWI is sent to the ParsXML transaction that stores the filein the workbench

handleMessagesFromBuffer This transaction is periodically executed (default 30 s) andselects all messages in the database with the status “preparedto send”. After building the messages with MessageHeaderand MessageElements they are send to SAP ERP. If themessage is returned with an error it is stored in the databasewith the status “failure”. Successfully transferred messages arestored with the status “sent”.The transaction is also recommended to see detailedinformation on failures that are not displayed in the messagemonitor since some elements are processed during sending(e.g. leading zeros). If there are problems with the processmessages sent to SAP ERP the following procedure would berecommended.

Check whether the transaction is executed periodically Check the message monitor for obvious errors Execute this transaction for a detailed analysis.

3.4.3 DatabaseThis chapter describes the usage of the database in which all relevant application specific andorder specific data are stored. The main tables are described as well.

Table Name Descriptiondbo.Order It contains the complete set of order data and the path(s) to the

distinct HTML files of the order, the bill of materials, etc. The statusof the order is stored as well (“new” (1), “in process” (2), “completed”(3), “discarded” (5)). During processing of and order the status is setto “locked” (4) to prevent changes by two different clients at thesame time.

dbo.HTML It contains the HTML master data that are fragments for eachmodule. The corresponding transactions getting the HTMLfragments with all variables here (unvaluated or default value).

dbo.MessageHeader anddbo.MessageElements

They contain the message header data including the messagestatus and the data for the message elements. When a processmessage is due to be sent, all message headers for a distinct ordersare selected and the corresponding elements are selected as well tobuild the message. Also the message monitor uses these twotables.

dbo.ElementsOnPage It contains the set of input and output fields for the EWI as well astheir values. Default values are stored here and are changed e.g. byJavascript programs on processing the EWI.

Page 22: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 22 of 46

dbo.ElementsOfTable It contains all information on tables. The references to rows,columns and the content in the table ElementsOnPage are kept inthis table as well to find the value of distinct cell of a table.

3.4.4 Important Stored ProceduresThe majority of database interactions are handles with stored procedures in MS SQL. The mostimportant ones are described in the following chapter

Stored procedure Descriptiondbo.getOrder It is used for the order selection screen. It takes all selection

parameter and branches to further scalar operations. Thesearch mainly looks on the tables “Order” and“OrderPhaseConfirmation”.

dbo.createOrder It creates an entry in the table order and stores availablevalues from the control recipe.

dbo.getElementOnPageValue It reads the values for the GUI from the database.dbo.checkIfSignaturesAreSet It checks the status of all process messages for an order. The

order can be completed if no messages with the status “new”or “in process” are found.

3.4.5 Important JavaScript FunctionalitiesAll functionality at the user interface is done with JavaScript, e.g. data retrieval from thedatabase, storage of input values in the database, adding new tables rows and sending ofprocess messages.All global constants (size of PopUps, row number for tables, etc) are defined at the beginning ofthe JavaScript. The authorization for certain functionalities (buttons in the order selection,change of working mode) is done with JavaScript. See below the lines of the coding in the orderselection where the check for the authorization is done:

File: selektion.js: Show buttons “Discard” and “Unlock” for authorized users only.Line : 77// if no order has been found, show it in the logging bar if(foundOrders==0){ // get the message for this error var message = document.getElementById("orderErrorMsg").value; // call the log writing method from the common js LogWrite(message,"Warning",5000); document.getElementById("verwerfen").style.display = "none";

document.getElementById("entsperren").style.display = "none"; } else { // show the buttons for the order functionality

var Auth_WI_Discard =OrderListGrid.getPropertyValue('BM_WI_Discard'); var Auth_WI_Unlock =OrderListGrid.getPropertyValue('BM_WI_Unlock'); if (Auth_WI_Discard == "Yes" ) {document.getElementById("verwerfen").style.display = "block";}if (Auth_WI_Unlock == "Yes" ) {document.getElementById("entsperren").style.display = "block"; }

Page 23: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 23 of 46

File: PI_sheet.js Funktion: changeMode : Restrict processing of work instructions.Line: 3032//Checkauthorization (custom attribute BM_WI_EDITvar Auth_WI_Edit=Command.getPropertyValue(‘BM_WI_Edit’);if(Auth_WI_Edit==YES){

This table describes the most important functions in the JavaScript PI_sheet.js).

Java script Function DescriptionopenPI_Sheet(orderID) Is executed on loading of the EWI. It triggers other

functionalities like data retrieval for the GUI,creating table rows, etc.

changeMode(orderID,linkID) Checks the user role and the order status.Depending on the result the change mode isenables and all input fields that are not confirmedyet are open for data entry.

UpdateSignInput(valueID,signID) Sets the signature, changes the status of allprocess messages to “prepared to send” if allmandatory inputs are done and changes the inputfields to display only. If the signature is disabledonly the check on mandatory fields and the statuschange of the process messages are done.

closeRecipe(abschliessenid, orderID) When the EWI is closed the order status in thedatabase is changed from 4 (locked) to 3(completed) on completion of the EWI or to 2 (inprocess). The order status remains 1 (new) if theuser did not change the mode. If the EWI is alreadyprocessed at another client, the latter onedetermines the status also on closing the EWI in thesecond client.

NewFirstRowXYZ Builds the first table row of the correspondingprocess instruction by retrieving the necessaryinformation from the database and generates atable row in HTML during runtime.

newRowXYZ Creates a new table row in the user interface duringruntime after clicking the [+] symbol in the EWI. Thetable row is created in the HTML and in thedatabase as well. A new process message iscreated according to the process instruction.

Page 24: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 24 of 46

3.4.6 Process Instruction Categories and Process MessagesThe following process instruction categories have been set up in SAP ERP and can beinterpreted by the template for work instructions.

ProcessInstructionCategory

Description Charateristics Value

QMJMP_PHJump to QMresults recordingfor phase

10 PPPI_PHASE

YQ_AIRAir flow withvalidationformula

10 PPPI_DATA_REQUEST_TYPE Simple data request

20 PPPI_MESSAGE_CATEGORY YQ_AIR

30 PPPI_PROCESS_ORDER

40 PPPI_AUTOMATIC_VALUE Event date

50 PPPI_AUTOMATIC_VALUE Event time

60 PPPI_OPERATION

70 PPPI_PHASE

80 PPPI_INPUT_REQUEST Air Flow:

90 PPPI_REQUESTED_VALUE YQ_AIR_FLOW

100 PPPI_VALIDATION_FORMULA X > 2 AND X < 4

110 PPPI_TEXT_FOR_INVALID_INPUT LONG TEXT

120 PPPI_ACCEPT_INVALID_INPUT Accept with signature only

130 PPPI_UNIT_OF_MEASURE m3/s

YQ_ENDPI Signature at theend of PI sheet

10 PPPI_DATA_REQUEST_TYPE Simple data request

20 PPPI_MESSAGE_CATEGORY SIGN

30 PPPI_PROCESS_ORDER

40 PPPI_CONTROL_RECIPE

50 PPPI_OPERATION

60 PPPI_PHASE

70 PPPI_AUTOMATIC_VALUE Event date

80 PPPI_AUTOMATIC_VALUE Event time

90 PPPI_INPUT_REQUEST Sign end of PI sheet:

100 PPPI_REQUESTED_VALUE PPPI_SIGNATURE

110 PPPI_SIGNATURE_AUTHORIZATION Edit

YQ_HEAD PI Sheet headerfor CRD Y1

10 PPPI_INSTRUCTION LONG TEXT

20 PPPI_OUTPUT_CHARACTERISTIC PPPI_INSTRUCTION

30 YQPI_INSTRUCTION_01 LONG TEXT

40 PPPI_OUTPUT_CHARACTERISTIC YQPI_INSTRUCTION_01

50 YQPI_INSTRUCTION_02 LONG TEXT

60 PPPI_OUTPUT_CHARACTERISTIC YQPI_INSTRUCTION_02

YQ_INSTR Instruction 10 PPPI_INSTRUCTION

YQ_LAYLayout def. of PIsheet forChemicals

10 PPPI_LAYOUT LONG TEXT

YQ_MATLI Dispensingmaterial list 10 PPPI_INPUT_GROUP Material List for Dispensing

Page 25: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 25 of 46

20 PPPI_MESSAGE_CATEGORY YQ_CONS

30 PPPI_PROCESS_ORDER

40 PPPI_RESERVATION

50 PPPI_RESERVATION_ITEM

60 PPPI_MATERIAL

70 PPPI_MATERIAL_SHORT_TEXT

80 PPPI_VARIABLE 'VAR_BATCH_&0050&'

90 PPPI_BATCH

100 PPPI_STORAGE_LOCATION

110 PPPI_VARIABLE 'VAR&0050&'

120 PPPI_MATERIAL_CONSUMED

130 PPPI_UNIT_OF_MEASURE

140 PPPI_AUTOMATIC_VALUE Event Date

150 PPPI_AUTOMATIC_VALUE Event Time

160 PPPI_OUTPUT_TEXT Material

170 PPPI_OUTPUT_CHARACTERISTIC PPPI_MATERIAL

180 PPPI_OUTPUT_TEXT Material Description

190 PPPI_OUTPUT_CHARACTERISTIC PPPI_MATERIAL_SHORT_TEXT

200 PPPI_INPUT_REQUEST Batch Number

210 PPPI_DEFAULT_VARIABLE 'VAR_BATCH_&0050&'

220 PPPI_REQUESTED_VALUE PPPI_BATCH

230 PPPI_OUTPUT_TEXT Planned Qty.

240 PPPI_OUTPUT_CHARACTERISTIC PPPI_MATERIAL_CONSUMED

250 PPPI_INPUT_REQUEST Consumed Qty.

260 PPPI_DEFAULT_VARIABLE 'VAR&0050&'

270 PPPI_REQUESTED_VALUE PPPI_MATERIAL_CONSUMED

280 PPPI_VALIDATION_FORMULA ( X >= ( 0.99 * 'VAR&0050&' ))

290 PPPI_VALIDATION_FORMULA AND

300 PPPI_VALIDATION_FORMULA ( X <= (1.01 * 'VAR&0050&' ))

310 PPPI_VALIDATION_FORMULA UoM

320 PPPI_OUTPUT_TEXT PPPI_UNIT_OF_MEASURE

330 PPPI_OUTPUT_CHARACTERISTIC SIGN

340 PPPI_MESSAGE_CATEGORY

350 PPPI_PROCESS_ORDER

360 PPPI_CONTROL_RECIPE

370 PPPI_OPERATION

380 PPPI_PHASE Event Date

390 PPPI_AUTOMATIC_VALUE Event Time

400 PPPI_AUTOMATIC_VALUE Sign material consumption

410 PPPI_INPUT_REQUEST PPPI_SIGNATURE

YQ_PROD Goods receiptfrom production

10 PPPI_DATA_REQUEST_TYPE Simple data request

20 PPPI_MESSAGE_CATEGORY PI_PROD

30 PPPI_PROCESS_ORDER

40 PPPI_MATERIAL

Page 26: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 26 of 46

50 PPPI_MATERIAL_SHORT_TEXT

60 PPPI_BATCH

70 PPPI_STORAGE_LOCATION

80 PPPI_AUTOMATIC_VALUE Event date

90 PPPI_AUTOMATIC_VALUE Event time

100 PPPI_INPUT_GROUP Goods receipt (&0050&)

110 PPPI_OUTPUT_TEXT Planned Quantity:

120 PPPI_OUTPUT_CHARACTERISTIC PPPI_MATERIAL_PRODUCED

130 PPPI_OUTPUT_CHARACTERISTIC PPPI_UNIT_OF_MEASURE

140 PPPI_INPUT_REQUEST Produced Quantity:

150 PPPI_MATERIAL_PRODUCED

160 PPPI_GLOBAL_VARIABLE PRODUCT_AMOUNT

170 PPPI_REQUESTED_VALUE PPPI_MATERIAL_PRODUCED

180 PPPI_UNIT_OF_MEASURE

190 PPPI_OUTPUT_TEXT Batch number:

200 PPPI_OUTPUT_CHARACTERISTIC PPPI_BATCH

210 PPPI_PHASE

YQ_PTEXTDescription forphase in PISheet

10 PPPI_PHASE_SHORT_TEXT

YQ_RPMRPM withvalidationformula

10 PPPI_DATA_REQUEST_TYPE Simple data request

20 PPPI_MESSAGE_CATEGORY YQ_RPM

30 PPPI_PROCESS_ORDER

40 PPPI_AUTOMATIC_VALUE Event date

50 PPPI_AUTOMATIC_VALUE Event time

60 PPPI_OPERATION

70 PPPI_PHASE

80 PPPI_INPUT_REQUEST Extruder RPM:

90 PPPI_REQUESTED_VALUE YQ_RPM

100 PPPI_VALIDATION_FORMULA X > 20 AND X < 30

110 PPPI_TEXT_FOR_INVALID_INPUT LONG TEXT

120 PPPI_ACCEPT_INVALID_INPUT Accept with signature only

130 PPPI_UNIT_OF_MEASURE 1/min

YQ_TEMPTemperaturewith validationformula

10 PPPI_DATA_REQUEST_TYPE Simple data request

20 PPPI_MESSAGE_CATEGORY YQ_TEMP

30 PPPI_PROCESS_ORDER

40 PPPI_AUTOMATIC_VALUE Event date

50 PPPI_AUTOMATIC_VALUE Event time

60 PPPI_OPERATION

70 PPPI_PHASE

80 PPPI_INPUT_REQUEST Temperature:

90 PPPI_REQUESTED_VALUE YQ_TEMPERATURE

100 PPPI_VALIDATION_FORMULA X > 80 AND X < 90

110 PPPI_TEXT_FOR_INVALID_INPUT LONG TEXT

Page 27: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 27 of 46

120 PPPI_ACCEPT_INVALID_INPUT Accept with signature only

130 PPPI_UNIT_OF_MEASURE °C

YQ_CON1

Time ticketconfirmation inconjunction withYQ_PROD

10 PPPI_DATA_REQUEST_TYPE SIMPLE

20 PPPI_MESSAGE_CATEGORY YQ_PHCO1

30 PPPI_STATUS_CONFIRMED 00002

40 PPPI_ACTIVITY_1_UNIT min

50 PPPI_OUTPUT_TEXT

60 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_1

70 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_1_UNIT

80 PPPI_INPUT_REQUEST 1.000

90 PPPI_ACTIVITY_1

00 PPPI_REQUESTED_VALUE PPPI_ACTIVITY_1

105 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_1_UNIT

110 PPPI_OPERATION

120 PPPI_PHASE

130 PPPI_PROCESS_ORDER

140 PPPI_AUTOMATIC_VALUE Eventdate

150 PPPI_AUTOMATIC_VALUE Event time

YQ_CON2Time ticketconfirmation inconjunction withYQ_PROD

10 PPPI_DATA_REQUEST_TYPE SIMPLE

20 PPPI_MESSAGE_CATEGORY YQ_PHCO2

30 PPPI_STATUS_CONFIRMED

40 PPPI_ACTIVITY_2_UNIT min

50 PPPI_OUTPUT_TEXT

60 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_2

70 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_2_UNIT

80 PPPI_INPUT_REQUEST

90 PPPI_ACTIVITY_2_UNIT

100 PPPI_REQUESTED_VALUE PPPI_ACTIVITY_2

105 PPPI_OUTPUT_CHARACTERISTIC PPPI_ACTIVITY_2_UNIT

110 PPPI_OPERATION

120 PPPI_PHASE

130 PPPI_PROCESS_ORDER

140 PPPI_AUTOMATIC_VALUE Eventdate

150 PPPI_AUTOMATIC_VALUE Event time

Changes to these process instructions will not necessary be reflected in the SAP MII workinstruction template. E.g. the instruction texts can obviously be changed to your needs, formulascan be adapted as well. The general structure however should not be changed.

Page 28: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 28 of 46

The following process messages have been used in the example scenario (See ApplicationGuide, chapter 3).Process message Characteristic DescriptionSIGN PPPI_CONTROL_RECIPE Control Recipe

PPPI_EVENT_DATE Date of Event

PPPI_EVENT_TIME Date/Time of Event

PPPI_OPERATION Operation Number

PPPI_PHASEs Phase Number

PPPI_PROCESS_ORDER Process Order

PPPI_SIGNATURE Signature

YQ_AIR PPPI_CONTROL_RECIPE Control recipe

PPPI_EVENT_DATE Date of event

PPPI_EVENT_TIME Date/time of event

PPPI_MATERIAL Material number

PPPI_OPERATION Operation number

PPPI_PHASE Phase number

PPPI_PROCESS_ORDER Process order

PPPI_SIGNATURE Signature

PPPI_UNIT_OF_MEASURE Unit of measure

YQ_AIR_FLOW Air Flow

PI_PROD PPPI_BATCH Batch

PPPI_DELIVERY_COMPLETE Final Delivery

PPPI_EVENT_DATE Date of Event

PPPI_EVENT_TIME Date/Time of Event

PPPI_MATERIAL Material Number

PPPI_MATERIAL_PRODUCED Quantity of Material Produced

PPPI_OPERATION Operation Number

PPPI_ORDER_ITEM_NUMBER Order Item Number

PPPI_PHASE Phase Number

PPPI_PROCESS_ORDER Process Order

PPPI_STOCK_TYPE Stock Type

PPPI_STORAGE_LOCATION Storage Location

PPPI_UNIT_OF_MEASURE Unit of Measure

YQ_RPM PPPI_CONTROL_RECIPE Control recipe

PPPI_EVENT_DATE Date of event

PPPI_EVENT_TIME Date/time of event

PPPI_MATERIAL Material number

PPPI_OPERATION Operation number

PPPI_PHASE Phase number

PPPI_PROCESS_ORDER Process order

PPPI_SIGNATURE Signature

PPPI_UNIT_OF_MEASURE Unit of measure

YQ_RPM RPM

Page 29: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 29 of 46

YQ_TEMP PPPI_CONTROL_RECIPE Control recipe

PPPI_EVENT_DATE Date of event

PPPI_EVENT_TIME Date/time of event

PPPI_MATERIAL Material number

PPPI_OPERATION Operation number

PPPI_PHASE Phase number

PPPI_PROCESS_ORDER Process order

PPPI_SIGNATURE Signature

PPPI_UNIT_OF_MEASURE Unit of measure

YQ_TEMPERATURE Temperature

YQ_CONS PPPI_BATCH Batch

PPPI_EVENT_DATE Date of Event

PPPI_EVENT_TIME Date/Time of Event

PPPI_FINAL_ISSUE Indicator: Final Issue

PPPI_MATERIAL Material Number

PPPI_MATERIAL_CONSUMED Quantity of MaterialConsumed

PPPI_OPERATION Operation Number

PPPI_PHASE Phase Number

PPPI_PROCESS_ORDER Process Order

PPPI_RESERVATION Reservation

PPPI_RESERVATION_ITEM Reservation Item Number

PPPI_SIGNATURE Signature

PPPI_SPECIAL_STOCK Special Stock Indicator

PPPI_STORAGE_LOCATION Storage Location

PPPI_UNIT_OF_MEASURE Unit of Measure

PPPI_VENDOR Vendor

YQ_PHCO1 PPPI_ACTIVITY_1 Activity to Be Confirmed 1

PPPI_ACTIVITY_1_UNIT Unit for Activity 1

PPPI_EVENT_DATE Date of Event

PPPI_EVENT_TIME Date/Time of Event

PPPI_OPERATION Operation Number

PPPI_PHASE Phase Number

PPPI_PROCESS_ORDER Process Order

PPPI_STATUS_CONFIRMED Status for Activity Confirm.

YQ_PHCO2 PPPI_ACTIVITY_2 Activity to Be Confirmed 2

PPPI_ACTIVITY_2_UNIT Unit for Activity 2

PPPI_EVENT_DATE Date of Event

PPPI_EVENT_TIME Date/Time of Event

PPPI_OPERATION Operation Number

PPPI_PHASE Phase Number

PPPI_PROCESS_ORDER Process Order

PPPI_STATUS_CONFIRMED Status for Activity Confirm.

Page 30: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 30 of 46

Additional process instruction categories and process messages have been implemented in theSAP MII work instruction template but not thoroughly tested. The corresponding settings in SAPERP can be sent out on request. We recommend to check with SAP or a partner if they fit in yourbusiness process.

Process MessageCategory Description Requested

Message

YQ_AKTIV Activation/deactivation of unplanned material withdrawal(YQ_MATMZ)

YQ_ANLAG Valuation of resource status with an input parameter YQ_ANLAG

YQ_CON3 Milestone time ticket confirmationConfirmations of set up times (labor) YQ_PHCO3

YQ_CON4 Milestone time ticket confirmationConfirmations of labor time YQ_PHCO4

YQ_CON1A Milestone time ticket confirmation + product quantityConfirmations of set up time (machine) YQ_PHC1A

YQ_CON2A Milestone time ticket confirmation + product quantityConfirmations of machine time YQ_PHC2A

YQ_CON3A Milestone time ticket confirmation + product quantityConfirmations of set up time (labor) YQ_PHC3A

YQ_CON4A Milestone time ticket confirmation + product quantityConfirmations of labor time YQ_PHC4A

YQ_DATUM Output of actual date

YQ_DOC_X Display of documents in SAP MII work instructions

YQ_ETIK Button to jump to label printing (in SAP MII only)

YQ_FIN Indicator for completion of a phase YQ_FIN

YQ_MATM Material list for non-reservation items YQ_CONS

YQ_MATMA Material list of reservation items

YQ_MATMK Display of order header data

YQ_MATMZ Empty material list for unplanned withdrawls YQ_CONS

YQ_MATMT Output of process order start/end dates

YQ_PROD Posting a goods receipt for process orders. PI_PROD

YQ_PRODO Confirmation of product quantity without goods reiceipt YQ_PHPRO

YQ_QMABS Button zum Absprung in die QM-Erfassung.

Page 31: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 31 of 46

3.4.7 Miscellaneous

3.4.7.1 Process message monitorProcess messages are the technique to communicate with SAP ERP from the work instructions.To facilitate troubleshooting a process message monitor has been implemented to control thesuccessful sending of it.

The tool is not assigned to any role within this template release since further improvements areplanned. However it can be used by assigning the transaction “Message Monitor” to a suitablemenu, e.g. for the shift administrator.

3.4.7.2 Changing or Adding IconsIf icons are added with in SAP ERP or changed this has to be reflected in SAP MII. To use theseicons in the work instructions, they have to be imported into SAP MII.

1. Open the SAP MII workbench.2. Store the icons in the folder “SAP_BM/WEB/WorkInstructions/WebContent/IMAGES/ICONS”

using exactly the same name as in SAP ERP.3. The logic finds the complete link in the control recipe received from SAP ERP and changes it

to the correct local SAP MII path.

Page 32: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 32 of 46

3.5 Quality ControlThe Quality Control application enables the user to execute results recordings separately fromthe electronic work instructions, e.g. for inspection lots with the origin 04. It also providesfunctionality to perform usage decisions.

3.5.1 Additional steps for InstallationThe Custom Attributes “BM_SUBSYSID” needs to be assigned the subsystem ID. This can bechanged on the main MII menu under System Management – Custom Attributes.

3.5.2 Important Transactions

Table Name Description

GetInspectionLotListByPlantAndMaterial Provides the listing of inspection lots and associateddata based off of the entered material, plant,inspection type and date by combining the results ofthe function module BAPI_INSPLOT_GETLIST andBAPI_INSPLOT_GETDETAIL.This transaction is used on the Record Results andUsage Decision screens.

GetInspectionLotReqsByInspLot Calls the function moduleBAPI_INSPLOT_GETDETAIL to provide the neededdata to build the results recording portion of theapplication.

ProcessRecordResults Is used to record the results recording. It loopsthrough multiple input parameters that are receivedas string arrays separated by a “|” and build arequest document which is then sent to the functionmodule BAPI_INSPOPER_RECORDRESULTS toperform the recording.

setUsageDecision Is used to record the usage decision by utilizing thefunction moduleBAPI_INSPLOT_SETUSAGEDECISION.

GetCatCodes Calls the function moduleBAPI_SELECTEDSET_GETCODES to obtain thevalues used in the qualitative, valuation and usagedecision recording.

Page 33: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 33 of 46

3.5.3 Important XSL Style Sheets

Style Sheet Description

BuildRecordResults.xsl Uses the result of the GetInspectionLotReqsByInspLot transaction todynamically build the record results screen.

BuildCatCodesOptions.xsl Used to build the Qualitative drop down option boxes.

3.5.4 Important JavaScript Functionalities

Java Script function Description

RecordResults(formName,formNum, INSPSAMPLE,INSPTYPE)

Loops through the results that have been recorded andcreates string arrays for each of the needed parameters andseparates them by a “|”. These are then submitted to theProcessRecordResults transaction with the appropriateinspection lot, operation and other needed values.

RecordValuation(returnVal) Records the valuation for the sample type of inspections thatrequire valuation recording.

showRecordResults() Calls the BuildRecordResults.irpt page which utilizes theBuildRecordResults.xsl style sheet to build the record resultsscreen.

updateCodesOper() Gets the usage codes for the chosen inspection lot.

recordUD() Records the usage decision.

Page 34: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 34 of 46

3.6 Production ConfirmationCustomers who do not want to confirm process orders via work instructions can do this as wellwith the application for production confirmations. Within this application, individual headerconfirmations can be performed. If auto goods receipts and auto backflush flags are not set for aspecific order/material, components and the material to be produced can be posted as separateand distinct individual goods movements.

3.6.1 Additional steps for InstallationThe order list for selection is generated by the same functionality used by the Production Report,so the associated database tables need to have been updated prior to initial use.

3.6.2 Important TransactionsThere are other transactions which are called, but these are the key initiator transactions.

Transaction DescriptionProcessOrderConfirmations Performs a header confirmation against an individual order.

Triggered by the HeaderConfirmation.irpt screen.GoodsMovementSingleItem Performs a single goods movement for either a component or

delivered material for a single order. Triggered from theGoodsMovements.irpt screen.

FastProcessOrderList Uses FastProcessOrderListPrep to set the specific SQL scriptfor the query to populate the grid according to the selectioncriteria set in ConfOrderSelectionFast.irpt.

GetOrderGoodsMovements Retrieves from ERP the list of Goods Movements previouslyexecuted against the selected order.

ProcessOrderConfList Retrieves from ERP the list of Header Confirmationspreviously executed against the selected order.

3.6.3 DatabaseCritical tables are shared with the Production Report in the Manufacturing Performanceapplication. There are two in the database along with a key custom view based mainly upon thetables:

Table Name Descriptiondbo.ReportOrders Contains the downloaded data from ERP including status,

quantities, dates, etc. required for both the ProductionConfirmation and the Production Report.

dbo.AFRUConfirmations Contains the history of confirmations executed against theorders contained in the ReportOrders table. Depending uponthe status, the Actual Finish and the Actual Duration may bepopulated from data contained in the AFRUConfirmationstable.

dbo.ProductionReportView The final presentation as a custom view of the data containedin the two Production Report tables and a custom view(supplies Process Message information for calculating ActualFinish dates and times when Confirmation are not available fora completed order) from which the specific dataset is extractedaccording to the selection criteria set for the order lists in theConfOrderSelectionFast.irpt.

Page 35: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 35 of 46

3.6.4 Important JavaScript FunctionalitiesJavascript functionalities are included in three main irpt pages:

ConfOrderSelectionFast.irpt (embedded in OrderConfirmationFast.irpt) GoodsMovements.irpt HeaderConfirmation.irpt

Page 36: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 36 of 46

3.7 Shift book – configuration & descriptionThe shift book contains two parts. The first one is all elements to setup the master data likeshifts, teams and the corresponding users. The second one is the shift book itself and theactions to be done with it.

3.7.1 Additional steps for Installation

3.7.1.1 Creation of System StatusThe following records can be entered in the database tables using SQL Server ManagementStudio to create system info categories for the message classification that can not be changedby the user.

dbo.infostate

idInfoState* stateOrder systemState

1 10 X

2 20 X

3 30 X

4 40 X

5 50 X

dbo.infostate_lang

idInfoState* shortDescrEN longDescrEN shortDescrDE longDescrEN

1 New New Neue Neue

2 Read Read Gelesen Gelesen

3 Closed Closed Geschlossen Geschlossen

4 Forwarded Forwarded Weitergeleitet Weitergeleitet

5 Deleted Deleted Gelöscht Gelöscht

*Remark: the field idInfostate in tabel dbo.infostate is determined by the database. Therespective value should be the same in table dbo.infostate_lang.

3.7.1.2 Assignment of Custom AttributesThe following custom attributes must be assigned to the SAP MII User.

BM_DateTimeFormat (default MM/dd/yyyy HH:mm:ss) BM_LanguageList (default en, e.g. en_de)

Page 37: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 37 of 46

3.7.2 Important TransactionsTransaction DescriptionAddXYZTransaction(Master data part)

Creates a row in the database table triggered fromuser interface. By errors the information will be sentto AppLog database table.

UpdateXYZTransaction(Master data part)

Updates a row in the database table triggered fromthe user interface. By errors the information will besent to AppLog database table.

PlanRollingShiftsTransaction(Master data part)

Creates entries in the shift data database table for aselected period (actual date into the future). If a shiftplanning already exists it will be added from the lastplanned day into future.To calculate the last planned shift theGetnextPossibleShiftTransaction is called.

GetnextPossibleShiftTransaction(Master data part)

Calculates the last planned shift for the factoryselected by user interaction. If no planning exists itreturns the next possible shift starting from the actualdate.

CreateNewMessageTransaction(Shift book part)

Creates a new row in the database table Messagestriggered from the user interface. By errors theinformation will be sent to AppLog database table.

UpdateMessageTransaction(Shift book part)

Updates a row in database table Messages triggeredfrom the user interface. By errors the information willbe sent to AppLog database table.

CreateNewInstructionTransaction(Shift book part)

Call CreateNewMessageTransaction to create a newrow with message data; subsequently a new row inInstruction database table is created and as manyentries in the shift book table as valid for the selectedvalidation period.By errors the information will be sent to AppLogdatabase table.

UpdateInstructionTransaction(Shift book part)

Update Message, Instruction and Shift bookdatabase tables with information from a userinteraction by clicking on “update” button.

CloseAllMessagesTransaction(Shift Closing part)

Set status to “closed” in Messages database table forall messages created in current shift with status notequals “closed”.

ConfirmAllInstructionTransaction(Shift Closing part)

Inserts the value “X” into data field “confirmed” of theshift book database for all instructions that are validfor the current shift.

ForwardSelectedMessagesTransaction(Shift Closing part)

Sets the status to “closed” for all selected messageson the shift closing screen in current shift and createscopies of them for the next shift with status“forwarded”.

CreatedPDFReportTransaction(Shift Closing part)

Creates PDF report for the current shift.

InsertFunclocListTransaction(Master data part)

Calls BAPI BAPI_FUNCLOC_GET_LIST from SAPERP for the plant selected by user interface andstore it into database table Topology.

Page 38: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 38 of 46

3.7.3 DatabaseTable name Descriptiondbo.Factory(Master data part)

Contains data set of all available factories.

dbo.InfoStatePerType(Master data part)

Contains relation between Infotypes and InfoState tables. Isfactory independent

dbo.InfoState_lang(Master data part)

Contains data fields with description in several languages. Perlanguage two fields must be defined: shortDescr[LANG] andlongDescr[LANG]. [LANG] is language code in uppercase mode.(e.g. EN for English and DE for German)

dbo.InfoType(Master data part)

Contains data set of all info types as message type andinstruction type. The data field IsInstruction contains X if the infotype is instruction and blank if info type is message.ColorcodefieldContains the colorcode to be displayed on web page.

dbo.InfoType_lang(Master data part)

Contains data fields with description in several languages. Perlanguage two fields must be defined: shortDescr[LANG] andlongDescr[LANG]. [LANG] is language code in uppercase mode.(e.g. EN for English and DE for German)

dbo.Instruction Contains instruction specific information like the validation perioddbo.Message Contains general information for messages and instructions.dbo.ShiftBook Collects the list of shift messages and instruction for all shifts for

all factories.dbo.ShiftData(Master data part)

Collects the shift planning for all factories

dbo.ShiftDefinition Contains dataset of shift definition for all factoriesdbo.ShiftDefinition_lang(Master data part)

Contains data fields with shift description in several languages.Per language must be defined two fields: shortDescr[LANG] andlongDescr[LANG]. [LANG] is language code in uppercase mode.(e.g. EN for English and DE for German )

dbo.Team(Master data part)

Contains dataset of teams

dbo.Topology(Master data part)

Contains functional locations for defined factories downloadedfrom SAP ERP system

dbo.Users(Master data part)

Contains dataset of application specific users.

Page 39: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 39 of 46

3.7.4 Important JavaScript FunctionalitiesJava Script funtion DescriptioncreateXYZ Creates a new table row in the user interface during runtime after

clicking the “add” button in the ESB. The table row is created in theHTML and in the database as well.

updateXYZ Updates a selected table row in the user interface during runtime afterclicking the “update” button. The table row is updated in the HTML andin the database as well.

deleteXYZ Deletes a selected table row in the user interface during runtime afterclicking the “delete” button. The table row is deleted in the HTML and inthe database as well.

clearFields Clears the detail fields and set web page to initial stategetSelectedXYZData Provides the detailed information in HTML for a selected table row

during runtime after clicking the row in HTML table.setColorInGrid Sets match color property for igrid.

Relevant for Masterdata/InfoType/InfoType.irpt,Shiftbook/Messages/ActualMessages.irpt,Shiftbook/Messages/PreviousMessages.irpt,Shiftbook/Instructions/ActualInstructions.irpt,Shiftbook/Instructions/FutureInstructions.irpt,Shiftbook/Closure/Instructions.irpt and Shiftbook/Closure/Messages.irpt

executePlanning Calls the transaction for executing the shift planning for a selectedfactory. The list of available teams and shifts must be configuredbefore.

removePlanning Removes all planned shifts for a selected factory from the current dateinto the future. Important requirement for this functionality is theabsence of any entries for this time period in the table “shiftbook”.

SetInitValues Used in ActualMessages.irpt, PreviousMessages.irpt,ActualInstructions.irpt, FutureInstruction.irptset initial values on the page. Is called after any change on the pageand after applet initializing.

GetMessageDetails Provides detailed information for a selected message entry in HTMLtable.Relevant Shiftbook/Messages/ActualMessages.irpt,Shiftbook/Messages/PreviousMessages.irpt.

GetInstructionDetails Provides detailed information for a selected instruction entry in HTMLtable.Relevant Shiftbook/Instructions/ActualInstructions.irpt,Shiftbook/Instructions/FutureInstructions.irpt.

Page 40: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 40 of 46

3.8 Log Monitor

3.8.1 Additional Steps for InstallationLoggingRetention is a Scheduled Transaction which determines how many days the logs willreside in the database. Currently it is set for 30 days as a default, modify accordingly in the SAPMII system management.

3.8.2 Important Transactions

1. InsertLogDataCallerTrx – This query takes inputs passed from other transactions and writesthem into the Logging database table. Each application passes in its Application Name,Category, Message, etc.

2. LoggingDeleteTrx – This transaction is called from the Scheduler and determines how manydays back your log files should be stored for. By default this is set to 30 days.

3.8.3 Important Javascript FunctionsUpdateLogThis function takes all input values (ie Application, Category, Severity, SD, ED, etc.) from theLogViewer and LogViewerPopup webpages. It then sets the input parameters for the query toprocess the results and display it on the grid.

Page 41: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 41 of 46

3.9 Manufacturing Performance

Batch Manufacturing with SAP MII delivers a set of four KPI’s for the production supervisor. Inthe following section the calculation and the data sources are described.

Remark: The KPIs deliverd with this template are using the BAPI ‘BAPI_PROCORD_GET_LIST’that is available from SAP ERP2004 (SAP ABA 640) onwards. If your SAP ERP version is belowSAP ERP2004 you have to use alternate BAPI’S or RFC’s to provision the data.

3.9.1 Definition of KPIs

3.9.1.1 Plant on Time Delivery

Plant On-Time Delivery indicates how many orders have been completed / delivered on time withthe required quantity and quality. This KPI is calculated asPlant On-Time Delivery = Number of Production Orders Completed On Time / Total Number ofCompleted Production Orders (where FINISH_DATE is between Date From and Date To and forthe Selected Material).

The following parameters must be setup.

The following data sources are used to calculate this KPI

BAPI_PROCORD_GET_LIST, where the Material used is the one the user selected on theHTML-Screen.

3.9.1.2 Production Plan Adherence

Production Plan Adherence is an indicator of the reliability and robustness of the production plan.It is calculated as

Production Plan Adherence = Planned Produced Quantity – Variances (ABS (ActualProduced Quantity - Planned Produced Quantity)) / Planned Produced Quantity (whereFINISH_DATE is between Date From and Date To and for the Selected Material.Optional Condition is Work Center).

The following Parameters must be setup.

Page 42: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 42 of 46

The following data sources are used to calculate this KPI

BAPI_PROCORD_GET_LIST, for the Selected Material and Optional Condition WorkCenter.

BAPI_PROCORD_GET_DETAIL, per Order. RFC_READ_TABLE on Table AFRU and return the GMNGA per Order. RFC_READ_TABLE on Table AFRU and return the GMNGA per Order and STOKZ is

true

3.9.1.3 Capacity UtilizationWe consider the capacity utilization as ratio between the time a production unit is in use (busytime) and the time it is generally available excluding down times (e.g. emergency shutdown,maintenance periods).

= ( )

( )

The following calculation is based on a parent transaction call to two child transactions. Theparent transaction for calculating the Capacity Utilization calls a transaction for calculating bothAvailable Time and Busy Time separately. This was done in order to provide flexibility in themechanism used to report this value to the user. If for your environment it is necessary toretrieve these values from another source system you can simply build and replace thistransaction call within the Capacity Utilization transaction. As long as you build the sameresponse Illuminator XML document as the response then the main transaction and reportinginterface will work with your custom transaction. There is an example already namedGetBusyTimeForHierarchyDemo which demonstrates a custom transaction for calculating busytime which can be used as a starting template.

Page 43: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 43 of 46

The main Capacity Utilization calculation transaction requires the following input parameters tobe mapped into the XactueQuery template:

The following BAPIs/RFCs are used in order to retrieve the necessary Capacity Utilizationinformation:

RFC_TABLE_READ (For AFRU and CRHD) CR_HIERARCHY_READ_NAME CR_HIERARCHY_FATHER_AND_SONS CR_CAPACITY_AVAILABLE_TIMES

You may need to remote enable some of these calls so verify ahead of time that they are remoteenabled in your system via SAP GUI transaction code se37.

Remark: It is important to note that in certain releases of SAP MII v12.1.4 there may be issueswith the Dynamic Link configured in the Aggregate Statistics action block involved in calculatingthe Busy Time.

Page 44: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 44 of 46

3.9.2 Performance

3.9.2.1 Additional Steps for Installation1. The following transaction

(SAP_BM/KPI/Hierarchy/GenerateKPIHierarchyForUserDefinedPlants) must be run topopulate the hierarchy in the SAP_BM database.

2. The following tables must be filled in first. KPI – This is just a list of all KPIs with attributes for each KPI and must be filled out

first KPIMap – This links a KPI to a TagName to an object in the hierarchy. Currently the Performance KPI is based on demo and simulator data. Before using

this for other tags you must delete the data in the KPIMap table. Also modify ordelete the data in the ObjectHierarchy and ObjectDetailsByLang depending on howyour hierarchy is setup.

Remark: The KPIMap has dependencies on the KPI and ObjectHierarchy table.

3.9.2.2 Important Transactions:PerformanceCalculation – This transaction does not actually calculate the performance KPI. It isjust here for an example to show how the hierarchy could be used with tag values. Hierarchyvalues are passed into the “ResourceDBHierarchyAndTagNameQuery” SQL action. This SQLquery then determines what tag values to use to create the performance calculation. All the tagvalues are then passed into the “PerformanceTagQuery” action which does all aggregation of offeach tag using statistics mode. Next all TWA (Time Weighted Averages) values are added upand this is used as the performance value. This value is then passed to create the SVG Image.

3.9.2.3 Important JavaScriptexecutePerformanceWhen the “Execute” button is clicked this JavaScript function is called. It uses the values enteredon the webpage for creation of an SVG Image and to populate the chart.

Page 45: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 45 of 46

3.9.3 Production reportThe Production Report provides a simple picture of the confirmations performed in the previousweek along with the current orders as defined in the selection criteria. Order data andconfirmations are stored in the local database for faster presentation. Updates to the databasetables are scheduled periodically.

3.9.3.1 Additional steps for InstallationFor those updates the following scheduled job, LoadConfirmationTable (executingSAP_BM/MfgPerformance/LoadTables), needs to be run, possibly several times initially, topopulate the SAP_BM database tables: AFRUConfirmations and ReportOrders. Dependingupon the server, database size, network speed, quantity of data, etc., the job may take morethan a few minutes to run (hence the reason to cache local copies of the orders andconfirmations).

3.9.3.2 Important Transactions

Transaction DescriptionLoadTables Executes two separate transactions that each load one of the

two critical database tables with order and confirmation datafrom ERP.

FastProcessOrderList Uses FastProcessOrderListPrep to set the specific SQL scriptfor the query to populate the grid according to the selectioncriteria set in ProdReportSelection.irpt.

3.9.3.3 Database

Table name Descriptiondbo.ReportOrders The table dbo.ReportOrders contains the downloaded data

from ERP including status, quantities, dates, etc. required forboth the Production Confirmation and the Production Report.

dbo.AFRUConfirmations This table contains history of confirmations executed againstthe orders contained in the ReportOrders table. Dependingupon the status, the Actual Finish and the Actual Durationmay be populated from data contained in theAFRUConfirmations table.

dbo.ProductionReportView The final presentation as a custom view of the data containedin the two Production Report tables and a custom view(supplies Process Message information for calculating ActualFinish dates and times when Confirmation are not availablefor a completed order) from which the specific dataset isextracted according to the selection criteria set for the orderlists in the ProdReportSelection.irpt (embedded inProdReport.irpt).

Page 46: Batch Manufacturing with SAP MII

Batch Manufacturing with SAP MII Technical Guide

© SAP AG Page 46 of 46

4 ReferencesMII wiki - https://wiki.sdn.sap.com/wiki/display/xMIIMII forum - https://www.sdn.sap.com/irj/scn/forum?forumID=237General Help - http://help.sap.com