Quantcast
Channel: SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all 85 articles
Browse latest View live

Fine tune your SAP MII permissions with UME Actions...

$
0
0

The Scenario

 

My current project had a scenario wherein, in a particular screen we would need to display all the users with a particular role, say ProductionSupervisor, in a drop-down list so a value can be selected for user input. This can be very easily achieved using the SystemInfo service thus :

 

server:///XMII/Illuminator?Service=SystemInfo&Mode=UserList&Group=ProductionSupervisor&content-Type=text/xml

 

Here the filter Group=<RoleName> can be used to filter users with a particular role. The resultant XML can be parsed and displayed as a drop down list of relevant users.

 

When we tested this in development with our user-ids, this worked fine, however once we deployed it in production the drop down list was not populated at all for the users. We could immediately figure out that this was an authorization issue as all the developers in the team had the SAP_XMII_Administrator role assigned to them and the users in production had only the SAP_XMII_User role assigned. While attaching the administrator role for the users in production would have been a quick fix, it was definitely not the optimal solution as the client was not too comfortable with all the users having administrator rights over the production instance of SAP MII.

 

The Solution

 

Having faced similar issues before we knew the solution to the same. Enter, a little known and used SAP Netweaver UME feature : Actions. There are 207 Netweaver actions that let you have fine grained access to the various services, screens and functionality of SAP MII. You can attach an action to either a Role or a User for the relevant authorization needed and in our case we decided to attach the XMII_SystemInfoService action to the ProductionConfirmation role attached to the users in production.

 

The way to do this is thus :

 

  1. Navigate to the UME and search for the User/Role that you need to modify and click on the Modify button. (Note : you need to have UME administrator rights to modify users)
  2. Navigate to the Assigned Actions tab.

    ume1.jpg
  3. Search for the required action to assign. In our case we were not too sure of the name of the action so we used the filter *xmii*service* do display the required actions. (Note : Do not use a too generic filter, the Available Actions has a display limitation of 200 actions and if your search returns more than 200 results an error message is displayed at the top of the screen)

    ume2.jpg

  4. Select the required action (XMII_SystemInfoService in our case) click on Add and then save the user/role.

    ume3.jpg
  5. Ask the relevant user to logout and login again and voila !!!

 

 

 

Footnote

 

There is a comprehensive list of SAP MII Actions in the help document as well : http://help.sap.com/saphelp_mii122sp03/helpdata/en/4c/9768bdc14d60c3e10000000a15822d/frameset.htm


Debugging MII Transaction

$
0
0

Debugging MII Transaction

 

Applies to- 12.2.3 Build (177)

 

Summary

This document showcases the new feature of Debugging MII Transaction in MII v12.2                              

The document takes us step by step showing how to use breakpoint action and how to debug the MII transaction. It will be helpful for the developer to get more insight and debug the transaction for run time values at different logical points.

 

Author: Ruchir Batra

Created On: 31 May 2012

 

Table of Content

Initial Set Up /Introduction to Example Set Up

Configuring the Query

Configuring the Conditional Action Block

Configuring the Assignment Action Block

Complete Flow Diagram

Testing the Scenario

Conclusion/ Key Take Away

 

 

 

 

 

 

 

 

 

 

Initial Set Up /Introduction to Example Set Up

 

Open up the Work Bench found under Content Development from MII Main Menu.

Create a new transaction in the Work Bench (Catalog Tab). And create a local variable named value and giving it an initial value of 1. Its value will help us determining the process flow through the transaction.

 

pic1.png

 

In our example depicted below, we will be trying to fetch a value from query and then based on logical condition set in Conditional Action Block; we will trace the execution flow in the transaction.

During the same, we will assign the Create Breakpoint Action and see how it works for our scenario.

 

Configuring the Query

 

Under the Data Query Header on left below, one can find – SQL Query Block.

In Configuration Object Part- one can browse and assign the query.

In Configuration Link- We can assign any input for the query (if required). In our scenario- we will not be linking any input for the query.

pic2.png

We have named this block as Fetch_Value and upon configuration->We clicked Load and then browse through the query location path to attach the same.

 

Configuring the Conditional Action Block

 

We can configure the Conditional Action Block – found under Logic Header Tab on left side under Action as Main Header. We can assign any conditional value as an input and on execution it will check against the same condition which we have set.

 

 

Configuring the Assignment Action Block

 

The Assignment Action Block is used to assign any value. We can click Config Link to open Link Editor and then we can assign any value to any variable using it.

 

 

 

 

 

 

 

Complete Flow Diagram

 

pic3.png

  REF 1

 

The above REF Diagram showcases the complete process flow in the transaction.

 

 

 

Testing the Scenario

 

We have set up a scenario where in the first action block – SQL Query Block will fetch us the desired value from query and will test this value against the arbitrary value set in Conditional Action Block.

Then, based on condition being true or false in the Conditional Action Block, execution will pass to one of Assignment Block set to assign the value to the local Variable (Created in the beginning).

 

We will assign the Break Point at Conditional Block so that we can halt the execution and manually check how the output behaves (run time, debug mode) based on different conditional input set up in Conditional Action Block.

    pic4.png

REF2 (Meant to showcase how to set a Breakpoint; Right click on action block and you will see the options as above)

pic5.png

REF3 (Refers to the debug mode execution of transaction)

 

 

 

On execution- we found:

 

If we run our transaction-

 

The First Action Block executes successfully and fetch us the result as desired.

Then the execution comes and halts for user action at Conditional Block since we have set up a Breakpoint against it. We can set up Breakpoint with its property like –Always, Based on Condition (If true), disabled (Never for particular action block) and so on.

 

In our case- we have set up the Breakpoint against Conditional Block with property as Always.

 

We can double click the Conditional Block to open the Property Window as seen in snapshot above. Then we clicked the Config Link Part and check the condition set. We can click evaluate to find its value at run time (i.e. now, during the execution run). Similarly, we can change the condition and update/evaluate to find the new output from the conditional block.

 

 

Hence- This way we can manipulate and check different conditional statement against the output received from our query and see how the output behaves in case of different conditions set.

 

 

All this happens while in debug mode- and once execution passes ahead, the developer can be sure of the process flow the execution should take.

 

This way – we can set up Breakpoint within the MII Transaction and debug the transaction at run time.

 

Similar to Create Breakpoint, we can also remove the Breakpoint in the very same fashion.

 

Each color seen during the debug mode conveys a particular meaning, such as orange stating the action run and exception thrown. And Green tracing us the path – the execution has taken place. And so on.

 

Along with it- we also have numerous options to trace the values as seen in REF 3 lower part (last line) which can help us trace the exact query, parameters it took, different variable values which happen at run time.

 

This is how the process flow takes place and debugging feature works in run time mode within a MII Transaction.

 

 

 

 

Conclusion/ Key Take Away

 

 

The above scenario showcase us how to use the debugging feature introduced in MII v12.2 and how developer can debug and take variable control at run time in order to have real time feedback on state on each action within the transaction.

 

-          Break Point Action (Debugging Feature) works only for transaction which are saved

-          It doesn’t work for secondary transaction. (ie – which are called from another transaction)

-          One cannot export a transaction with Break Point

-          Break Point are user specific

Demonstrating the use of Catch Throw Action Blocks

$
0
0

Demonstrating the use of Catch Throw Action Blocks

 

Applies to- 12.2.3 Build (177)

 

Summary

 

This document explores the exceptional handing feature of SAP MII using catch throw action blocks introduced in MII 12.2. The document takes us step by step showing how to use the catch throw action block and how to handle the exceptions generating during runtime in MII transactions.

 

Author: Ruchir Batra

Created On: 25 May 2012

 

Table of Content

 

Initial Set Up /Introduction to Example Set Up

Configuring the Tracer

Configuring the SAP JCo Start Session

Configuring the Catch /Throw Action Block

Complete Flow Diagram

Testing the Positive Scenario

Testing the Negative Scenario

Conclusion

 

 

 

 

 

 

 

Initial Set Up /Introduction to Example Set Up

 

Open up the Work Bench found under Content Development from MII Main Menu.

Create a new transaction in the Work Bench (Catalog Tab). And create a local variable named value and giving it an initial value of 1. Its value will help us determining the process flow through the transaction.

 

pic1.gif

 

In our example depicted below, we will be trying to set up a connection between MII and ECC.

We will go through the positive scenario where in successful connection will be established and also the negative scenario where in un-successful connection is established and hence the exception being caught at run time.

 

Configuring the Tracer

 

Under the Logging Header on left below, one can find – Tracer block. In Configuration Link- one can link any value to its message text tag (as below).

We are linking the local variable which we created above to Tracer Message tag.

 

pic2.gif

Configuring the SAP JCo Start Session

 

We can configure the SAP JCo Start Session giving in details like SAP Server/Client along with Login Credential ie UserId/Password through which it will be able to connect to SAP ECC.

 

Configuring the Catch /Throw Action Block

 

The Catch Action Block is set up after the SAP JCo Start Session since we will try to raise the exception through it and can see the exception being caught in Catch Action Block.                                             Similarly, we have Throw Action Block- which is used to throw any message throughout the transaction. It is used to put the transaction into exception state, which is later handled by end of transaction or catch block in transaction (following after the Throw Action Block).

 

 

 

 

 

 

 

 

Complete Flow Diagram

 

pic3.png

Above Part- REF1

Lower Part - REF 2

The above two REF Diagram showcase the complete process flow in the transaction.

 

Testing the Positive Scenario

 

We tested a positive scenario by setting up a SAP JCo Start Session with correct credentials and correct SAP System details.

 

On execution- we found:

 

Tracer_InitialValue and Tracer_Value represent the value 1 and then since no exception is generated via JCo Session, the execution flow doesn’t pass through the Catch_0 action block and hence it doesn’t reach the tracer Tracer_Catch_Value (extreme left below, REF2).

The Throw action block throws an exception which is caught via Sequence 7, Catch_1 and is traced via tracer in subsequent block.

This is how the process flow takes place and catch/throw action block works for a positive test scenario.

 

Testing the Negative Scenario

 

We set up an invalid system details in JCo Start Session so that it fails to connect the system.

 

On execution – we found:

 

Tracer_InitialValue and Tracer_Value represent the value 1 and then since an exception is generated via SAP JCo Start Session, it got caught in Catch Action Block and process flow enters the Sequence 4, REF 2 (left below) and Tracer_Catch_Value records the exception message generated by the JCo block. We have mapped Tracer_Catch_Value to Last Error Message of JCo Action block; hence the message can be viewed in the tracer (Tracer_Catch_Value).

The process flow via Sequence 5 for Throw Action block remains the same as of positive test scenario. Since this portion is set up to generate an exception and later catch it. Only thing to note is: The Catch Action Block- ie Sequence 7 is must, if we are setting up a Throw exception logically in our transactional logic.

This demonstrates the use of Catch / Throw Action Block and its use in case of exception generation.

 

Conclusion

 

The above two scenario showcase us the use of catch and throw action block and how we can use them in exception handling within MII transactions. They are very useful for runtime exception handling and I believe should be taken as best practice for MII projects.

Showcase New Feature MII v 12.2 - Value Mapping

$
0
0

Showcase New Feature MII v 12.2 - Value Mapping

 

Applies to- 12.2.3 Build (177)

 

Summary

 

This document showcases the new feature of Value Mapping in MII v12.2

