on 04-15-2014 8:54 AM
Dear all,
Deep insert functionality works like a charm for XML but not for JSON. I dont know where i went wrong. Can you please help?
I referred similar threads on this and I removed "results" tag from the request.
JSON data:
var data_json = {
"d":{
"__metadata":{
"uri":"http://xxxx.xxxx.com:8000/sap/opu/odata/sap/Z_SRV_CL_FLIGHT_DETAILS/Airline_Details(CARRID='AA',CONN...')","type":"Z_SRV_CL_FLIGHT_DETAILS.FlightDetails"},
"CARRID":"AA",
"CONNID":"1234","FL_TO_BOOK_LIST":[{
"__metadata":{ "uri":"http://xxxx.xxxx.com:8000/sap/opu/odata/sap/Z_SRV_CL_FLIGHT_DETAILS/Booking_Details(CARRID='AA',CONN...')","type":"Z_SRV_CL_FLIGHT_DETAILS.BookingDetails"},
"CARRID":"AA",
"CONNID":"1234",
"BOOKID" : "8000"}]}};
Request payload is attached.
Should I implement this SAP note # 1874920 for the following system release too ?
GW_CORE 200 0005
IW_BEP 200 0005
IW_FND 250 0005
Please suggest .
Regards
Prabaharan
Try something like
"d":{
"FIELD1":"XX",
"FIELD2":"SSS",
"NAVIGATION_PROP_NAME":[{ "DFIELD1" : "VAL1" ,
"DFIELD2" : "VAL2"
}, {
"DFIELD1" : "VAL1" ,
"DFIELD2" : "VAL2"
}]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Atanu,
I tried your suggestion but still same error. I am passing "Content-Type" as json but its throwing me XML error and the return type is "application/xml".
Do we need to apply these 2 notes?
1874920 - Error in "deep insert" case when parsing JSON
1751991 - OData Channel - Deep Insert in JSON Format Leads to Error
Thanks for your help.
Regards
Prabaharan
Hi Atanu,
Also i am getting in below method. Is this same as "Error while parsing an XML stream" (CX_SXML_PARSE_ERROR exception)" explained in Note 1751991(1751991 - OData Channel - Deep Insert in JSON Format Leads to Error).
method CONSTRUCTOR .
if ( type <> if_sxml~co_xt_xml10 and
type <> if_sxml~co_xt_binary and
type <> if_sxml~co_xt_xop ).
raise exception type cx_sxml_illegal_argument_error
exporting
textid = cx_sxml_illegal_argument_error=>illegal_xml_type.
endif.
me->if_sxml~type = type.
endmethod.
Regards
Prabaharan
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.