Add Custom Service Objects and a SmartObject

This tutorial uses the K2 connect destination created in the Configuring a K2 connect Destination tutorial. If you have not already completed the Configuring a K2 connect Destination tutorial, please do so now before beginning this tutorial.
In Testing the K2 connect Service Object and K2 SmartObject, we removed the embedded login credentials from the K2LearningSAP destination and configured K2 SSO cached credentials. For this tutorial, either credential configuration will suffice.

This tutorial moves into developing with K2 connect and how we might build our own Service Objects and SmartObjects from scratch. We will add a new service to call extended job data, then manually add custom methods. We will define our own parameters and the properties we want returned. We will define our own custom structure. To complete the manual process, we will map the new input and outgoing structure and properties to their corresponding BAPI input and outgoing properties.

We will add an additional service to call company data. Finally, we will update an existing service by adding an XML method to call the employee's contact email addresses. (In this case, the XML method allows us to call and return multiple properties back to one outgoing property.)

After defining new services and updating an existing service, we will manually create a SmartObject based on all three service calls. The SmartObject will list employees based on their last name. The extended job data is bound to the employee 'list' data by the employee's ID. The job data provides us with a company code, which in turn, becomes the bind to the extended company information.

This tutorial has three main parts:

  1. Developing with K2 connect (basics, this topic, Step 1-4)
  2. Extending Existing Service Objects, Using Structures and XML Properties (Step 5a-c)
  3. Publishing and Updating an Existing Service Object and SmartObject (Step 6a-c)

What we specifically want to demonstrate in this set of parts for the tutorial is the ability to pull together a data set of information (employee > job > company) from multiple service calls, all in one SmartObject. We will then leverage that data from within our user interface, a SmartForm.