The document takes us step by step showing how to use Value Map and Value Look Up Action Block Introduced recently.

 

Author: Ruchir Batra

Created On: 03 June 2012

 

Table of Content

 

Introduction to Value Mapping

Introduction to Example Set Up

Configuring the Value Map Action Block

Complete Process Flow

Conclusion

 

 

 

 

 

 

Introduction to Value Mapping

 

This feature helps us in translation of values between two systems. It allows data value read from one system to be replaced in another system with a replacement rule configured for the same.

For this, ValueMap.vmap class file was introduced in Meta-Inf tab under the Workbench. And XML Function Category in the transaction (in Workbench) added two new action blocks named Value Map and Value Lookup Action Block.

 

Why it came up?

Many a times, we have seen that data value coming from ECC is required in different fashion in another system. A lot of time, it’s a leading zero’s issue which we address while reading data from SAP ECC to another system. To tackle such problem, this new feature was introduced named “Value Mapping”.

 

 

 

Introduction to Example Set Up

 

To solve this issue, we set up (config) a rule under Meta Inf Tab. The Rule defines multiple source objects in form of xml or xsd. The source object consists of source location and source xpath (defining field to be updated).

The source object contains mapping object, which in turn has source value, target value and mapping type associated to it.

 

To Start:-

Click NEW on Value Map and you will see a screen comprising of REF1 and REF2 as below.

 

Rule Details-

Enter a Rule Name/Description: You want to define

 

Source Details –

 

Source Document:

Create a sample xml which will be similar to one you will be getting as an input. In our example- I created a sample input xml similar to Production Order Get List BAPI from ECC.

 

Source:

Define the xpath for which you want the data values to be transformed (between the systems). In our example- I have tagged it to Work Center I get through the BAPI in my example.

 

Click on Add Source and this will update the source information as in REF 1 below.

 

pic1.png

 

REF 1

 

After adding the source details- We define the Rule for the transformation below in the next section as per the snapshot REF2 below.

We have three match types to define. Equal, Contains, Regex.

 

In Source Value- we define the source value expected. Target Value defines the transformed value to be taken up against the source value.

 

Example- In our example, source value of G01L will be converted to G Value as an output after the value map action block is executed.(Match Type= Equal)

 

pic2.png

 

REF 2

< I have divided the Rule Creation Screen in two snapshots- REF 1 and REF 2 >

 

Configuring the Value Map Action Block

 

Config Part-

Assign a Project, Rule to it. There after you will see the source document and source location as per the rule already set up in Meta Inf tab.

You will also see mapping details as per configuration done. 

pic3.png

 

Link-

Provide an xml input to the Value Map Action Block.

 

Complete Process Flow

 

In our example, we pull data from ECC via PI Service (Production Order Get List Data from ECC). We pass output of PI Service to Value Map Action Block. It contains the data such as Work Center like G01, G01L, G02.. an arbitrary data.

 

In our Value Map, we mapped rule to translate G01L... value to G Value. And so on.

Hence in the tracer below- if we see the output from Value Map Action Block, we will see the Work Center value as G Value against G01L and J Value against J01L(From ECC)… and so on.

 

pic4.png

 

Conclusion

 

The above scenario showcase us how to use the Value Map Action Block. It helps us in transforming the value from one system to another and at same time- avoiding the logic to be implemented by the developer.

In the very same fashion- we can use Value Look up Action Block also. We provide input as Type defined data type value for which we receive output as key value pair. (In our example, we get output as {J01LLL=null, J01L=J Value, G01L=G Value} where in – J01LLL doesn’t have any rule mapping set, while J01L/G01L get transformed.)

The Power Behind SAP MII

Demonstrating the use of New Feature of MII 12.2 – Where Used (Usage)

$
0
0

Demonstrating the use of New Feature of MII 12.2 – Where Used (Usage)

 

Applies to- 12.2.3 Build (177)

 

Summary

 

This document explores the new feature added in MII 12.2 – Where Used. Using this feature, user can easily identify where all is the catalog content object is being utilized in the project. Even if the object is being used in another project, the user can identify the same.

 

Author: Ruchir Batra

 

Created On: 24 June 2012

 

Table of Content

 

Initial Set Up /Introduction to Example Set Up

Testing the Scenario

Conclusion

 

 

Initial Set Up /Introduction to Example Set Up

Open up the Work Bench found under Content Development from MII Main Menu.

Create a new query/transaction in the Work Bench (Catalog Tab)

1.    Create a query and name it- testQry

pic1.png

 

2.    Create a transaction and name it – testTransaction

 

       pic2.png

 

This transaction is calling a query which we created above in step 1(testQry)

 

Testing the Scenario

 

Select the query (created above) and right click. You will see an option of Usage. On clicking it- the details of where all is the query is being used will be reported to the user.

 

 

pic3.png

 

 

Final Report:

 

The below snapshot shows report demonstrating, where all query is being used.

As seen- The testTransaction gets listed under the usage content for the query as we have used the query in our transaction.

(Exact path hidden for security purpose)

 

pic4.png

 

Conclusion

 

The above scenario showcase us the use of Where Used, Usage feature of MII 12.2. It helps user to understand the impact a change in particular object will have on other content objects. This feature applies only to catalog content and not to web content part.

Demonstrating the use of New Feature of MII 12.2 – Dynamic Transaction Call

$
0
0

Demonstrating the use of New Feature of MII 12.2 – Dynamic Transaction Call


Applies to
- 12.2 and Higher version of MII

Summery - The document demonstrate the use of Dynamic Transaction calls in MII 12.2.
The feature adds the object oriented concepts in MII. Even the common piece of object being used in another project can be used.

Author:  Shashank Shrimal

Created On: August 08, 2012.

Table of Content:

Initial Set up
Steps to be followed
Testing the scenario
Conclusion

Initial set up: Having two transactions named “TransactionToBeCalled” and “TrxToBeCalled”   created under the catalog tab.  These two transactions will be called dynamically based on some conditions.

Steps to be followed:

  1. Go to MII workbench and create a new transaction.


         

  2. Go to action Tab and Select”Dynamic Transaction Call” Action Block from Logic.

 

 


3.  Define a new Transaction variable or a local Variable (Depend on the condition and requirement).  In       this example I defined a transaction variable “Country” and assign (Hardcode) it a value “US”.

 

                                     
                                   

 

4.  Double Click the “Dynamic Transaction Call” action Block and Go to Configure link.



                                             

5.  Pass the transaction name you want to call. This transaction name can be called conditionally using Stringif.
In this example I am going to call two transactions defined in Initial Set up TransactionToBeCalled and TrxToBeCalled.  Calling the transaction on the basis of Country name i.e if the country is US call“TransactionToBeCalled” else call“TrxToBeCalled”.

Note: while calling the transaction name we need to give the full path of the transaction.

 

                                            

 

 

6.   Update the mapping and close the window.

 


Testing the scenario:  Insert a new “tracer” action block to trace the output of “Dynamic Transaction call” actionBlock. 

 

                                               

 


                

                             

Map the output of “Dynamic_Transaction_calll_0” with the Message of Tracer.
As the Output is not available in the list of available parameters, add the output parameters.

Make a note that this is case Sensitive (Output).

                      



Final Output in tracer:



                      

 

 

Conclusion: The above scenario showcase us the use of Dynamic transaction call. Introduction of Dynamic transaction helps to avoid writing the same code again and again. Thus supports the concept of reusability.

SAP MII - Integration Methods

$
0
0

Hi All..

 

I would like to share the integration methods which SAP MII expose off -

They help in integrating SAP MII to SAP Enterprise, Plant.. other servers as well..

 

It uses data connectors to connect to the database side..

In order to connect to SAP ECC- It has idocs, rfc exposure via Jco, JRA Action Block..  which are primarily used.

 

Apart, we also have web service exposed - through which we can connect almost any system which accepts/respond web services. They are also of 2 types- synchronous and async one (used, depending upon scenario)

 

One more being, PI block- which mainly helps to connect to PI Server.

 

Another method- which is commonly used is .. Message Listener, Scheduled Jobs.

 

On a whole, I believe these are entire set of methods which are exposed via MII for integration puposes. And each one has its own importance and usage.


3 No-Brainer Reasons to Integrate Your Manufacturing Operations Systems

$
0
0

Integrated operational systems are the first step toward real, and often surprising, progress in a manufacturing organization.

 

manufacturing system integration sap mii.jpg

 

Change for the sake of change always ruffles peoples' feathers. As Robert Kennedy said, "Progress is a nice word. But change is its motivator. And change has its enemies." As businesses strive for progress, change is inevitable. (Disclaimer: I'm no politician.)

 

I found myself in Cleveland, Ohio earlier this month. I was participating in one of SAP's semi-annual Customer Value Network events for manufacturing and sustainability lines of business. Simply put, "change" leapt out as the major theme of the convention. Real, attainable, positive business change. Each customer presentation shared a number of positive changes experienced as a result of manufacturing system integration, made possible by SAP Manufacturing Integration and Intelligence (SAP MII).

 

I noticed several common themes around integration that kept appearing in each presentation. I jotted down a short list of these "no-brainer reasons" for others to enjoy as well:

 

1. Achieve operational synergy

 

I have to admit - I'm loath to use the word "synergy". On the scorecard of Business Buzzword Bingo, "synergy" would be the free space. However... it aptly describes the reduction of extraneous effort. With one single system of record, you aren't juggling four different programs to process one task. Your efforts aren't a duplication of your colleague's efforts, because your whole team is able to work from the same real-time data.

 

Information is visible, accurate, and easily accessible. Miscommunication becomes an obstacle of the past.

 

 

2. Measure performance with real-time analytics

 

Most people recognize that goal-setting is a great way to achieve success. But a goal doesn't work like a rotisserie oven - you can't just "Set it and forget it!". Reaching a goal takes continued performance measurement, analysis, and readjustment until you reach your desired result.

 

Now in manufacturing, collecting data is one thing. But data is mindless - information, on the other hand, is actionable. SAP MII enables businesses to transform their overwhelming quantities of mindless data into actionable intelligence, no matter the source.

 

This means seeing real-time KPIs streaming in from multiple sources along a live production line... and analyzing those metrics against past, or even predicted future performance. This also means the ability to cross-reference and combine that data with data from your top floor ERP system for a completely transparent view of your business.

 

MII empowers customers to improve their manufacturing operations by integrating and understanding the data behind it.

analytics mfg 2.jpg

 

3. Establish your competitive advantage

 

Possibly the most buzzed-about theme I encountered in Cleveland was MII's ability to enable new competitive advantages for our customers. In some cases, this meant improving manufacturing margins (and total profits!) in times of lower total sales. In other cases, this meant enabling entry to newer, more profitable markets.

 

No matter your industry, maintaining competitive advantage is a crucial aspect of your business. Do you want to achieve the "perfect plant"? Maybe you want to be a leading innovator in your industry. Or, are you chasing your competition instead? Are you interested in introducing a more mobile platform for your daily operations? SAP MII is a driver of these changes.

 

 

I'll sum up what I learned with this: change isn't always easy, but progress makes it worthwhile. And the business progress I saw throughout my two days in Cleveland was nothing short of impressive.

 

What no-brainer reasons would you add to this list?

 

  

For more information about SAP MII, check out the MII Wiki on SDN. Feel free to follow me on Twitter @RJordanGray ... it's also a no-brainer!

