Introduction
I had blogged about how one can use the SAP Widget Foundation with Adobe Flex/Air in this Blog : Enterprise Widget Foundation & Adobe Flex : Awesome Twosome ? (Video)Enterprise Widget Foundation & Adobe Flex : Awesome Twosome ? (Video) .
That was just an example or a Proof of Concept. What I have here is something that makes the whole deal a lot more easier for everyone. The Actionscript Libraries for SAP Widget Foundation lets anyone using Adobe technologies consume services from the Widget foundation at ease without having to wonder about the nitty gritties of the REST services exposed by SAPWF.
Acknowledgement
Documentation
The helper class is located in the package com.sap and is called SAPWFHelper.
Calling the helper class is as easy as instanciating it and calling the helper methods.
As we all know we can pass Parameters, Structures and Tables to ABAP RFCs. The helper class gives you helper methods to do just tha.
If you think these methods are a little too daunting for you let me give you a small example on how to make them work :
****************************************************
BAPI_MATERIAL_GETLIST Example
****************************************************
var WfHelper:SAPWFHelper = new SAPWFHelper();
WfHelper.addParamInput("MAXROWS","4");
WfHelper.createParamTable("MATNRSELECTION");
WfHelper.createRow("MATNRSELECTIONrow1");
WfHelper.addRowField("row1","SIGN", "I");
WfHelper.addRowField("row1","OPTION", "EQ");
WfHelper.addRowField("row1","MATNR_LOW", "Y-300");
WfHelper.addRowToTable("MATNRSELECTION", "MATNRSELECTIONrow1");
WfHelper.createRow("MATNRSELECTIONrow2");
WfHelper.addRowField("MATNRSELECTIONrow2","SIGN", "I");
WfHelper.addRowField("MATNRSELECTIONrow2","OPTION", "EQ");
WfHelper.addRowField("MATNRSELECTIONrow2","MATNR_LOW", "Y-500");
WfHelper.addRowToTable("MATNRSELECTION", "MATNRSELECTIONrow2");
WfHelper.addTableToParams("MATNRSELECTION");
WfHelper.createParamTable("MATERIALSHORTDESCSEL");
WfHelper.createRow("MATERIALSHORTDESCSELrow1");
WfHelper.addRowField("MATERIALSHORTDESCSELrow1","SIGN", "I");
WfHelper.addRowField("MATERIALSHORTDESCSELrow1","OPTION", "EQ");
WfHelper.addRowField("MATERIALSHORTDESCSELrow1","DESCR_LOW", "");
WfHelper.addRowToTable("MATERIALSHORTDESCSEL","MATERIALSHORTDESCSELrow3");
WfHelper.addTableToParams("MATERIALSHORTDESCSEL");
WfHelper.addEventListener(SAPWFResultEvent.RESULT, populateGrid);
WfHelper.addEventListener(SAPWFFaultEvent.FAULT, raiseAlert);
WfHelper.sendRequestToSAPWF("BAPI_MATERIAL_GETLIST");
****************************************************
End of Example
****************************************************
Download
You can download the library and the sample project here...
Appeal to the Community
I'd created this basic library to help ease the calls one can make to SAP Widget Foundation. Though it is self sufficient in the sense it does what it is supposed to do pretty well there are lots of chances that this can be improved upon. If you think that there is a feature that you would like to see in this library, please feel free to improve upon it. If you are not familiar with actionscript write back and i'll do my level best to include it in the next release. And as always, feedback, both positive and negative are extremely welcome 🙂