Skip to Content
avatar image
Former Member

CDS Odata Unable to call Function Imports

Hi Experts ,

below is the basic flow I am trying to achieve.

CDS > BO(BOPF) (Via annotations) > Consume in Gateway Service (Reference-> Data Source) - > Create Using Function Import.

I have created the below artifacts in the corresponding order :

1. Created the CDS View and provided annotations to create the corresponding BO

@AbapCatalog.sqlViewName: 'ZPIN_I_EMP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Employee Table Demo : Pinaki Patra'


@Search.searchable: true


@ObjectModel: {
    transactionalProcessingEnabled: true, 
    compositionRoot: true,
    writeActivePersistence: 'ZPIN_EMP',
    representativeKey: 'EMPID',
    semanticKey:  'EMPID'  ,
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true
}


define view ZXPP_I_EMP as 


select from zpin_emp {
    @Search.defaultSearchElement: true
    key empid,
    emp_name, 
    status  
} 
 

2. The same has created an BO

3. The same CDS I have consumed in SEW(Gateway Service Builder) as a result of which below artifacts are generated.

Now as per my understanding the actions defined in the BO will create Function imports in the gateway service and it has done the same. But when I am calling the function import it is throwing some awkward errors.

I have tried to debug but looks like something is going wrong in the SADL Layer.

Below is the code of the relevant artifacts:

1. Action(Trying to create a new entry in the custom table)

2.Calling the Function Import

var requestData ={  "empid":'001'};
var oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/SAP/ZPIN_EMP_GW_5_SRV/",true);
oModel.refreshSecurityToken(null, null, false);
oModel.callFunction('ZXPP_I_EMP_V4Auto_create',{


method: 'POST',


success:function(oData, oResponse){
console.log(oResponse)
},
error:function(error){
console.log(error)
}
});

Now below are the errors I am Getting.

1. In the Console (Chrome)

The following problem occurred: HTTP request failed404,Not Found,{"error":{"code":"005056A509B11EE1B9A8FEC11C21578E","message":{"lang":"en","value":"Invalid Function Import Parameter"},"innererror":{"transactionid":"FA62E8E234AF02B0E0059BCE3D1ABA2C","timestamp":"20170925120906.2903790","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"}}}} -  

Now if i try with

oModel.create("/ZXPP_I_EMP_V4Auto_create?empid='1211'", { empid:'002321'} );

I am getting another set of error

2017-09-25 17:41:17.541685 The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"SY/530","message":{"lang":"en","value":"An exception was raised."},"innererror":{"application":{"component_id":"","service_namespace":"/SAP/","service_id":"ZPIN_EMP_GW_5_SRV","service_version":"0001"},"transactionid":"FA62E8E234AF0270E0059BCE3D14717C","timestamp":"20170925121117.2779460","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[{"code":"/IWBEP/CX_MGW_BUSI_EXCEPTION","message":"An exception was raised","propertyref":"","severity":"error","target":""}]}}} -  

In the ERROR_LOG of gateway


I am pretty much new to the BOPF and CDS and may be doing something silly or wrong. Also tried consulting few of the blogs related to the same but couldn't get a solution.

Also let me know in case further details related to the issue needs to be furnished.

Kindly Help.

Thanks in advance.

-Regards

Pinaki Patra

capture.png (33.2 kB)
capture.png (23.1 kB)
capture.png (38.0 kB)
capture.png (37.6 kB)
capture.png (16.7 kB)
capture.png (40.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 26, 2017 at 08:39 AM

    Hi Experts,

    Any suggestions / hints ?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 08 at 11:18 AM

    I am also facing the same error. Could anyone guide us?

    Add comment
    10|10000 characters needed characters exceeded