Sending IDoc acknowledgement from SAP MII to SAP ECC

$
0
0

Introduction:

 

In any SAP ECC and MII integration project one of the most common requirement is to send idoc from SAP ECC to MII. Different categories of data like production order, process order, material master or transfer order, can be sent to SAP MII system via an idoc.

Generally idoc received from SAP ECC system is admitted by sending an acknowledgement.

 

Using ALE audit, Idoc acknowledgement is sent to the sender system to monitor the status of an Idoc in the same system

 

Fig1.JPG

           Fig:1

 

Middle systems like PI, has capability to send idoc in acknowledgement for idocs received from SAP ECC. For example, an ALEAUD01 idoc gets generated in PI system and is sent to ECC, whenever an idoc is received from SAP ECC. To achieve a better integrity, confirmations are dispatched periodically for a set of idoc, rather than for individual Idoc.

 

But MII as receiver of idoc has no capability to send idoc as acknowledgement. SAP MII receives Idoc through XMIIIdoc listeners and this process is asynchronous in nature. So for an asynchronous call an explicit response is required to confirm the message is successfully received by the receiver system. So as an alternative of sending acknowledgement through idoc, we can make use of an ECC function module and send the response.

 

As in MII we only can send data back to SAP ECC using RFC, to send the Idoc acknowledgement to SAP ECC from SAP MII we need one RFC.

 

Process Design:

 

In my current project, one of the primary requirements was to send idoc acknowledgement and set idoc status code (means application document created in target system) to 41 in SAP ECC.

 

We had mainly two options to implement this feature:

  1. Using the standard RFC called IDOC_Asynchronous_Inbound which accepts multiple Idoc details but does not change the Idoc status.
  2. Using standard ECC program RC1_Idoc_SET_STATUS which accepts multiple Idoc details and converts the Idoc status from one to another as well. But this program is not remote enabled and MII can’t use this program to do the needful.

As we were trying to achieve this functionality with least effort putting into it, we had to select the second option. In the second option RC1_Idoc_SET_STATUS program needs to be remote enabled with its input parameters and it should return message for each of the Idoc from the input list.

In our project we receive almost four types of idoc from ECC and each of them has different processing rules in MII. Irrespective of four different idoc types our primary goal was to develop a single set of program using which acknowledgements can be sent for all four Idoc types with different processing rules and also if required for additional MII idoc listeners for additional ECC clients.

 

Now let’s take a look into our proposed design for sending idoc acknowledgement to SAP ECC from SAP MII:     Fig2.JPG

       Fig:2 Process Flow

Solution Walk Through:

 

As mentioned above, we are receiving four different type of idoc from SAP ECC which includes LOIPRO, ZLOIPRO, MATMAS and CLFMAS through a single MII idoc listener called “XMIIIdoc01”. Among all these four idoc types two (MATMAS, CLFMAS) are processed by transactional processing rule and rest of them by categorized processing rule.

Also in future there is a possibility to receive more idoc types like WMTORD and WMCATO from single or multiple ECC systems.

 

For this development we used:

  1. One MII scheduler
  2. Four MII shared memory properties
  3. One MII MDO persistent object
  4. One MII MDO insert query
  5. One MII BLS transaction to read categorized idoc data
  6. One MII BLS transaction to call the RFC and send idoc acknowledgement to ECC
  7. One MII MDO update query.
  8. One MII MDO delete query.

1. MII Scheduler: We need one MII scheduler to trigger the MII transaction in the background when any Idoc comes to MII system. As per the requirement this scheduler is scheduled to run at every one minutes.

