Hi all,
Our company focuses on enterprise mobility applications and services and pledged to help businesses to harvest benefits of emerging technologies. But this is not a sale pitch, so I get to the point sharing our team’s experience in getting SAP SuccessFactors (SFSF) mobile app “up and running” just in few days.
This post is our “reflection” on how to take an easy way in developing a mobility app for SFSF in HCP with detailed “turn – by – turn” instructions and hopefully it will help you to pass your “driving test” and get a “license to develop”
Part 1 – “Getting Started”
In this section you learn on “how to”:
- Starting with SFSF
- Setting up the mobile-ready OData user roles and permissions
- Exploring SFSF OData API’s
- Using RESTClient, testing and troubleshooting OData calls
- Registering SFSF API to HCPms SMP
- Registering users to SMP
- Accessing SFSF OData from SMP on Cloud
SFSF Login
We assume you already obtained your SFSF demo client credentials and can login using similar link as below:
- https://pmsalesdemo8.successfactors.com/login?company=’Company ID’ (where Company ID is uniquely identifying SFSF Customer or Partner (like ourselves))
Upon successful login you will land on the following page (if not, we bare no responsibilities what happens next … are you sure you were on the login page to start?)
OData User Roles and Permissions
SFSF business processes can be exposed and consumed using OData API’s. For accessing or creating the ODATA API’s the user need to have specific roles. Make sure your user ID assignment has the following roles and permissions:
SFSF OData API’s
Now the roles and permissions are set, let’s explore available OData APIs. To access them, go to the Admin Center page and in the Tool Search field type “OData API Data Dictionary”
The system displays the list similar to pictured below:
For our challenge we decided to develop a mobile application for SFSF Employee Talent Profile allowing authorized users to search and find detailed information about the employee’s talent such as awards, education, certificates, training course and so on. To “proof test” you can develop mobile app for any other business process in SFSF using our “turn-by-turn” instructions.
Return to the Admin Center page and type any employee name in the search bar:
Select the Talent Profile for chosen employee. The system will display employee record.
Using dropdown option, you can navigate to desired record and display relevant details. In our case we are interested in the Talent Profile and want to learn out more about this employee:
We were able to navigate to the right information now let’s use OData API’s to retrieve the same data from SFSF. We need to go back to the Admin Center page and type “OData API Data Dictionary” in the Tool Search field.
TIP: Use prefix “Background_XXX” to find all APIs related to the talent profile data.
RESTClient and Testing OData
Congratulations, you are doing great so far and if you are still reading it, this means we did not mess up too badly either.
Next “turn” is to confirm if we can retrieve data using RESTClient. We used Base URL for SFSF:
- https://apisalesdemo8.successfactors.com/odata/v2/
For testing purposes we selected one of APIs (under Entity Name): Background Awards as pictured below:
Start the Firefox RESTClient and provide the following details:
- Method: Get
- URL: https://apisalesdemo8.successfactors.com/odata/v2/{Entitytype}?$filter={Property name} eq ‘Value’
- Ex: https://apisalesdemo8.successfactors.com/odata/v2/Background_Awards?$filter=userId eq ‘mdunn1’
NOTE: Based on your use case, you can practice with different entity types and filters to get your desired results.
You have to complete authentication by providing appropriate credentials on the Basic Authorization:
- Username: SFSFusername@CompanyID
- Password: SFSF password
In addition to authorization in the Headers section you need to select application/xmlas a Content-Type.
The Request in your system should be similar as pictured below:
As result the system will display the following Response information:
You notice that our request was successful and we were able to retrieve the same information what has been displayed in the Awards section of the Employee Talent profile:
Now you should be able to retrieve any desired data from SFSF using OData and to complete testing on RESTClient.
Registering SFSF API to HCPms SMP
It’s time to turn our attention to the process of mobile application development.
Depending on your environment you can consider either consuming OData directly into the mobile application or publish it on SMP first and then consume using SMP.
Even you are already familiar on how to register these services on SMP please bear with us and just follow along:
- Login to your HCP Cockpit account (using similar url https://hcpmsadmin-sXXXXXXtrial.dispatcher.hanatrial.ondemand.com)
- Go to Subscriptions -> hcpmsadmin
- Proceed to Applications and select Create Application option
In the Create Application window provide and save all required details for your future app, for example:
Upon saving your new application select the BACK-END tab and provide the details for your primary connections. Remember that
- Username: SFSFusername@CompanyID
- Password: SFSF password
To validate that your entries are saved properly and working correctly you can ping the application:
Registering users to SMP
Access RESTClient and register to receive APP CID:
-
- Method: Post
URL: https://hcpms-sXXXtrial.hanatrial.ondemand.com:443/odata/applications/latest/{Connection Name}/Connections
Ex: https://hcpms-sXXXtrial.hanatrial.ondemand.com:443/odata/applications/latest/com.sfsf.demo/Connections
You have to complete authentication by providing appropriate credentials on the Basic Authorization:
- Username: SMP server id
- Pwd: SMP Password
In the Headers section you need to select application/xml as a Content-Type and for Request Body choose Android or iPhone.
Android
After submitting the request, you need to verify the registration in the SMP for this application. If no errors occurred you find a new registration entry, for example:
This entry confirms that registration is successful and X-SMP-APPCID is the Registration ID.
Accessing SFSF OData from SMP on Cloud
We have last test to perfom validating the SFSF Background Awards OData API via SMP using RESTClient (or relevant data for your case):
- Method: Get
- URL: https://hcpms-sXXXtrial.hanatrial.ondemand.com:443/com.sfsf.demo/{Entitytype}?$filter={Property name} eq ‘Value’
- Ex: https://hcpms-sXXXtrial.hanatrial.ondemand.com:443/com.sfsf.demo/Background_Awards?$filter=userId eq ‘mdunn1’
When prompted you have to complete authentication by providing appropriate credentials on the Basic Authorization window:
- Username: SMP server id
- Pwd: SMP Password
In the Headers section you need to select application/xml as a Content-Type and for X-SMP-APPCID choose {Registration ID from SMP}:
If your request is successful, the system will display the following Response result:
Congratulations, we have achieved our Part 1 objectives and completed all necessary tasks for preparing our back end and middleware.
In the Part 2 we provide details on Front End development activities to complete our SFSF mobile app journey. Have a quick look at the SFSF mobile app screens which we will develop in Part 2 using SAPUI5 and HCP.