cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAI API response empty

08-09-2020 11:20 AM
1990 views 7 comments
0 Likes
SAP Managed Tags
Subscribe

Hi,

I am using a simple ABAP backend API service to add two numbers. The configuration in CP is fine. The app link in CP also works fine as below

Am using the API service as below. Currently am not passing memory variables here. But just trying to print the above "Sum" as a static result. The response {{api_service_response.add.body.d.Sum}} comes as empty and so is the {{api_service_response.Add.body.status_code}}. It's silly I know. Am I missing something basic here?

0 Likes

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Likes

Hi Sujin,

I am facing the same issue. If you are able to find the solution, please do post the same here for reference

former_member306391
Participant
0 Likes

Hi,

Looks like the call is not getting through to backend. I have tried using the backend service URL too directly, instead of cloud platform approuter link. No results.

dtephan
Advisor
Advisor
0 Likes

Hi Sujin,

first, there is a small glitch in your statement for the status code, it contains the body segment which is incorrect - could you try {{api_service_response.Add.status_code}}?

Could you call your ABAP backend via postman, curl, etc and provide the response structure here?

Best,
Stephan

Sujin_Appukuttan
Participant
0 Likes

Hi Stephan,

Thank you for the reply. Well, here is the postman json result you asked for.

Also, below am pasting the approuter's app json file ie zipped and uploaded in "deploy application". I was thinking of appending
"?$format=json" to the target below.

Sujin_Appukuttan
Participant
0 Likes

Hi Stephan,

I see that was the typo from my side. My bad. Am able to see the status_code. But not the "Sum" with - {{api_service_response.Add.body.d.Sum}}

Regards,

Sujin

rohit_singhal
Active Contributor
0 Likes

Hi Sujin,

I think there is an issue with the URL that you are using in CAI.

I only see the server URL in your screenshot, however the service path and name is missing in the URL. If it is an ABAP OData Service, the URL should be along the lines: https://<masked server name> or <hostname>:<port>/sap/opu/odata/sap/<ServiceName>/<EntitySet>

Please let me know in case you still face an issue.

Best Regards,

Rohit

former_member306391
Participant
0 Likes

Hi Rohit,

The remaining part apart from Hostname & port is added to the app json file. Below is excerpt app json. This is then zipped and deployed to application with xsuaa + connectivity instance.