...by Daniel Szego
"Simplicity is the ultimate sophistication."
Leonardo da Vinci

Thursday, July 10, 2014

Integrating K2 with SAP with K2 Connect

So, it was a challenge to see how one can integrate K2 with SAP without K2 Connect. Now let we see ho the same process can be realised with the help of K2 Connect. Prerqisit : You need to have K2 Blackpearl, K2Smartforms, K2 Connect and an SAP System instlled not necesarily with Netweaver but with a Controlling module.So for the first run start Visual Studio, create a new K2 Project called K2ConnectTest and add a new K2 Connect Service Object called K2ConnectTest as well to the project :

Having finished open in the VS Toolbox the K2 Service Object Designer and start a new filter criteria with "*costcenter*", after that choose the BAPI_COSTCENTER_GETLIST Bapi, tes it with the help of the K2 connect Test Cockpit at loading the interface then testing the interface firstly by adding 1000 default value to the controlling area and leaving the other values as default. 

If everything succeed and you get the result value in the costcenter list. then add a new service, name it as Costcenter, to the Visual Studio project and add the BAPI_COSTCENTER_GETLIST to the Costcenter service :

Having finished, build the VS projects and say Publish Service Object. If everything runs without error then open the Smart Object Service Tester application, the K2Connecttest should be published under K2 Connect Service :


As a next step create a Smart Object from the K2ConnectTest Smart Object Service. After that test it explicitely by adding 100 to the ControllingArea input field:

As a last step create a View and a Smart Form from the Smart Object, for the first run just simple pressing the generate view button on the Smart Object. For the first run you will probably get an error message it is because the ControllingArea input field is not defined. So ​​open the autogenerated View, go to the Initialisation rule and set the ControllingArea to 1000 for the first run:

If everything goes well, then after running either the form or directly the view you should get the information of the list of costcenters to the 1000 controlling area:

Conclusions : 
- You can integrate SAP with K2 with or without K2 connect. 
- If you do it without K2 Connect you must have development skills in C# and some direct SAP know how. 
- If you do it with K2 connect you do not necessarily must know to code or know how to handle SAP, however you have to have a strong IT Skill. 
- If you do with K2 Connect, you have to pay the K2 connect license (as I know around 20k).
- If you do  without K2 Connect, you have to have one connector (as I know Theobald is around 1k pro year, if you manage to hack lib32rfc.dll it is as I know free of charge)
- There is no best solution, just an optimal for a certain customer :)

The end.