Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Create_Entity – Error - No valid source context supplied

$
0
0

Hi All,

 

 

I am facing issue with triggering method - CREATE_ENTITY with POST request. I am able to trigger CREATE_ENTITY if it is not assigned with any navigation. But if it assigned with navigation it giving error “No valid source context supplied”. Seems, like my request body is wrong. The request body is having few more details about item entity & navigation. Even I have deleted the navigation details and made request body same as it has no association, It is still giving me same error. I am pasting both files..


Please advise how we can trigger CREATE_ENTITY method when it has navigations assigned to it.


Actual Request Body: (with Navigation)

{

"d" : {

"__metadata" : {

"id" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')",

"uri" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')",

"type" : "ZPA_TIMESHEET_T_SRV.Header",

"properties" : {

        "Item" : {

"associationuri" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')/$links/Item"

        }

      }

    },

"Action" : "",

"Todate" : "\/Date(1389916800000)\/",

"Fromdate" : "\/Date(1389398400000)\/",

"Pernr" : "00000001",

    "Item" : {

      "__deferred" : {

"uri" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')/Item"

      }

    }

  }

}

 

Modified Request Body (Modified - As if entity is not assigned with any navigation)

 

{

"d" : {

"__metadata" : {

"id" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')",

"uri" : "<.....>/sap/opu/odata/sap/ZPA_TIMESHEET_T_SRV/Header(Pernr='00000001')",

"type" : "ZPA_TIMESHEET_T_SRV.Header",

    },

"Action" : "",

"Todate" : "\/Date(1389916800000)\/",

"Fromdate" : "\/Date(1389398400000)\/",

"Pernr" : "00000001"

    }

}


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>