Skip to Content
0
Aug 03, 2022 at 12:05 AM

How to use fields from oData $Batch call response in SAP CAI

275 Views Last edit Aug 03, 2022 at 01:00 AM 3 rev

Dear Experts,

Greetings!

I am building chatbot interaction in SAP CAI.

I am reusing api designed for fiori use and need to make $batch call to get required data from SAP. This $batch returned lots of addition $batch call related information besides json response contained in it. I am not able to use this $batch call response using syntax {{api_service_response.default.body.d.fieldname}}. How to use STATUS field value from $batch call response. Highly appreciate your help in making this work.

Thank you in advance.

Nilesh

my $batch call response is like this:

--0019833333333

Content-Type: multipart/mixed; boundary=00198C6D80DA8DAD05DA0CBAD2C2FBF01

Content-Length: 3104

--00198C6D80

Content-Type: application/http

Content-Length: 7777

content-transfer-encoding: binary

HTTP/1.1 201 Created

Content-Type: application/json

Content-Length: 7777

dataserviceversion: 2.0

accept: application/json

user-agent: PostmanRuntime/7.28.4

accept-encoding: gzip, deflate, br

b3: 99999999

cookie:

...

...

traceparent: 99999

tracestate: 9999999999

x-b3-spanid: 999999999

x-b3-traceid: 99999999999

x-cf-applicationid: 9999999999

x-cf-instanceid: 999999999999

x-cf-instanceindex: 999

x-dynatrace: FW4;-99999999999999999

x-dynatrace-application: v=2;

x-dynatrace-requeststate: agentId=999999999

x-forwarded-for: 99.999.99.99

x-forwarded-port: 9997

x-forwarded-proto: https

x-request-start: 4466777

x-ruxit-forwarded-for: 177.55.54.55

x-scp-request-id: 55555556677

x-vcap-request-id: 44556666

sap-client: 999

host: dxxxxxx:9999

location: https://dxxxxxx:9999/sap/opu/odata/sap/ZOD_XXXXXXXXX_SRV/SxxxxxSet('--vbeln---')

{“d”:{“__metadata”:{“id”:“https://dxxxxxx:9999/sap/opu/odata/sap/ZOD_XXXXXXXXX_SRV/SxxxxxSet('--vbeln---')”,“uri”:“https://dxxxxxx:9999/sap/opu/odata/sap/ZOD_XXXXXXXXX_SRV/SxxxxxSet('--vbeln---')”,“type”:“ZOD_XXXXXXXXX_SRV.SxxxxxSet”},“IHREZ”:“R0000000346",“VBELN”:“--vbeln---",“AUART”:“FR”,“SELECT”:false,“EBELN”:“”,“LIFSK”:“Released”,“SO_DATE”:null,“IDOC_DATE”:null,“IDOC”:“”,“RCVPRN”:“”,“REC”:“”,“STATUS”:“Action successful Genarated Idoc number : ---idoc no-----”,“SxxxxxToXPUDet”:{“__deferred”:{“uri”:“https://dxxxxxx:9999/sap/opu/odata/sap/ZOD_XXXXXXXXX_SRV/SxxxxxSet('--vbeln---')/SxxxxxToUDet”}}}}}

--00198C6D80--

--0019833333333--