Open absmh opened 3 days ago
Hi @absmh,
Are you trying to access the OData service on an on-premise system or a Cloud system? Could you please cross-check with this guide, to see if your set up with Business Application Studio is right?
The code snippet looks good to me, so if there is an issue while retrieving data you should ideally get an ODataException
.
Do you have any additional code in a catch
block to return gracefully in case of failures?
Would it be possible to get debug logs or debug your application to see what exactly happens? And if the OData service itself is returning these empty results?
Regards, Kavitha
Hi @KavithaSiva , Sorry for the late reply. Thank you for your comment.
I am trying to access an OData service on an on-premise system.
I checked the guide and there seemed to be no problem with the Business Application Studio setup.
I omitted this in the source code I provided, but the part where the data is retrieved is surrounded by a try-catch so that the ODataException can be caught. There is also an outer try-catch so that other exceptions can be caught. However, when I run the program, no exceptions occur and it ends normally, so I cannot find out what is wrong.
try{
・・・
try{
final List<StorageLocationData> result = service.getAllProductStorageLocation().executeRequest(destination);
}catch(ODataException e){
//Outputting logs
throw new ODataException(e);
}
・・・
}catch(Exception e){
//Outputting logs
throw new Exception(e);
}
If the code snippet is correct, are there any other possible causes? If there are any points that I should pay attention to, such as environment settings or permission settings, I would appreciate it if you could let me know.
Thank you,
Issue Description In SAP Business Application Studio, I am developing a Java program that uses SAP Cloud SDK to send a GET request to ODATA to retrieve data. When executing a GET request, some ODATA successfully retrieves data, but there is an issue where an empty object is returned for some ODATA. Even if an empty object is returned, no error occurs and the program ends normally. In addition, when executing a request with the SAP standard transaction code "/n/IWFND/GW_CLIENT" or Postman for the problematic ODATA, data can be retrieved without any problems. Data cannot be retrieved only when calling from SAP Business Application Studio.
Has there been any confirmed occurrence of such an issue to date? *Due to confidentiality reasons, I cannot share the details of the project, so I am providing the minimum information possible to start with. I will add more information as necessary.
Supplementary Information --ODATA for which data cannot be obtained: 1)ODATA:API_PRODUCT_SRV Entity:A_ProductPlant、A_ProductStorageLocation、A_ProductValuation 2)ODATA:API_COSTCENTER_SRV Entity:A_Costcenter 3)ODATA:API_MATERIAL_STOCK_SRV Entity:A_MatlStkInAcctMod 4)ODATA:API_GLACCOUNTINCHARTOFACCOUNTS_SRV Entity:A_GLAccountText
--Sample source code: Here is the source code to execute a GET request on API_PRODUCT_SRV.A_ProductStorageLocation.
--SDK version: <5.14.0> --Project type: MTA project --Development environment: SAP Business Application Studio