JavaScript autocomplete with MII

Many modern web development editors are now able to provide some level of autocomplete for JavaScript similar to the functionality enjoyed by java/.net developers etc. Typically some import and configuration is required for the editor to be aware of the JavaScript libraries you may be using in your project.
For UI5 Robin van het Hof has written an excellent blog outlining how to get the UI5 or any JavaScript libraries into Webstorm. (note: there also appears to be a plugin available now as well).
This is pretty straight forward as the UI5 libraries are easily available for download via the open UI5 project. This is not the case for the MII libraries so how can we get them? This turns out to be relatively simple.

First create a new default irpt of html page in MII. Your page should only contain the script tag for the MII bootstrap.js file. It should look similar to this:

Then simply launch or load this page in the Chrome web browser. Select ‘Save page as..’ and save with a useful name like ‘MII.html’ and save as type ‘Webpage, complete’.
You should now have an html file and a directory. One is the html from your webpage and the directory contains all the JavaScript and css sources used by the page.

You may want to remove the UI5 sources and css files that were also pulled in if you plan import them separately. These are the sap-ui-core.js and library(*).css files. Now that you have the MII sources follow the instructions in Robin’s blog or for your specific development environment to import them and make them available in your preferred editor. You should then be able to enjoy autocomplete and api browsing with the MII javascript libraries.

A version of this blog was originally published here

Industrial Label Printing with MII

Often there will be a label printing requirement as part of an MII implementation. Possible solutions range from commercial offerings from Bartender or Loftware, writing a custom action or jsp in MII, or simply having the user print from their workstation. Well with the release of MII version MII14.0 SP4 Patch 3+ and the new ability to push messages from MII over a socket connection thru PCo as discussed here: , there is now another option. This is because the Intermec and Zebra type industrial label printers we often find in shop floor environments have the ability to receive print commands directly via a socket connection. I will walk thru a simple example you can use as launching point for you own investigations. If you are new to PCo or are looking for more information I suggest starting with the PCo application help here:

To begin open the PCo Management Console and create a Socket Agent type source system.

Configure a Communication Port to connect to the printer. Set the Length to 1 so all messages from MII will be pushed to the printer.

Now create an Agent Instance for our Socket Agent Source system.

Configure the Query Port so MII can connect to our Agent.

Now Start the Agent and also make sure the PCo Management Host service is running.

Now we need to configure a PCo Data Server connection in MII.

From the MII Admin Menu navigate to Data Services –> Data Servers and create a new PCoConnector connection.

Now that we have a connection we can create a PCo query to send our print commands to our printer.

In the MII workbench create a new PCo query and select our new connection as the server and TagFixedQuery as the mode.

On the Tag Fixed Query tab you will use something like the following:

CALL SEND(address=‘123.456.789.101’, port=‘9100’, message=‘FT \“Swiss 721 BT\” PT \“HELLO SDN!!\” PF ‘);

Your actual address, port and message will differ based on your specific printer.

We can now run the query in the workbench. If all goes well we should get a successful return code (0) and a nice label should print.

And here it is:

Of course an actual implementation would take a bit more planning and development than the simple solution demonstrated here. I hope many of you will be able to take advantage of this new functionality.

Update: 2/25/2015 SAP has added integration with NetWeaver Adobe Document Services that can provide another printing option.

ADS Printing - SAP Manufacturing Integration and Intelligence - SAP Library

A version of this blog was originally published here

xMII Guru LLC © 2015. All rights reserved.