Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Inserting a Header + Item via Http POST, json and OData Service

$
0
0

Dear Colleagues,

 

I would like to know if it is possible to insert a Header and Item together in one POST request.

My Odata Service looks like this:

 

service namespace "traXS.s.odata"

{

  "traXS"."traXS.s.db::traXSHeader"  as "Header" navigates ("Header_Links" as "Links");

  "traXS"."traXS.s.db::traXSLinks"   as "Link";

    association "Header_Links" principal "Header"("CLIENT","IREC_ID") multiplicity "1" dependent "Link"("CLIENT","IREC_ID") multiplicity "*"

    create using "traXS.s.logic::testinsertRecord" ;

}

 

and the Procedure is declared as..

PROCEDUREtestinsertRecordinheadertest_header, inlinkstest_link, OUTerrortt_err )

LANGUAGESQLSCRIPT SECURITYINVOKER  DEFAULTSCHEMAtraXS

AS .....

 

Now if i pass on only one Entity in the POST request as a JSON String with request ..

http://ld9719:8002/traXS/s/odata/CreateHdrLinks.xsodata/Header,

then it works.

But if I pass two entities or an embedded Child entity then i get an error from XS engine, that 'An error occured during processing your request.

 

It could be that I am not getting the right format of the Json string which can work with such Header->Item structure... therefore, I also attach the String here..

{"CLIENT":"555", "IREC_ID":"2","APPLICATION":"CRM","LOGSYS":"HAM504","PAR1_ID":"3272","PAR1_OBJTYPE":"BP","PAR1_OBJKEY":"3272","PAR2_ID":"3273","PAR2_OBJTYPE":"BP","PAR2_OBJKEY":"3273","PAR3_ID":"3274","PAR3_OBJTYPE":"BP","PAR3_OBJKEY":"3274","EMPL_ID":"SCHULZGERO","EMPL_OBJTYPE":"USER","EMPL_OBJKEY":"SCHULZGERO","TEAM_ID":"A-TEAM","TEAM_OBJTYPE":"ORG","TEAM_OBJKEY":"A-TEAM","DESCRIPTION":"This is the beginning","NOTES_LANG":"E","NOTES":"Text","CREATEDBY":"C5017852","STARTED":"\/Date(1386582612000)\/","ENDED":"\/Date(1386582852000)\/","CHANNEL":"EMA","DIRECTION":"I","PARENT_IREC_ID":null,"MAIN_IREC_ID":"1"},"Link":{"CLIENT":"555","IREC_ID":"2","LINK_ID":"01","LNK_TYPE":"SRQ","OBJECT_ID":"800000023","OBJECT_DESCR":"Test","OBJECT_TYPE":"BUS2345654","OBJECT_KEY":"800000023","OBJECT_LOGSYS":"HAM504","CHANNEL":"EMA","DIRECTION":"I","NOTES_LANG":"E","NOTES":"The quick brown fox."}

 

Any suggestions here would be very helpful.

 

Thanks and Regards,

Sumit


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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