2. MII shared memory properties:  We have four shared memory properties to control the process of sending Idoc acknowledgement to ECC. They are as      follows:                                                         

    • List of MII idoc listener (type - List): This is to maintain all configured MII idoc listeners and named as ConfiguredXMIIIdocListeners.
    • List of idoc message types (type - List): This is to maintain the all the idoc types for which categorical processing rule has been defined. In our case these are like LOIPRO, ZLOIPRO and it’s named as IdocMessageType.
    • Batch count (type - Integer): This batch count is to decide the number of idoc to be processed at a time. This may vary based on project scenario.
    • Last Execution Time (type – TimeStamp): This is to capture the last successful execution time of the scheduler. So that in case of any error while executing the scheduler; no Idoc acknowledgement is missed from being sent to ECC.

    3. MDO persistent object: To store each Idoc number with message type, timestamp (last modified time for each entry), old Idoc status (status from the Idoc itself), final   Idoc status (returned by ECC in the RFC response message) and a flag to indicate Idoc update status (N= Not updated, R= Running and Y= successfully updated).

    4. MDO insert query: To insert the Idoc details in the MDO and this query is used inside logical transactions.

    5. BLS to read categorized idoc data: This transaction first loops through all MII idoc listeners maintained in the ConfiguredXMIIIdocListeners shared memory property.      For each of the idoc listeners it loops through all message types found in IdocMessaeType shared memory property. Based on the Idoc listener and it’s message type it      queries all “categorized”,” received”,” running” and “failed” messages from the message service.

        Fig3.JPG                                                                                                       Fig: 3

     

    On receiving the Idoc details, inserts the details into the above mentioned MDO persistent object.

         Fig4.JPG

    Fig 4: Idoc details in MDO


    6. BLS to send idoc acknowledgement data to ECC: Inside this BLS we will make a call to the RFC to send the idoc acknowledgment data back to ECC. We are using here      the remote enabled SAP standard RFC called RC1_Idoc_SET_STATUS. This RFC has following parameters :

      • P_Idoc = Idoc Number
      • P_MESTYP = Message Type
      • P_STANEU = New Status
      • P_STATUS = Status

      The RFC can handle multiple idoc data at a time. So from MII we will the sends a list of Idoc number, message type and new status in the RFC input. This program from ECC side provides the latest Idoc status and then the RFC gets executed to change the Idoc status to 41.

       

      Fig5.JPG

      Fig: 5 RC1_Idoc_SET_STATUS in ECC

       

      7. MDO update query: This MDO update query updates the status of the idoc in MDO and logs the response message from SAP ECC.

       

      8. MDO delete query: We have different batch jobs to delete all transactional related data for production and transfer order. So when these batch jobs get executed , it will also call this delete query to delete the Idoc entry for which MII has successfully changed the Idoc status to 41 in ECC.

      Fig6.JPG                                                                                                 Fig: 6

       

      Error Handling:

                  As sending acknowledgement to SAP ECC is a background process and there is no user interface to monitor the status of the Idoc, we had to define different ways to handle different type of error scenarios.

      For network / connection issue and technical issues like “Netweaver database connection broken” , “Catalog service error” etc we have one persistent call or a mechanism to keep retrying the message sending process to the target system until MII finds the target system up and running or resolves the technical issue.

      On the other hand, if there is any data issue, in that case RFC returns the error code and message for each of failed Idocs in each batch.

      Based on the RFC response MII updates the “Idoc status update” flag to “N” (Not updated) in the MDO using the Idoc number and the message type.

      So that next batch job can pick this failed one again to send the acknowledgment again to ECC.

       

        So far we have seen how we can send idoc acknowledgement from MII system. For additional message types, we can easily add in the shared memory list without any change in the code.

      Unzip data using Custom Actions in SAP MII

      $
      0
      0

      The following document will guide you, how to install and use the Unzip Data Action Block in order to decompress or unzip compressed data.

      Thanks to Anushree Singh for bringing up the idea for Custom Action block Unzip Data and supporting me for implementation.

       

      Business Scenario for Using Unzip Data Action Block:-

       

      When integrating various systems in a manufacturing environment a need can arise where MII receives compressed data from external systems. Compressed data need to be unzipped and then it can be subsequently used within various transactions of MII. As a result the need for the Unzip functionality to eliminate integration issues and thereby simplifying the process.

       

       

      Parameter Definitions:-


      Input Fields:-

       

      Source File to Unzip:- Give the path of the file that needs to be unzipped (make sure the path is on the system where the server is installed e.g. C:/myFolder/test.zip). It supports the winRAR ZIP archive format.

       

      Unzipped File:- Path where the content will be unzipped of the source file (make sure the path is on the system where the server is installed e.g. C:/myFolder/test)

       

      InputField.jpg

       

      Output Fields:-


      Success
      :This Boolean flag is set to true if the unzip operation was successful.


      Uploading and Deploying the Custom Actions:-

      The deployment of custom actions is documented in the MII v12.1, 12.2 Help documentation which can be found online (http://help.sap.com-> Select SAP Business Suite -> SAP Manufacturing -> Manufacturing Integration & Intelligence).


      The specifics for installing these actions are simply to navigate to the following in MII:

       

      For MII 12.1 -

      System Management -> Custom Actions -> Select Upload Button

       

      CustomAction12_1.jpg

      Upload12_1.jpg

      1. Press the 'Browse' button for the Assembly File upload only and select the path for the CustomAction.jar only.

      2. Press the Save button

      3. Press the Deploy Button

       

      For MII 12.2 -

      System Resources -> Custom Actions -> Select Upload Button

       

      CustomActions12_2.jpg

      Upload12_2.jpg

       

      1. Press the 'Browse' button for the File upload and select the path for the CustomAction.jar.

      2. Press the 'OK' button.

      3. Press the 'Deploy All' button.

       

      Your action now appears in the MII Workbench the next time you open up the logic editor under the “Custom Action” category.

       

       

      Using the Unzip Data Action:-


      This section will demonstrate how the Unzip action works and will demonstrate how to build a sample transaction around the action:-

       

      1. Build a sample Transaction using the Unzip Action and simply mapping the output field 'Success' to confirm the unzipping of files has been done successfully.

       

      SampleTransaction.jpg

       

      2. Configuring the Path for unzipping the files:-

      InputField.jpg

      3. Finally executing the transaction for unzipping:-

       

      FinalExecution.jpg

       

      JAR Download:-

       

      Download the CustomAction.jar file from https://cw.sdn.sap.com/cw/docs/DOC-152051


      Illuminator Services of SAP MII

      $
      0
      0

      Recently I was working in some scenario where I need to fetch data from MII internal table. For that I can't use the common action blocks provided in MII workbench for all the cases. So I had to think any other way around to fetch the data. After going through the SCN and discussing with the experts I got a great solution for that. I used MII illuminator services to fetch the data from the MII internal table. What I realize after using illuminator service,

      • Only way to fetch data from MII internal Table
      • Performance wise one of the best way to use that in the code
      • Easy to use directly from the IRPT or from JS

        While I have developed the solution for the scenario I have used various types of illuminator services which I have collected from the SCN and from SAP help Document but I fill that it will be very helpful to all if we get it in a consolidated form in a single doc. So that is the reason I am writing this blog to consolidate all of them. 

       

      Background of MII services:

       

      MII Services or illuminator services are basically a set of HTTP services that provide some core functionality of SAP MII. We can call these services externally by XML message exchange.

      Each illuminator services have a service name and one or more modes which are kind of operations of the service. At the time of execution, we must have to specify both the service name and mode with the input parameter if any. The services can e called programmatically or from the web pages by using AJAX or from BLS.

       

      The pattern of the URL is:

       

      http://<server>:<port>/XMII/Illuminator?service=<service name>&mode=<mode name>&content-type=text/xml

       

       

      Services:

       

      Below is the list of services which are available in MII 12.0 and later.

       

      • Admin
      • Scheduler
      • SystemInfo

      Below I mentioned few more services which are available in MII 12.1 and later

       

      • Indexing
      • Monitoring
      • BLSManager
      • Transport
      • DataServer

       

       

       

      MII Services:

       

      • Admin Services: We can use the admin services to retrieve the administrative and security information of the SAP MII server. There are various modes available for the admin service. You can check them by the following URL.

           http://<server>:<port>/XMII/Illuminator?service=admin&mode=modelist&content-type=text/xml


       

      Now I am discussing the various modes of admin service.

       

        • ContentList : Fetch the list of navigation links and their details.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=ContentList 

       

        • CurrentProfile : Fetch the user profile of the current user which includes name, full name, roles, email ID, and navigation items and links.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=CurrentProfile

       

        • DBInit : Re-initializes the delivered database content of the MII server. Anyone can use parameter type=All in the URL, which will reinitializes both the profile and the projects. Otherwise, it just updates the original projects delivered with the system. This is not recommended to use unless re-initialization is required.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=DBInit 

       

        • FullProfile : Fetch the full profile of the role or user specified in the parameter.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=FullProfile&Group=< user or role>

       

        • GetResource : fetch string resources based on the resources file name and the language. These are required for translating the screen labels to different languages. Valid Resource file name are UserStringResources, Messages, ErrorMessages and Applet.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=GetResource&language=<Language code>&FileName=<ResourceFileName>

       

        • AddResource : Add a language resource file to the server specified in the parameter.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=AddResource&language=<Language code>&FileName=<ResourceFileName>

       

        • Inspector : Fetch the list of the methods supported by the applet class specified in the parameter.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=Inspector&Name=<AppletClassName> 

       

        • PermissionList : Fetch the security services and their mapping to different role.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=PermissionList

       

        • ProfileEditor : Used to modify the profile of the user or role specified in the URL.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=ProfileEditor&Group=<user or role>&Payload=<XML data> 

       

        • RoleAttribList : Fetch the attributes of the role or user specified in the parameter.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=RoleAttribList&Group=<user or role>

       

        • RoleList : Fetch the list of roles available for the user or group.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=RoleList&Group=<user or role> 

       

        • RoleProfile : Fetch the profile details

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=RoleProfile&Group=<Group Name>

       

        • SessionList : Fetch the current logged in user with session details.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=SessionList

       

        • UserAttribList : Fetch the attributes of the current logged in user. Mask name is an additional parameter.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=UserAttribList&Mask=<Mask Name>

       

        • UserList : Fetch the list of the user available in the system.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=UserList&Group=<Role or Group Name> 

       

        • UserProfile : Fetch the profile details of the specified user.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=UserProfile&Group=<Group Name>

       

        • Who : Fetch the user name of the current logged in user.

                       http://<server>:<port>/XMII/Illuminator?service=admin&mode=Who 

       

       

       

       

       

       

      • Scheduler Services: We can use the scheduler to control it programmatically. There are various modes available for the Scheduler service. You can check them by the following URL.

           http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=modelist&content-type=text/xml

       

       

         Now I am discussing the various modes of Scheduler service.

        • Start : Start the SAP MII scheduler.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Start 

       

        • Run : Run a job at the current instance.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Run&ID=<job ID>

       

        • Stop : Stop the MII scheduler.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Stop 

       

        • List : Fetch the list of scheduled job

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=List

       

        • Import : Import schedule job details from an XML file that can be exported from another MII server.

                      http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Import&Payload=<XML data> 

       

        • Export : Export the details of a scheduled job in the scheduler in the XML format.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Export&ID=<job ID>

       

        • History : Fetch the run history of the specific job.

                      http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=History&ID=<job ID> 

       

        • Enable : Enables a scheduled job.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Enable&ID=<job ID>

       

        • Disable : Disables a scheduled job.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Disable&ID=<job ID> 

       

        • Delete : Deletes a schedule job.

                       http://<server>:<port>/XMII/Illuminator?service=scheduler&mode=Delete&ID=<job ID>

       

       

       

       

       

       

       

      • SystemInfo Services: We can use the SystemInfo services to get the system related information of SAP MII. There are various modes available for the SystemInfo service. You can check them by the following URL.

                http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=modelist&content-type=text/xml 

       

               Now I am discussing the various modes of SystemInfo service.

       

       

        • Configuration: Fetch the system properties of the SAP MII server configuration.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=Configuration

       

        • CurrentProfile: Fetch the profile of the current logged-in user including role and navigation.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=CurrentProfile 

       

        • HostInfo: Fetch the hostname and IP address of the current system.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=HostInfo

       

        • JavaRunFinalizer: You can run the finalization method of any object pending for finalization in the Java virtual machine of the server.

                      http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=JavaRunFinalizer 

       

        • JavaRunGC: You can run the Java garbage collector in the server. It will help to recycle the JVM to reuse the memory occupied by the unused objects.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=JavaRunGC

       

        • JavaRunTimeStatus: Fetch the current status of the JVM in the server. It includes memory status, number of processors etc.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=JavaRunTimeStatus 

       

        • JavaThreadStatus: Fetch the list of current runtime threads in the JVM of the server.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=JavaThreadStatus

       

        • RoleList: Fetch the list of roles available in the server.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=RoleList

       

        • SAPServerInfo: Fetch the info about a specific SAP server details.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=SAPServerInfo&Name=<SAPServerName>

       

        • ScheduleList: Fetch the list of the time period schedules configured.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ScheduleList 

       

        • ScheduleAttribList: Fetch the list of time period schedules configured in the system along with the time period.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ScheduleAttribList

       

        • ScheduleDetailsList: Fetch the details of time period schedules specified in the group.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=scheduleDetailsList&group=<ScheduleName> 

       

        • ServerList : Fetch the list of data server configured. You can fetch the server list based on the status by that service.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ServerList&Mask=<Enabled/disabled/All>

       

        • ServerAttribList: Fetch the list of data server details based on the group.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ServerAttribList&Group=<ServerName>&Mask=<Enabled/disabled/All>

       

        • ServerInfo: Fetch the list of data servers and their configuration details available in the system.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ServerInfo&Name=<ServerName>

       

        • ServiceList: Fetch the list of the service available in the system security.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=ServiceList 

       

        • Status: Fetch the status of the data server available in the system.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=Status

       

        • TimePeriodList: Fetch the list of the time period available in the system.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=TimePeriodList 

       

        • TimePeriodAttribList: Fetch the list of time period with the details.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=TimePeriodAttribList

       

        • UpTime: Fetch the info about the uptime of the server.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=UpTime 

       

        • UserList: Fetch the list of user available in the system.

                       http://<server>:<port>/XMII/Illuminator?service=SystemInfo&mode=UserList

       

       

       

       

       

       

      • Indexing Service: The indexing service includes method for examine what is indexed and monitor an indexer. The indexer rebuilds the index information. It will run through all files in the database and re-index them. This should only be used if somehow the indexes get out of sync.

      The index types are the list of different items which are indexed whenever a file is saved. When calling services the index type must be specified since object names are not guaranteed to be unique across index types.

       

      Index Type

      Description

      credential

      Credential aliases used in transactions

      connection

      Connection aliases used in transactions

      dataserver

      Data servers used in query templates

      File

      Transaction, template, and manufacturing data object uses

       

      There are various modes available for the Indexing service. You can check them by the following URL.

              http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=modelist&content-type=text/xml


                Now I am discussing the various modes of Indexing service.

       

       

        • Missing: We can use this service to retrieve an index object for which object doesn’t exist.

                http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=missing&type=<index type>&content-type=text/xml


        • Reindex: We can use this to delete the existing indexing and reindex them. For this, user needs SAP_XMII_Super_Administrator and SAP_XMII_Administrator roles.

                       http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=reindex&content-type=text/xml

       

        • Start: We can use this service to start the indexing if it not started already.

                       http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=start&content-type=text/xml


        • Status: We can use this service to check the status of the indexer and to check the list of the files indexed since the last start.

                       http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=status&content-type=text/xml


        • Usage: We can use this service to display the files for specific indexing type.

                       http://<server>:<port>/XMII/Illuminator?service=Indexing&mode=usage&type=<index type>&content-type=text/xml

       

       

       

       

       

       

       


       

      • Monitoring Service: We can use this service to retrieve the information for logins, file usage, server usage etc. We can determine load of the system, running transaction or query etc from that service.

      There are various modes available for the Monitoring service. You can check them by the following URL.

              http://<server>:<port>/XMII/Illuminator?service=Monitoring&mode=modelist&content-type=text/xml


                     Now I am discussing the various modes of Monitoring service.

       

       

       

        • Data Server: We can monitor the details stat as no of row returned, no of error etc for some duration.

                       http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=dataservers&content-type=text/xml&Duration=<hrs>

       

        • File Usage: We can monitor the usage of Query Templates and BLS from this service.

                       http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=fileusage&content-type=text/xml&Duration=<hrs> 

       

      If you need project specific usage of QT or BLS then you have to add Project Name with the URL.

       

      http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=FileUsageSummary&content-type=text/xml&Path=<ProjectName>&Duration=<hrs>


        • Message Server: We can monitor the usage of the message monitor from this service. We can check the no of messages received, processed, error etc.

                       http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=messages&content-type=text/xml&Duration=<hrs>


        • Login Count: We can monitor the count of the user login.

                       http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=logins&content-type=text/xml&Duration=<hrs>


      If you need the login count for specific user, you can use the following url.

       

      http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=loginssummary&content-type=text/xml&username=<username>&Duration=<hrs>


        • User Stat: We can monitor the no of request by the user and no of row returned.

                       http://<server>:<port>/XMII/Illuminator?service=Monitoring&Mode=UserQuery&content-type=text/xml&username=<username>&Duration=<hrs>

       

       

       

       

       


       

      • BLS Manager: We can use this service to retrieve the details information for BLS like running time of BLS, Highest run time, log, output, stats etc, and we can perform few activities like terminate transaction, delete transaction, clear transaction cache etc.

      There are various modes available for the BLS Manager. You can check them by the following URL.

      http://<server>:<port>/XMII/Illuminator?Service=BLSManager&Mode=ModeList&content-type=text/xml


                  Now I am discussing the various modes of BLS Manager.


        • Transaction List: We can use this service to determine the transaction in running stat and to determine the highest running one etc.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=List&content-type=text/xml


       

        • Transaction Stat: We can get the details stat for each transaction from this service.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=Stats&content-type=text/xml&id=<id>


       

        • Transaction Log: We can get the transaction log for particular transaction ID.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=viewlog&content-type=text/xml&id=<id> 


       

        • Transaction Output: We can get the transaction output for particular transaction ID.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=viewoutput&content-type=text/xml&id=<id>


       

        • View Transaction Cache: We can get the details transaction cache.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=viewcache&content-type=text/xml 


       

        • Clear Transaction Cache: We can clear the transaction cache by this service.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=clearcache&content-type=text/xml


       

        • Terminate Transaction: We can terminate any transaction in running state.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=terminate&content-type=text/xml&id=<id> 


       

        • Delete Transaction: We can delete any transaction by this service.

                       http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=Delete&content-type=text/xml&id=<id>

       

       

       

       

       

       


       

       

       

       

      • Transport: We can use this service to transport the configuration or project from one system to another system.

      There are various modes available for the transport. You can check them by the following URL

       

      http://<server>:<port>/XMII/Illuminator?service=Transport&Mode=ModeList&content-type=text/xml

       

      Now I am discussing the various modes of Transport service.

       

        • Export Configuration: We can fetch the configuration from one system. But we have to pass the encryption algorithm and the pass phrases.

                       http://<server>:<port>/XMII/Illuminator?service=Transport&Mode=ExportConfig&Algorithm=<encrypt-algorithm>&Passphrase=<password> 

       

        • Export Project: We can fetch the project from one system. But we have to pass the encryption algorithm and the pass phrases.

                       http://<server>:<port>/XMII/Illuminator?service=Transport&Mode=ExportProject&Algorithm=<encrypt-algorithm>&Passphrase=<password>

       

       

       

       

       

       

       

       

       


      • DataServer: Using this service you can do the basic functionalities of data server like enable., disable, delete, export and import of data server.

       

                Now I am discussing the various modes of Data Server service.

       

        • Import: By that service you can import data server from one system to other system. If the data server exists in the system then it will update the existing and if not present then it will add the new one.

                       http://<server>:<port>/XMII/Illuminator?service=Configuration&mode=DataServers&type=Import&payload=<xml>


       

        • Export: We can export the list of data server by this service.

                       http://<server>:<port>/XMII/Illuminator?service=Configuration&mode=DataServers&type=Export


       

        • Enable: Using this service you can enable any data server which is in disable state.

                       http://<server>:<port>/XMII/Illuminator?service=Configuration&mode=DataServers&type=Enable&Name=<name>


       

        • Disable: Using this service you can disable any data server which is in enable state.

                       http://<server>:<port>/XMII/Illuminator?service=Configuration&mode=DataServers&type=Disable&Name=<name>


       

        • Delete: Using this service you can delete any data server.

                       http://<server>:<port>/XMII/Illuminator?service=Configuration&mode=DataServers&type=Delete&Name=<name>

       

       

       

       

       

      I have collected and used most of the services in my project work and development of SAP MII. I have collected and consolidated them for my development and project work from SAP Help Documents, SCN community and from the book Implementing and configuring SAP MII from SAP Press written by Dipankar Saha and Abesh Bhattacharjee. I am not sure but may be I missed few MII services still so I am requesting you all if you know any other MII services Please feel free to add them in the blog and I will do the same also So that in future it will become a good repository of MII services which help everyone.

       

      Optimizing BLS performance of large XML process with XSLT

      $
      0
      0

      After having read the nice article from Saha Dipankar about performance problem with large XML process in BLS (see http://scn.sap.com/people/dipankar.saha3/blog/2011/05/03/optimizing-bls-performance-for-xml-handling-in-sap-mii ), I decided to go deeper as we were encountering almost the same scenario, and so I develop a new solution with XSLT process...

       

      First, our scenario... We have POD (production operator dashboard) on the floor, linked to SAP ME system through MII with BLS transactions exposed a web services. One of this web services was really struggling with performance on some machine and did almost cause the servers to crash...

       

      This web service was used to show all the BOM (build of materials) for all materials that are in the production line of the machine, with all revisions (or almost). This could mean a lot of data's (for example, 60 Boms and around 1000 items).

       

      Example of data retrieved :

       

      blog1.jpg

      The goal here is to group all Item by pair Bom, Bom_revision (so we had a key in first column to manage this in a easiest way).

       

      Structure of the output XML is :

      <?xml version="1.0" encoding="UTF-8"?>

      <data>

        <BOMList>

          <BOMData>

            <Bom>BOM-1</Bom>

            <Revision>A2</Revision>

            <Description>01.Alternative</Description>

            <Status>201</Status>

            <ValidFromDate>20120131</ValidFromDate>

            <CurrentRevision>true</CurrentRevision>

            <BomComponentList>

              <BomComponent>

                <Component>

                  <Item>Item-1</Item>

                  <Revision>WCAL</Revision>

                </Component>

                <Sequence>10</Sequence>

                <Quantity>0.62</Quantity>

              </BomComponent>

              <BomComponent>

                <Component>

                  <Item>Item-2</Item>

                  <Revision>1</Revision>

                </Component>

                <Sequence>20</Sequence>

                <Quantity>1.00</Quantity>

              </BomComponent>

              <BomComponent>

                <Component>

                  <Item>Item-3</Item>

                  <Revision>1</Revision>

                </Component>

                <Sequence>30</Sequence>

                <Quantity>1.00</Quantity>

              </BomComponent>

              <BomComponent>

                <Component>

                  <Item>Item-4</Item>

                  <Revision>1</Revision>

                </Component>

                <Sequence>40</Sequence>

                <Quantity>0.10</Quantity>

              </BomComponent>

              ....

            </BomComponentList>

          </BOMData>

        </BOMList>

      </data>

       

      When I applied the "classic" way to do it, using local XML template, looping into the query result with grouping by bom, revision, doing assignments, like the third scenario described in Saha's article, the performance could be very poor, sometimes more than one minute... Which is not acceptable for a shop floor system.

       

      So I did apply an XSLT action block... As I was not really a XSLT expert, it took me some time to design it. Especially due to the fact that MII (12.1.9 in our case) is not supporting XSLT 2.0 and the powerfull commande "for-each-group"... But after some trials and errors steps, I finally find a good way to achieve this (based on this article : http://www.jenitennison.com/xslt/grouping/muenchian.html )

       

      The result in term of performance was really great, dividing the process times by around 10 times less...

      Importance of Pool size Configuration of Data Server in SAP MII

      $
      0
      0

      Recently I have faced some issues in my project regarding pool size of the database. In my project we are using Oracle database to store all the tables and data as per requirement. But recently while we were trying to store data in the db tables then we got a very strange error.

      The error message is like that,

      com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException occurred in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.connector.exceptions.BaseResourceException: Cannot get connection for 0 seconds. Possible reasons: 1) Connections are cached within SystemThread(can be any server service or any code invoked within SystemThread in the SAP J2EE Engine) or they are allocated from a non transactional ConnectionFactory. In case of transactional ConnectionFactory used from Application Thread there is an automatic mechanism which detects unclosed connections, 2)The pool size of adapter "---------" is not enough according to the current load of the system . In case 1) the solution is to check for cached connections using the Connector Service list_conns command or in case 2), to increase the size of the pool.

       

      Day by day we were getting this message very frequently. Then we have contacted to DBA to discuss the issue. After discussion, they have increased the connection pool size in the database level. so the error got resolved for few days. But after some days it occurred again. In that way, DBA have increased the pool size 3 times, but still the error persist.

       

      At this point, after debugging and crosscheck, we found that we have missed a basic configuration, which is occurring the issue.

       

      Observation:

       

      • While user configures any MII system, they need to configure the "Data Servers" from "Data Service" tab in the MII Admin menu.

       

                scr1.jpg

       

       

      • For a particular data server, while user set the connection details, there user needs to configure few details. To solve this issue user needs to point few fields among them.

       

                scr2.jpg

          • Pool Max: Pool max is the parameter where user can set the maximum pool size which will be allowed by the DB server based on the db server pool size. User can put the same value as in DB connection pool size. By defining this, MII can open maximum this no of connection at a time.

                             Default value for Pool max is 100

          • Pool Size: Pool size is the parameter which indicate the no of connections MII can open at a time.

                             Default value for Pool size is 1

          • Wait Time: Wait time is the parameter, which defines the max wait time for a connection if the pool is full.

       

       

      Solution:

       

      In our system, the pool size was 1 by default. So it creates a bottleneck in MII. When ever our code executes it tries to create multiple connections to the DB, but MII passes them one by one. and if any one of the connection takes more than 30 min then rest of the connections which are in waiting state there get terminated.

      So we increase the pool max and the pool size to solve the issue. Only the point user need to remember while configuring,

       

      Pool size <= Pool Max (always)

      Making Engaging UI on SAP MII with SAPUI5

      $
      0
      0

      SAPUI5 is the HTML5 adoption by SAP which is becoming the de facto UI technology standard for all SAP applications. Some of the key features of SAP UI5 is that it can be rendered in any device with cutting-edge UI controls which is based on standards like HTML5, jQuery and CSS3 and fairly extensible. It also provides standard SAP and third-party system data access via ODATA, XML or JSON models.

      SAP MII being a visualization platform for manufacturing, which needs engaging user interfaces for the end-users which can be possibly accessed by different devices e.g. tablets/touch-screen terminals and smartphones, etc. Currently it uses HTML & Java Applet based user interfaces which is not compatible with many browsers or mobile devices. While working with SAPUI5 and learning the development technics it occurred to me why not use the same for MII user interfaces? Apart from the usual controls for tabular display, data entry and data view, a chart library called sap.viz has been added to SAPUI5 recently which provides different types of engaging charts for analytics, typically required by MII.

      Though SAPUI5 library is available in NetWeaver Java 7.31 SP05 onwards, it is not available out-of-the-box in earlier releases, on which MII 12.2 installation may be present. So the best way to use that till MII 12.2 release is to upload the SAPUI5 JavaScript library in MII workbench under a project in the workbench. Though standard SAPUI5 application is created using Eclipse plugin, it being a JavaScript library and the application created as web application, it can be created and managed in the Web folder in MII workbench as well.

      SAPUI5 follows the Model-View-Controller (MVC) design concept, which has a model object to access backend services, controller for the UI logic and view for the UI design. The models supported in SAPUI5 are JSON, XML, ODATA and Resource. Any of the first three models can be used for MII 14.0 as it supports both OData and JSON interfaces for Query Templates. For older release of MII XML model can be used to execute Query Templates and BLS as Illuminator service or Runner using HTTP.

      To start with SAPUI5 development in MII, three files need to be created in MII workbench representing the index.html file which acts as the view container, the appname.view.js file which specifies the view design and appname.controller.js which is the controller file and the model is defined there. The below diagram represents the concept of how MVC pattern is implemented in SAPUI5 in MII.

       

      UI5MVC.png

       

      The controller should instantiate the model using OData, JSON or XML interfaces from MII Query Templates or BLS. The below code shows one sample implementation of the controller which is using a MII Query Template as XML model.

       

      sap.ui.controller("kpidashboard.PlantView", {
      
      /**
      
      * Called when a controller is instantiated and its View controls (if available) are already created.
      
      * Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization. */
      
         onInit: function() {
      
      //start custom code for onInit
      
          //instantiate model object for specific type    var oModel = new sap.ui.model.xml.XMLModel();                       //set the data service for the model    oModel.loadData("/XMII/Illuminator?QueryTemplate=Default/Dipankar/SQL_GetMaterialQty&Content-Type=text/xml");    //add the model to the view    var view = this.getView();    view.setModel(oModel);
      
      //end custom code for onInit
      
      },
      
      /**
      
      * Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered
      
      * (NOT before the first rendering! onInit() is used for that one!).
      
      */
      
      //   onBeforeRendering: function() {
      
      //
      
      //   },
      
      /**
      
      * Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here.
      
      * This hook is the same one that SAPUI5 controls get after being rendered.
      
      //   onAfterRendering: function() {
      
      //
      
      //   },
      
      /**
      
      * Called when the Controller is destroyed. Use this one to free resources and finalize activities.
      
      //   onExit: function() {
      
      //
      
      //   }
      
      }); 
      

      The controller code follows the standard code template of SAPUI5 JavaScript controller (usually generated by Eclipse plugin for SAPUI5), which has to be implemented by any SAPUI5 controller when JavaScript view is used. Note that an application id is specified with the view name at the very first line of the controller code. This is the application id which is unique for the corresponding view and controller and specified in the view instantiation code in the index.html file. There are different event handler functions in the controller such as onInit, onAfterRendering, onExit as standard event handlers and custom ones can also be added. The model is instantiated in the onInit function which is the default event handler for the application initialization. The Query Template is accessed as XML model via Illuminator service and in similar way BLS can also be executed as Runner service or Illuminator service via Xacute Query. In MII 14.0 JSON or OData interface can also be used if required instead of XML model. The model is bound to the corresponding view so that it can be accessed from the view to bind it to the view elements. If multiple model is used in the controller it can be bound to the global UI context as below.

       

      sap.ui.getCore().setModel(oModel,"myModel");

       

      Next the view needs to be created following the standard template as below:

      sap.ui.jsview("kpidashboard.PlantView", {      getControllerName : function() {         return "kpidashboard.PlantView";      },      createContent : function(oController) {
      
      //start custom code for view design
      
      //array of UI controls
      var aControls = [];
      
      //access the model object
      var mModel = this.getModel();
      
      //create the dataset and bind to model path
      var dataset1 = new sap.viz.ui5.data.FlattenedDataset({ dimensions : [ {  axis : 1, name : 'Product', value : "{Material}“ } ], measures : [ { name : 'Quantity', value : '{PercQuantity}‘ } ], data : {path : "/Rowset/Row", factory : function() { }  } });
      
      // create the viz object
      var pie = new sap.viz.ui5.Pie({ width : "800px", height : "400px", plotArea : { 'colorPalette' : d3.scale.category20().range() }, title : {  visible : true, text : 'Share of Products‘ }, dataset : dataset1  });
      
      //set the model
      pie.setModel(mModel);
      
      //add the control to the array
      aControls.push(pie);
      
              return aControls;
      
      //end custom code for view design
      
            }
      
      }); 
      
      

       

      Note that the View code also starts with application name and the View name to specify the application the view belongs to. The view has a standard function named createContent, inside which the view design needs to be added. Here the model needs to be accessed and bound to the UI controls as required. Typically for most of the sap.viz controls a dataset object need to created and bound to the model which in turn needs to be bound to the visualization control. It is important to note that while referring to the XPath of the model XML in the dataset, the root element is not used. E.g. for MII XML which is always in the form of Rowsets/Rowset/Row but only Rowset/Row is specified here.

       

      Finally the index.html file needs to be created as below:

       

      <!DOCTYPE HTML><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"><script src="/XMII/CM/SAPUI5MII/resources/sap-ui-core.js"                      id="sap-ui-bootstrap“  type="text/javascript"                      data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.viz, ap.ui.ux3"                      data-sap-ui-theme="sap_goldreflection" ></script>       </head>       <body class="sapUiBody" role="application">      <div id='plantkpiDiv'></div><script>    //register the application    jQuery.sap.registerModulePath("kpidashboard", "/XMII/CM/SAPUI5MII/kpidashboard/webcontent");     //instantiate the view    var plantView = sap.ui.view({id:"idPlantView", viewName:"kpidashboard.PlantView", type:sap.ui.core.mvc.ViewType.JS});    //add the view to the div    plantView.placeAt("plantkpiDiv");      </script>        </body></html> 

       

      Note that the SAPUI5 library source is being referred here as the script library. As it is uploaded in MII workbench in a project it is being referred from there. In newer release of NetWeaver where SAPUI5 is already present it can be referred from the server path directly as "sapui5/resources/sap-ui-core.js". Next the individual UI5 libraries required for the application is specified in data-sap-ui-libs parameter. Depending on the UI controls to be used in the application only those libraries need to be specified.

      One of the most important part of the code in this file is registering the application id to its path. The below code does exactly so:

       

      jQuery.sap.registerModulePath("kpidashboard", "/XMII/CM/SAPUI5MII/kpidashboard/webcontent");

       

      Note that all the content for this application e.g. view, controllers, resources, etc needs to be saved in the specified path only. That is how when the view is instantiated in the next line by the application name and view name it automatically finds out the file path where it is available. The view is self-contained unit of a set of UI controls which is instantiated in the container and placed in a div. Similarly multiple views can also be added in a container file if required.

       

      The final output looks as below:

      pie.PNG

       

      There are lots of cutting-edge UI controls available in SAPUI5 as specified in the help documentation which can be leveraged to make really powerful and engaging user interfaces for SAP MII.


      Some key points to improve the performance of a transaction with large XML

      $
      0
      0

      After reading the earlier articles on performance improvement of transactions with large XML's , I realized that there are always more than one way of optimizing the transaction's performance.  It all boils down to the actual BLS logic that is implemented.

      Yes, XSLT is the most powerful/efficient way of transforming XML(s) . But what if there is a situation where XSLT(s) cannot be used. So here are some of the key points that may improve the performance of the transaction which I figured out during one of my performance tests..

       

      Logging : Remove unnecessary logging of XML. For example, you have a repeater and for every iteration you log the generated XML along with the BLS logic. This would create unwanted Java Objects. In cases like these where logging happens for large XML(s), the Java Objects too become huge. They not only consume a lot of memory but also effect the performance to a  great extent.

      However, if you really need logging, then write the final output to an XML file in the WEB folder. You could use Write File Action to do this. The write action consumes less times and performs better than the tracer.

       

      Looping : Repeaters are probably a better choice when looping through a large XML. For/while loops are good for a small amount of data. During my tests, I found that loops performed better than Repeater for row counts below 5000. After which Repeater improved and the difference was very encouraging. For 100,000 records, the loop took around 15 minutes to iterate and build a XML, while the repeater too a little over a minute to do the same.

       

      XML Actions: MII has standard XML Output Action blocks which give the result in <Rowsets><Rowset><Row> format. In case you are trying to build a simple XML with no complex nesting, then the Document and Row Action blocks can be used. They perform better than manually crafting the XML using the Assignment action block.

       

      Also, If you have a SQL Query in your transaction , ensure that you get only those columns which you need for your BLS logic. Doing a "select *" would return all the columns. More number of columns means more nodes in the XML to parse and hence greater time.

       

      Also, as Dipankar Saha mentioned inOptimizing BLS Performance for XML Handling in SAP MII , there are monitoring mechanism built inside SAP MII with which you can see the actual execution time for each action block in a transaction. To summarize, there are the two main URLs that are used.

      1. http://<server>:<port>/XMII/Runner?Transaction=<Project>/<Path>/<Name>&LogStatisticsToDB=true
      2. http://<server>:<port>/XMII/Illuminator?service=BLSManager&Mode=Stats&ID=<TRXID>,  where TRXID/transaction ID is got from the Transaction Manager Screen for the transaction under test.

       

      However, there is one point you have to consider while doing the above monitoring.

      Say for example You have two transactions A and B.

      A has only one action block and it calls B from that. What would happen is all the action counts in B would be doubled. Now, this does not mean that B   is getting executed twice.

      Its just that the application thinks that B is running in debug mode and starts logging more than normal. This takes up the count. The logging makes up for the increase in count.This would only happen when you have LogStatisticsToDB=true and you have a transaction call.


       

       

      Reference Documents:

      1. Optimizing BLS Performance for XML Handling in SAP MII

      2. Optimizing BLS performance of large XML process with XSLT

       

      These where my findings until now, there could be more ways to improve too. i would update this blog as and when I find something new.

      Using MAKit Charts in SAP MII for mobile/tablet use

      $
      0
      0

      MAKit Chart

       

      is a UI5 control that provides charting features. It has unique features such as Value Bubble and Range Selector that make chart report much more rich and interactive. It supports touch interaction on mobile devices such as:

      1.tap to highlight certain part of the chart.

      2.double tap.

      3.longpress.

      4.two finger pince to zoom in or out.

      5.one finger drag to move chart's Value Bubble highlight.

      6.two finger swipe to scroll the chart when zoomed in.

       

      Currently sap.makit.Chart supports the following types of charts:

       

      1.Column

      2.Horizontal Bar(Table Bar)

      3.Line

      4.Bubble

      5.Pie

      6.Donut

      7.Waterfall Column

      8.Waterfall Bar

      9.Stacked Column

      10.100% Stacked Column

       

      The Chart's Value Bubble provides an interactive way of showing details of the chart. It provides detailed information (i.e. the value) of the currently highlighted chart region. User can also hide/show certain series of the chart by toggling the legends on the Value Bubble.

       

      The Chart's Range Selector gives an overview look of the whole chart to user and also allows them to zoom in or out to a specific part of the chart for more clarity.

      MAKit BAR chart

      Quick Coding to get above


      Need to Use sap.makit Library

       

      var oChartj = new sap.makit.Chart({

       

          height: "80%",

       

          width: "100%",

       

          category : new sap.makit.Category({ column : "yearCategory" }),

       

          series : new sap.makit.Series({ column : "productSeries" }),

       

          values : [new sap.makit.Value({ expression : "revenueValue", format : "currency" })]

       

      });

       

      var testData = {

       

          mycollection : [

       

                { year : 2008, product : "Prod 1", revenue : 900000 },

              { year : 2008, product : "Prod 2", revenue : 700000 },

              { year : 2009, product : "Prod 1", revenue : 100000 },

              { year : 2009, product : "Prod 2", revenue : 900000 },

              { year : 2010, product : "Prod 1", revenue : 110000 },

              { year : 2010, product : "Prod 2", revenue : 120000 }

       

          ]

       

      };

       

      var jsonModel = new sap.ui.model.json.JSONModel();

       

      jsonModel.setData(testData);

       

      oChartj.addColumn(new sap.makit.Column({name:"yearCategory", value:"{year}"}));

       

      oChartj.addColumn(new sap.makit.Column({name:"productSeries", value:"{product}"}));

       

      oChartj.addColumn(new sap.makit.Column({name:"revenueValue", value:"{revenue}", type:"number"}));

       

      oChartj.setModel(jsonModel);

       

      oChartj.bindRows("/mycollection");

       

      Small Changes need for XML Model (typically used in SAP MII)

       

      var oModel = new sap.ui.model.xml.XMLModel();

      oModel.loadData("/XMII/Illuminator?QueryTemplate=........

      .......

      .......

      oChartj.setModel(oModel);

      oChartj.bindRows("/Rowset/Row");

       


      Quick Code Understanding in the way

       


       

      Thanks Dipankar Saha and Bibhas Das for inspiring me write this blog.Hope this will help everyone.

      Auto Loop Control for UI5 Carousel in SAP MII

      $
      0
      0

      As a SAP manufacturing visualization platform, SAP MII is growing day by day and nowadays SAP MII with SAPUI5 integration is becoming a major factor to offer rich user interfaces for the business end user. SAPUI5 is nothing but client side web UI library which includes lots of simple or complex UI controls. And among them “sap.ui.commons.Carousel" is one of the complex controls which can be use to show updated information for different purpose:-

      • Defect Status
      • Current Notification
      • Current Stock Status
      • KPI Trend
      • Replacement of iTicker  etc. These are the overview of few areas where Carousel can be much useful.


      You can find some useful examples and API of Carousel at the following link:

      Examples           :  https://sapui5.hana.ondemand.com/sdk/#test-resources/sap/ui/commons/Carousel.html

      API                   :  https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.commons.Carousel.html

       

      SAP provides very good standard method for Carousel UI. But, there is a functionality which is missing in “sap.ui.commons.Carousel” API. That is

      • Auto Loop: Auto rotation of the Carousel component.
        • Set Auto Timer Loop
          • Configurable option to show carousel next or previous component.
          • Configuration option to set timer for auto loop.
        • Start Auto Loop
        • Stop Auto Loop

       

      So, without wasting the valuable project time to find the alternative solution if you follow below solution which can save your time. In below example I have created a custom utility code "CarouselUtilities.js" for sap.ui.commons.Carousel which offer Auto-Loop functionality along with custom start-stop control and can be pluggable to any code whenever required.

       

       

      Project Structure :-

       

      Test.png

       

      index.html:-


       

      <!DOCTYPE HTML>

      <html>

      <head>

      <meta http-equiv="X-UA-Compatible" content="IE=edge">

      <meta http-equiv="Cache-Control" content="no-cache">

      <script src="/.../resources/sap-ui-core.js" id="sap-ui-bootstrap"

                  data-sap-ui-libs="sap.ui.commons, sap.ui.core"

                  data-sap-ui-theme="sap_platinum">

      </script>

      <script src="/.../Bibhas/UI5/WebContent/CarouselUtilities.js" type="text/javascript"></script>

      <script>

                  jQuery.sap.registerModulePath("WebContent", "/.../Bibhas/UI5/WebContent");

                  var view = sap.ui.view({

                              id : "dbUI5",

                              viewName : "WebContent.test",

                              type : sap.ui.core.mvc.ViewType.JS

                  });

                  view.placeAt("content");

      </script>

      </head>

      <body class="sapUiBody" role="application">

      <div id="content"></div>

      </body>

      </html>

       

       

      test.view.js:-


       

      sap.ui.jsview("WebContent.test", {

       

          getControllerName : function() {

                 return "WebContent.test";

          },

       

          createContent : function(oController) {

                             

                 // Step-1: Create a new carousel instance  >>>>>

                 var oCarousel_Trend = new sap.ui.commons.Carousel();

                 oCarousel_Trend.setVisibleItems(4);

                 oCarousel_Trend.setOrientation("horizontal");

                 oCarousel_Trend.setWidth("100%");

       

                 // Step-2: Create a new JSON model instance loaded with data >>>>>

                 var oModel = new sap.ui.model.json.JSONModel();

                 oModel.loadData("/XMII/Illuminator?QueryTemplate=Default/Bibhas/QueryTemplates/XAC_RetrieveDefectDetails&Content-Type=text/json", "", false);

       

                 // Step-3: Set the model into global level  >>>>>

                 sap.ui.getCore().setModel(oModel);

       

                 // Step-4: On the basis of model data create component for Carousel >>>>>

                 var defectData = oModel.getProperty("/Rowsets/Rowset/0/Row");

       

                 for (var i = 0; i < defectData.length; ++i) {

                             

                       // Step-4A: Retrieve value from model >>>>>

                       var prodName = defectData[i].product;

                       var defectStatus = defectData[i].status;

                       var defectTrend = defectData[i].trend;

                       var defectPercentage = defectData[i].percentage;

       

                       // Step-4B: Apply logic for status image >>>>>

                       var statusIMG = "";

                       if (defectStatus == 'Green') {

                            statusIMG = "<img src=\"/.../Bibhas/UI5/Images/green.png\" alt='OK'>";

                       } else if (defectStatus == 'Yellow') {

                            statusIMG = "<img src=\"/.../Bibhas/UI5/Images/yellow.png\" alt='Warning'>";

                       } else {

                            statusIMG = "<img src=\"/.../Bibhas/UI5/Images/red.png\" alt='Problem'>";

                       }

       

                       // Step-4C: Apply logic for trend image >>>>>

                       var trendIMG = "";

                       if (defectTrend == 'Up') {

                             trendIMG = "<img src=\"/.../Bibhas/UI5/Images/upward.png\" alt='Upward'>";

                       } else {

                             trendIMG = "<img src=\"/.../Bibhas/UI5/Images/downward.png\" alt='Downward'>";

                       }

                                         

                       // Step-4D: Create UI5 html content >>>>>

                       var htmlContent = new sap.ui.core.HTML("", {

                             content:

                                          "<html>" +

                                          "<body>" +

                                          "<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">" +

                                          "<tr>"+

                                          "<th colspan=\"4\">Defect Details</th>" +

                                          "</tr>"+

                                          "<tr>" +

                                          "<th align=\"left\">  Product </th>" +

                                          "<th align=\"center\">Status</th>" +

                                          "<th align=\"center\">Trend</th>" +

                                          "<th align=\"center\">Percentage</th>" +

                                          "</tr>" +

                                          "<tr>" +

                                          "<td height=\"25\">   " + prodName +"</td>" +

                                          "<td height=\"25\" align=\"center\">" + statusIMG+ "</td>" +

                                          "<td height=\"25\" align=\"center\">" + trendIMG + "</td>" +

                                          "<td height=\"25\" align=\"center\">"+ defectPercentage +"</td>" +

                                          "</tr>" +

                                          "</table>" +

                                          "</body>" +

                                          "</html>"

                       });

       

                       // Step-4E: Create layout which hold the html content >>>>>

                       var oLayout_Carousel = new sap.ui.commons.layout.MatrixLayout({height: "60px"});  

                       oLayout_Carousel.setWidth("100%");

                       oLayout_Carousel.createRow(htmlContent);

       

                       // Step-4F: Add component into Carousel >>>>>

                       oCarousel_Trend.addContent( oLayout_Carousel );

       

                        // Step-4G: Add Start and Stop Event into Carousel >>>>>

                        oLayout_Carousel.attachBrowserEvent("click",stopTimerLoop); 

                        oLayout_Carousel.attachBrowserEvent("dblclick", startTimerLoop);

                 }

       

                 // Step-5: Add Carousel into Main layout >>>>>

                 var oLayout_Main = new sap.ui.commons.layout.MatrixLayout({columns : 1, widths : [ '99%']});

                 oLayout_Main.createRow(oCarousel_Trend);

       

                 // Step-6: Set Timer for Carousel for auto-loop >>>>>

                 setTimerLoop(oCarousel_Trend, false, 3000);

       

                 // Step-7: Add main layout content into view >>>>>

                 this.addContent(oLayout_Main);

            }

      });

       

       

      CarouselUtilities.js:-


       

      /******************************************************************/

      /******************** Custom Carousel Utilities ***************************/

      /******************************************************************/

      var oCarouselU = null;   // This will hold the carousel component

      var loopTimeU = null;    // This will hold the carousel loop time value in millisecond

      var bShowNextU = null;  // This will hold the value in boolean whether user wants to loop nextwise or previouswise

      var timeoutID = null;      //  This will hold the return value of  setTimeout function

       

      /**

      * Setter for loop timer

      *

      * @param oCarousel [sap.ui.commons.Carousel]

      * @param bShowNext [boolean]

      * @param loopTime [millisecond]

      * @return void

      * @function

      */

      function setTimerLoop(oCarousel, bShowNext, loopTime) {

                  oCarouselU = oCarousel;

                  bShowNextU = bShowNext;

                  loopTimeU = loopTime;

       

                  if (bShowNextU) {

                              runTimerLoopForShowNext();

                  } else {

                              runTimerLoopForShowPrevious();

                  }

      }

       

      /**

      * Perform carousel ShowNext according to recursive loop timer

      *

      * @return void

      * @function

      */

      function runTimerLoopForShowNext() {

                  oCarouselU.onsapnext();

                  timeoutID = setTimeout('runTimerLoopForShowNext()', loopTimeU);

      }

       

      /**

      * Perform carousel ShowPrevious according to recursive loop timer

      *

      * @return void

      * @function

      */

      function runTimerLoopForShowPrevious() {

                  oCarouselU.onsapprevious();

                  timeoutID = setTimeout('runTimerLoopForShowPrevious()', loopTimeU);

      }

       

      /**

      * Start carousel timer loop

      *

      * @return void

      * @function

      */

      function startTimerLoop() { 

                  if (bShowNextU) {

                              runTimerLoopForShowNext();

                  } else {

                              runTimerLoopForShowPrevious();

                  }

        }

       

      /**

      * Stop carousel timer loop

      *

      * @return void

      * @function

      */

      function stopTimerLoop() { 

                  clearTimeout(timeoutID);

        }

       

      Test.png

      Now, in the above example single click on the “Carousel” Auto-Loop will stop immediately and again double-clicked on the “Carousel”, Auto-Loop starts instantly. Hope, this simple solution will be helpful for any project requirements and also for the learning purpose.

       

      I want to express my sincere and special thanks to Dipankar Saha for giving me an awesome guidance and continuous inspiration to move ahead.

       

       

      Thanks

      &

      Best Regards,

      Bibhas Das

      SAP Enterprise Manufacturing Intelligence (EMI) Solution for Microsoft Office 365

      $
      0
      0

      Solution Features

      SAP AG and Microsoft, developed the first real-time incorporation of shop floor information using SAP MII (SAP Manufacturing Integration and Intelligence), Microsoft Office 365 and Windows 8, bringing accurate near real-time manufacturing operations visibility and SAP ERP Context into the flexible Microsoft Office solutions. This new development incorporates manufacturing data and contextualizes it with enterprise data in real-time, and delivers it through a flexible self-service analytical user experience into Office 365 and Windows 8 all as a cloud service (no local software install required).  As described here in this joint press release: http://www.sap.com/corporate-en/news.epx?category=ALL&articleID=21052&searchmode=C&page=1&pageSize=10

      Why the integration between SAP MII and Excel Services

      The SAP MII environment provides a way for customer to manage the calculations and flow of information from a multitude of real - time plant operations systems. Very often business users don’t have live access to system data and as a result have out of date views of the plant operations. By combining the SAP MII near real-time environment and the familiar business user reporting environment of Excel Services in Office 365 business users can now access enterprise and operations information on demand.  From inside the Excel Services environment users have the ability to map responses of SAP MII query templates into tables and refresh them as needed.  This will populate the latest data in aggregated and pre-calculated forms for quick and easy consumption and report building using Power View. Power View is an interactive data exploration, visualization, and presentation experience that encourages intuitive ad-hoc reporting.

      The Resulting End User Experience

      From inside the Excel environment you have the ability to map responses of SAP MII Query templates into tables and refresh them as you see fit.  This will always populate the Excel environment the latest data that is accurate (IT Managed), aggregated, and in pre-calculated form for quick and easy consumption so the user can focus on report building using the latest Excel visualization tools (ie: Power View).  From the MII reporting environment it is common to have web based reports with various KPIs that represent performance values across various dimensions and time ranges as shown in this example Production Cockpit report, note the value in the KPI as this is driven by the MII 14.0 KPI framework:
      SAP MII Production Cockpit with KPI Highlight.png
      Additionally on this web page you can add HTML 5 controls like the Excel Interactive View which will allow you to pull up a user-interactive view of data right from the web page (2 lines of HTML):
      SAP MII Prod Cockpit with MicrosoftExcelHTML5Plugin.png
      The SAP MII 14.0 KPI Monitor (MII Menu -> Alerts and KPIs -> KPI Monitor) will allow a user to create views of various KPIs over different dimensions and time ranges based on what IT has configured.  These KPIs can be tiered to provide an aggregated rolled-up view of values across the dimensions and other KPIs as defined by information flowing directly from the operations systems or from user input into MII in order ensure data is accurate and visible in real time and is managed by the IT team to ensure quality and accuracy of the data:
      SAP MII KPI Monitor with KPI Highlight.png
      The KPI data can come from any system that MII can communicate with including manual user input where no automated means exist.  These KPIs can also be feed by the Plant Information Catalog (MII Menu -> Catalog Services -> Plant Information Catalog) which provides enterprise context to sensor network data that can be viewed and managed by the business user community without impacting the existing SCADA/Historian configuration.  The PIC serves as a way to join the SAP ERP EAM Asset Hierarchy (Func Loc, Equip, and Meas. Pts.) & PP(-PI) (Work Center/Capacity) hierarchies with the plant operations business names and Historian/DCS/SCADA/HMI sensor network structures providing a single view of sensor network data across the enterprise.  This sensor network data along with the associated ERP meta-data can be used to feed calculations of KPI values across various operational dimensions.


      SAP Plant Information Catalog (PIC)

      The SAP MII 14.0 Plant Information Catalog (PIC) allows users to combine information from various sensor networks and SAP PM & PP(-PI) data together into a single operations view (the ERP integration with PM and PP(-PI) comes in SP04 which is planned for November 2014).  This catalog can be used to populate the KPI framework with live equipment measured data values and dimensional information so that it can be accurately reported to local users and also to the central long-term environment of BW or HANA.  The catalog also provides a means for business users to manage and update their reporting information without the involvement of the IT team but still goes through an approval process that is managed on productive system.  To view the configuration of the PIC from the MII Menu select Catalog Services -> Plant Information Catalog and you will see a screen similar to the one below.  Here tag search and discovery can be done in order to find out which tags map to various assets and what types of monitoring sensors exist for that particular assets and how they map into their respective ERP definitions.  It also helps to provide a business user namespace to a sensor network whose naming convention is typically not business user friendly; traditionally this naming convention is very Electrical Engineering centric and various across different systems and geographical locations:

      SAP MII Plant Information Catalog with Property Data.png

      Microsoft

      Office 365

      Now that the data is live and exposed for users from an IT delivered web page for sharing and collaborating on data how can a user take the next step and perform (securely) their own analysis on this data?  The answer is by leveraging the work that IT has already done around creating KPIs and managing data visibility while scaling to meet the speed of the business user demands across the organization.  As a result of these pressures the IT department is often left understaffed to deliver and manage all of the visualization requirements that the business users have so we are providing a way to do both using the same IT managed data.  The MII product has the ability to connect directly to a wide range of shop-floor systems and provide SAP ERP information and context to these systems.  Conversely, it can also provide a way for these systems to natively interact with the SAP ERP backend.  All data visible to the MII environment is then exposed via HTTP services or to other business systems for users to consume, and in this case this means via the Office 365 Excel interface.

       

      Power View

      In the “MII Façade” view on the right side of the screen select the entity you wish to update live from the MII instance and press the Get OData button then Reload Table button, finally right click and Reload the Power View page.  This will now show you updated information that will match the MII reports and also a couple of examples we have built in order to showcase the solution:
      PowerView KPIs.png
      PowerView OEE.png
      PowerView Production Orders.png

      System Architecture and Positioning

      Now that you understand the scenario and how it works it's time to move onto the technical details  about how we can best leverage and manage security when working with SAP NetWeaver Gateway, MII and the Microsoft Office 365 products.  The recommended architecture for this scenario is a central Microsoft Office 365 Cloud that is supporting Office users across the enterprise and distributed instances of MII providing visibility to the local operations systems (Local reports for local users from local systems).  The SAP NetWeaver Gateway and Mobility Platform solutions also play a role in the overall solution.

      Positioning with SAP NetWeaver Gateway & the Mobility Platform (SMP)

      The SAP NetWeaver Gateway and Mobility Platform products typically reside centrally at an enterprise so that applications can be built centrally and deployed locally to the various business users regardless of the device and platform.  These devices and their applications can then retrieve data on-demand from the central SAP NetWeaver Gateway server or from the local MII instance depending on the type of SAP business data required by the application.  This is outlined in the architecture diagram below:

      MobileMfgSolutionDiagram2.png

       

      SAP NetWeaver Gateway and MII Working Together

      The SAP NetWeaver Gateway product provides the same OData feed for the ABAP stack as MII provides for the JAVA stack.  It also typically resides at the central enterprise level close to the central business suite, whereas MII typically resides local to the manufacturing operations systems as shown in the previous Mobile Architecture for SAP Manufacturing diagram (See SAP Mfg Implementation Architecture for additional details).   The SAP  NetWeaver Gateway team also is planning (Q3 2013) to release an additional SAP Add-on to the market that will plug into the Microsoft cloud infrastructure to help IT better manage security and user permissions/authorizations across the Microsoft and SAP boundaries to simplify the user experience (this demo uses HTTPS and SSO authentication).  This SAP Add-on module for the Windows Azure Cloud environment is planned to be releasse in Q4 2013 and to work for both the SAP NetWeaver Gateway & MII products for simplifying the user authentication between the Microsoft and SAP environments and will also facilitate secure communication of data between these environments:
      JointSolutionDiagram.png

      Closing Remarks

      Well I hope that you have enjoyed this Blog and look forward to publishing more for the SAP MII community to enjoy in the future.  Please feel free to reach out to either your SAP or your Microsoft Account Teams for further information on this solution and they will be happy to assist you and provide the proper insight and support you need.  Also, if you feel like something was omitted from this Blog please let me know.
      Thanks!

      Is Condition-Based Maintenance (CBM) Right for You? Just Listen to Your Assets!

      $
      0
      0

      Is Condition-Based Maintenance (CBM) Right for You? Just listen to your assets!

       

      Did you know that the SAP Analytics RDS team rolled out an RDS call SAP Condition-Based Maintenance back in March of this year? With so many great RDS coming out to the market every quarter, it’s easy to let a small RDS like this one slip by you. But don’t let the “small” size of it fool you. While simple in design and implementation, the business value it can bring to an organization is anything but. The objective for SAP is straightforward – provide a solution that leverages the customer’s existing technical infrastructure to help maintain and inspect the right equipments at the right time.

       

      Solution Architecture

       

      Architecturally, the CBM RDS solution leverages SAP MII's strong integration component to facilitate seamless data flow between operations (I.e., sensors, SCADA, Plant historian and etc.) and backend processes (ERP) to determine the best time to maintain or repair an asset.


      SAP MII (Manufacturing Integration and Intelligence) is renown in the industries for its ability to bridge these two distinct worlds! There is no shortage of customer examples to demonstrate SAP MII's track record in enabling manufacturing, maintenance, SCM, and sustainability

       

       

      CBM Architecture.jpg

      applications across the industries. Providing a composite platform (consisting of an integration, business logic, and presentation layer) on which manufacturing applications can be developed and deployed was the main design principle behind the original xMII. Since then, SAP MII has evolved as a platform and so has the range of use cases it has supported (i.e., manufacturing, sustainability, and maintenance). CBM is the latest addition to that list. Customers that have managed to deploy more use cases on their existing MII installation(s) are able to get greater return on their investment as a result of economies of scale. For customers reluctant to step foot into the MII world, the CBM use case may just be that extra bit of justification or convincing needed to get things started. The main takeaway is that CBM is a good message to convey to maintenance organizations that have existing investment in the manufacturing composition platform or are looking for a lean and cost-effective way to lay a foundation that can be scaled to support the gradual adoption of existing and upcoming solutions built to run on the MII platform.

       

      E2E Solution Cluster

      According to the industry maturity curve, condition-based maintenance is a natural next step from the SAP Asset Analytics RDS (released in Q1/2012) which leverages the customer’s day-to-day maintenance data to report on performances related to asset management.

       

      maturity.jpg

       

      As a cluster, Asset Analytics and CBM have a combined capability that can address a complete requirement at the proactive stage of asset management. Asset Analytics offer KPI scorecards that allow managers to quickly identify performance issues (i.e., overall maintenance cost or asset reliability) in their maintenance operations and then drill down to more granular information that pinpoints specific assets, functional locations, or org-unit(s) that have contributed the most to a performance issue. Reliability engineers can use that detailed information (discovered root-cause) to jumpstart a CBM initiative. Having the ability to monitor a set of critical assets closely to trigger email and/or maintenance notifications in ERP when conditions warrant it means that costly failures, resulting in production loss, accidents, and/or harm to the environment have a better chance of being caught in time. Information to update the equipment health indices (i.e., temperature, vibration, pressure, and etc.) can come from a number of sources. Real-time data can be collected by MII through the Plant Connector or relayed back from mobile devices used during inspection rounds.

       

      The Inbound data is constantly compared with equipment-vendor specifications or recommendations. When the data exceeds a preconfigured tolerance, MII will automatically trigger a maintenance notification in ERP (Plant Maintenance).  The maintenance planner can use the information in the notification to create a follow-on maintenance work order for a personnel to do further inspection or carryout repair. The maintenance worker assigned to respond to an alert can click on a link in CBM/MII to punch out to SAP Visual Enterprise to view an animated 3D image to aid in troubleshooting or repairing the subject.

      This E-2-E scenario leverages the concerted capability of SAP Asset Analytics RDS, SAP Condition-Based Maintenance RDS, SAP Mobile Rounds application, SAP Visual Enterprise solutions, and SAP Manufacturing Integration and Intelligence (MII) and Plant Maintenance on ERP 6.0.  Please use the following hyperlink to get additional information including the effort, price, and timeline to jumpstart a CBM program in as little as 7 weeks.

       

      Summary

      But let’s be frank – Is CBM right for every customer? The honest answer is: maybe. The customer's current technical landscape and whether asset management is perceived organizationally as a chore or as an important strategic component contributing to the corporate strategy are important factors. Industry experts will tell you what havoc an unplanned breakdown can have on a manufacturer, measured in loss production, harm to workers and/or the environment (legal and compliance issues), and damage to customer relations and tarnish to a brand. Due to the severity of those consequences, many asset-intensive industries enforce strict maintenance guidelines and comply with regulations to mitigate the risks. Furthermore, organizations in these industries have typically made substantial investments in both hardware (IT hardware and field assets) and software to install a strict preventive maintenance program that is often carried out as a regiment based on elapsed time – for example, inspect, change, add this or that after so many hours, days, weeks, or months.

      No matter how extensive your CBM program is, it shouldn’t be treated as a replacement for the existing preventive maintenance infrastructure that is already in place. The SAP Condition-Based Maintenance rapid-deployment solution fits into this complex environment in a supplemental role that leverages real-time data to provide health management information on equipment and provide insights (tell-tale signs) that further strengthen the overall maintenance strategy.

       

      Contacts

       

      Package owner

      Peter Huyen

      Solution owners

      Sam Castro & Hemant Rathod

      Service offering manager

      Jason Didday

      Rollout Lead

      Robert Milton

      Partner contact (Fujitsu)

      James.Zhang@us.fujitsu.com

      Viewing all 85 articles
      Browse latest View live


      Latest Images

      <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>