Skip to Content
0
Jun 20, 2016 at 10:38 PM

ODataModel.callFunction not triggering the odata call to backend

1991 Views

Hi,

I am trying to call the function import in the UI5 application.

Below is the metadata of the function import.

<EntityContainer Name="ZOD_EMPLOYEE_SRV" m:IsDefaultEntityContainer="true">

<EntitySet Name="ET_EmployeeSet" EntityType="ZOD_EMPLOYEE_SRV.ET_Employee" sap:pageable="false" sap:content-version="1"/>

<FunctionImport Name="createEmpId" ReturnType="ZOD_EMPLOYEE_SRV.ET_Employee" EntitySet="ET_EmployeeSet" m:HttpMethod="GET"/>

</EntityContainer>


I have tried to access the function import by direct URL and it works as expected.

<domain>/sap/opu/odata/sap/ZOD_EMPLOYEE_SRV/createEmpId


But in the ui5 application, I am trying to access it. It does not trigger the call. I am not able to see any odata call

at 'network' tab.


debugger;

var oUrlParams = {};

oDataModel.callFunction("/createEmpId", {

method: "GET",

urlParameters: oUrlParams,

success: fnS,

error: fnE });

function fnS(data,response){

debugger;

console.log(response);

}

function fnE(oError){

alert("Error in read"+oError.message);

}

please help here to resolve this issue.

Thanks & Regards,

Vignesh