Closed soumyachitnis-sap closed 4 months ago
Yes, this is intentional, indicated by the fetch
prefix in the method name. There should be an alternative getEnterpriseProjectElementOrFetch()
method that only performs the request, if the data hasn't been downloaded yet.
Hello Colleagues,
We were writing integration tests for our integration code which pulls data from S/4 Cloud when we noticed the below behavior which looks inefficient.
We are currently pulling enterpriseProject and ProjectElements data from the API /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV;v=0002/A_EnterpriseProject
With the above call we also expand the child entity 'ProjectElements' and read the necessary data from the child entity with the methods provided by VDM services.
But despite fetching all the required fields from the child, when we begun reading the entire set of data read from S/4 Cloud as below
the method fetchEnterpriseProjectElement() actually makes another unnecessary OData call - a roundtrip to get the relevant projectElement data.
We observed this when we were writing integration tests using wiremock. Despite already providing the stub for project and projectElement together it actually made another roundtrip and making the test fail.