-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling function import from SAP Cloud SDK returns an empty object #682
Comments
Hi @miyasuta , thank you for creating an issue in this repo. We are working on a similar bug about the functional import. We will let you know for the updates. |
Hi @florian-richter , here is another example for the bug of the function import, where cap is used. |
@miyasuta, please note that this repository has been moved and the link to this issue has changed. |
Hi @miyasuta, we fixed this bug and made a new release last week. |
Hi @jjtang1985, Thanks for the update.
I have tested in the new version, but unfortunaltelly, the result didn't change. |
Hi @miyasuta , I checked out your repository and tested. I found out the root cause of your issue, which is the edmx file you used for the generator. Your data provider is the CAP service that is using OData V4, while the edmx does not match. I fixed the edmx file and re-generated the OData client again, the endpoint gave me the data:
Please follow the steps below so you can have your application running:
Please let me know, if this helps. |
Hi @jjtang1985 Thanks for your advice. My project is now working for OData v4 as well as v2. I have another project which has the same issue. It is based on Gateway OData service (v2). Below information is for your reference. From Geteway
From CAP (v2)
edmx file
function-import.ts
controller
|
Hi @jjtang1985, The Geteway service which I'm using is a custom OData service created at S/4HANA on-premise. |
@miyasuta I have made a little test on our dev ERP system and I can reproduce the issue and receive a payload like:
for a function import named Thanks for bringing this to our attention. |
I created a question on: https://answers.sap.com/questions/13199175/unexpected-key-function-import.html |
@miyasuta I also tried |
@miyasuta , as Frank mentioned, only the complex type as return type is affected. I created a ticket in the back log for discussing this issue. Before that, I also would like to ask some questions.
I will update here after our discussion. |
Hi all, Thank you for your investigation. I will try using entity as return type, and update here. |
Hi all, |
good to hear. Of course it should also work with the complex type. I will keep this issue open and add either the PR from us that we handle the complex type case or how to adjust the S/4 system so that it does not add this extra key. |
Since there is a work around we will close this one and see if we see more customer demand for a proper solution. |
Dear @FrankEssenberger , I've posted today the question Structure returned by V2 adapter proxy does not match V2 result of S/4HANA backend. The service used there is the standard S/4HANA (Cloud) API: API_CV_ATTACHMENT_SRV. It has the function import GetAttachmentCount which is returning:
As I've tested against our S/4HANA system and as it is documented on api.sap.com. So yes, I would like to have a proper solution for this issue if it still exists for the SAP Cloud SDK for JS. If needed I can also file an SAP incident. Best regards |
Hi @gregorwolf , thanks for raising this up. Although the deserializeComplexType(yourResponse.data.d.GetAttachmentCount, YourComplexType) Please share, whether this can solve your issue. I created a backlog item for the API design, as this seems to be a common issue. Best reagards, |
Hi @jjtang1985 , I had the same kind of issue as @gregorwolf on prem system.
This is solved my problem, I got the result as I wanted. Do you consider applying this to the "execute Function" ? Regards, Zafer |
Hi @miyasuta, @gregorwolf, @zfrk, We implemented the feature in Take the following response as an example: {
"d": {
"GetAttachmentCount": {
"AttachmentCount": 0
}
}
} Now, you can pass functionImportsRequestBuilder.execute(
destination,
data => data.d.GetAttachmentCount
); I hope it can help you solve the problem. Please re-open the issue if you have any further questions. Best regards, |
Describe the bug
Calling a function import from SAP Cloud SDK returns an empty object, even though the call is successful.
You can reproduce the issue by using the following git repository.
https://github.com/miyasuta/sdk-function-import-test
To Reproduce
Steps to reproduce the behavior:
sap-cloud-sdk generate-odata-client -i service-specification/ -o odata-client/
However, the response object is empty.
Expected behavior
Response object should be filled with returned data.
Screenshots
![image](https://user-images.githubusercontent.com/39408125/98360018-7667c100-206c-11eb-8b0b-8f270dd95fe9.png)
Calling the OData function import directly
Calling function import from Cloud SDK app (delivery data should be returned between {})
![image](https://user-images.githubusercontent.com/39408125/98360064-8e3f4500-206c-11eb-8c73-008e2678384e.png)
Used Versions:
node -v
: 12.16.1npm -v
: 6.14.4Code Examples
My controller code is as below.
Log file
No error has occurred.
Additional context
None
Please check the following points
The text was updated successfully, but these errors were encountered: