1

We got a problem with SAPUI5 service maintenance. After making changes in service entities through SEGW transaction, the metadata that loaded in GW client stays in the state of before changes.

For example, there was a field of a date changed into string, and GW throws errors of invalid or no mapping to system data types found. The cause is an attempt to put string-date value like '16.05.2019' into date type (the metadata of the entities is not refreshing somehow).

We tried to refresh those caches:

  • Index recalculate
  • Smicm
  • Global caches

Via:

  • /iwfnd/cache_cleanup
  • /ui2/invalidate_global_caches
  • /ui5/app_index_calculate

We also reloaded the metadata and even deleted the entity and recreate it - all of it failed.

In /IWFND_GW_CLIENT transaction the updated metadata is shown.

Only recreating the entity with different name seems to solve it but it does not seems like a good way to maintain a service...

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Dorad
  • 3,413
  • 2
  • 44
  • 71
  • "We tried to refresh any known cache" could you specify this with a list of things you definitly did? – futu May 16 '19 at 15:58
  • @futu sure. i was chosen to ask a few questions for my team and we all left the office until sunday. i will try to ask them and respond here ASAP. – Dorad May 16 '19 at 16:02
  • @futu i completed the missing info. – Dorad May 16 '19 at 16:18
  • If you test the app in a private browser tab and it works, then it's likely the issue is the browser cache. Have you tried that? – fabiopagoti May 16 '19 at 16:44
  • 1
    yes. and It fails before the browser level, while debugging the sap code in the GW we could see the old metadata loaded in the code before it arrives to the browser – Dorad May 16 '19 at 16:48

1 Answers1

3

/IWFND/CACHE_CLEANUP is the only relevant for OData, the other caches are for deployed UI5 applications. if you are in a GatewayHub environment with multiple backend systems you must run the transaction on both systems.

If the transaction does not do it, there is another cache cleanup for both systems, that is implemented differently by SAP. Here is what I do after changing a service in SEGW backend system:

  1. Backend SEGW: regenerate runtime objects
  2. GatewayHub (GW) /IWFND/GW_CLIENT execute /sap/opu/odata/ZyourService_SRV/$metadata. Service without changes
  3. in same transaction in the top menu: Metadata -> Cleanup Cache -> on both systems
  4. execute again /sap/opu/odata/ZyourService_SRV/$metadata. Service with changes
  5. Now there is only a browser cache left in the frontend that could have outdated information. Normally, a hard refresh of your app should make the browser reload the metadata. In the Chrome browser's developer console, within the tab Network you can also disable caching while console is opened.
  6. For the latest GatewayHub systems SAP has introduced Odata caching with CacheBuster and a program that should be planned periodically

To ensure the tokens are up-to-date, report /UI5/UPD_ODATA_METADATA_CACHE has to be executed periodically.

futu
  • 868
  • 6
  • 12
  • thanks @futu. Looking forward to try it. I will notify you on Sunday about the results... – Dorad May 16 '19 at 18:51
  • We tried and that didn't work. I will ask my colleagues to write their summary and I will update you. – Dorad May 20 '19 at 13:10