Inconsistent CDS Annotation Between DEV and QAS Systems

Months back I received an incident regarding a Fiori Elements application missed one field in QAS system, but worked correctly in DEV system. The FE app was developed by using ABAP Programing Model for SAP Fiori(CDS+BOPF). The disappeared field is rendered via standard annotation which is composed in ABAP CDS view.

Investigations:

  1. Examine annotations which are derived from CDS view and consumed by FE. By comparing annotations generated by both system, I can see the missed field is not presented in the annotation's LineItem section. Thus I am confident FE works as expected; the issue was not caused by frontend. Instead, the QAS backend server was not providing a correct annotation file as defined in the CDS view.
  2. Debug ABAP code of generating annotations based on CDS view. After hours of debugging, I located the main code of generating annotations from CDS view definition. The core method is CL_DD_DDL_ANNOTATION_SERVICE->GET_ANNOS. It receives the CDS view name and exports rudimentary annotations. The annotation defined in CDS view @UI.LineItem for the concerned field can not be found from the results of this method.
  3. Check the code of this method further and realized that the result of this method is actually from a cache table named 'DDANNOLOAD'. By getting the where-used list of this table, I got report RUTDDLSANNOLOAD. Ran it and found an option of cache clean-up. Just cleaned the cache and refreshed the browser, the missed field can be displayed as expected.
After fixing it, the customer told me importing error happened during moving the CDS view from DEV to QAS. And they re-imported it after getting error fixed. But unfortunately, one field disappeared since then. I also have no idea about the root cause. My guess is something bad happened during importing and cached table was not updated based on latest CDS view definition.

Comments