I assume that you would have read my blog and seen the video which tells you how to Use xMII Services in Adobe Flex 2.0 (Video)
Since there is a lot of activity on using Adobe Flex as an alternative UI for SAP MII on SDN, I’ve created a helper class which will ease this process.
The helper class is located in the package com.sap.sapmii and is called SAPMIIHTTPService.
You just need to set a couple of parameters and call the sendRequest() method to send the call to SAP MII. This class supports both the versions 11.5 and 12.0.
You need to set the following Parameters :
- SAPMIIHost – The SAP MII system hostname or IP address
- SAPMIIPort – The SAP MII system port (not required for 11.5)
- MIIUserName – The SAP MII Username
- MIIPassword – The SAP MII User Password
- MIIVersion – Values“115” or “120”. If no values are provided, defaults to 12.0
- DataSource – Path of the Query Template (eg: abesh/BatchTrend/PlasticBottleTrendQT) If you want to execute a Transaction, you would need to make a Xacute query out of it 🙂
After these variables are set you need to call sendRequest() to actually send the request to the SAP MII server. The class dispatches two events SAPMIIResultEvent.RESULT in case data is returned and SAPMIIFaultEvent.FAULTin case an error occurs. You need to add event handlers to listen tothe events mentioned above and handle them according to your need.
var reqToMII:SAPMIIHTTPService = new SAPMIIHTTPService();
reqToMII.SAPMIIHost = "inld50045873a";
reqToMII.SAPMIIPort = 53000;
reqToMII.MIIUserName = "abesh";
reqToMII.MIIPassword = "dodo1234";
reqToMII.MIIVersion = "120";
reqToMII.DataSource = "abesh/BatchTrend/PlasticBottleBatchData_QT";
You can download the helper library and the sample actionscript project below :
Helper Library and Sample Project – SAPMIIASHelperClassWithSampleProject.zip