cancel
Showing results for 
Search instead for 
Did you mean: 

Employee Lookup (enhanced) - OData calls to $value@2 with failure

former_member182638
Active Contributor
0 Kudos

Hi Folks,

I've extended the standard Employee Lookup (Wave 2) app but now I've noticed that when looking up employees I'm seeing calls to the following ...

<server>/sap/opu/odata/sap/HCM_EMPLOYEE_LOOKUP_SRV/EmployeeInfoSet('00004767')/$value

<server>/sap/opu/odata/sap/HCM_EMPLOYEE_LOOKUP_SRV/EmployeeInfoSet('00004767')/$value@2


In this example '00004767' represents a value personnel ID. In the above the call to $value returns a valid result (employee image) with a 200 return code, however the call to $value@2 returns 404 not found, and when I look in the Gateway error log it tells me 'Resource not found for the segment $value@2'. 


I've looked in SAP's source code for the web app and cannot see where this $value@2 is coming from.  I also can't see it coming from my own enhancements (which have been created via WebIDE).  The @2 seems to be appended automatically somewhere.


Any ideas would be appreciated.


Regards


John

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182638
Active Contributor
0 Kudos

I'm thinking the multiple calls might be via the sap.m.Image control whereby the default setting for the densityAware attribute is that (per the SAP documentation) ... "one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server."

OpenUI5 SDK - Demo Kit

Personally for the Employee Lookup app I think this is a shocker because it can result in many redundant network calls.  At least I think this is what is causing this.  When I look at SAP's source code in controller Search.controller.js (debug version here) I believe this is causing it.


                var persImgObj = new sap.m.Image({src: that.sServiceUrl + "/EmployeeInfoSet('{EmployeeNumber}')/$value",

                    layoutData: imgSpan

                });

Although this is standard SAP code and I doubt it is worth enhancing to replace the controller just for this reason.  Interested to know if others have the same opinion.