on 2023 Dec 10 6:26 PM
Hi Experts
I am trying to create an action call to RAP OData v4 service.But getting an error "Not a bound action" .When i pass this context oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn(...)");
When I remove (...), I get an error"Binding must be deferred.Can you tell me where am I going wrong?
Here is the code snippet:
var oModel = this.getOwnerComponent().getModel();var contactsPersonArray = oContactsModel.getProperty("/contacts"); var oModelContext = oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn"); oModelContext.setParameter("ReqID" , "NGBTPADMIN20231207142608"); oModelContext.setParameter("Reqtype", "NEWREG"); oModelContext.setParameter("Isdraft", false); oModelContext.setParameter("_newReg", newreg); oModelContext.setParameter("_contactPersons",contactsPersonArray); oModelContext.execute('$auto',true).then( function () { console.log("success"); }, function (oError) { console.log("error",oError.mesaage); }) ;
Request clarification before answering.
Your first link seems ok oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn(...)"), but there is a concen. Check your metadata, and make sure there is no alias for your service. It could be 'SAP__self' you need to use alias if there is, rather than the service technical name 'alias.action(...)'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.