How to correct CDS views manually In Smart Financials?
In Smart Financials we replaced several database tables by views. For this purpose (and additionally for migration of the data) we used ABAP Core Data Services (CDS) views. Currently it is not possible to supply a correction instruction for CDS views. How to manually implement corrections is described in this consulting note.
As some of the former database tables were extensible, the former tables potentially have additional customer specific fields that have to be added to the views. During sFIN Data migration we add these fields to the views using transaction FINS_MIG_REGENERATE. As soon as a correction is applied to these views - either manually or by implementing a Support package - these views are back to the delivery state and have to be regenerated again. In case of implementing a support package this is triggered automatically together with the NewGL generation by an After Import method.
In case of manual corrections, you have to apply the following steps:
Reset CDS views to delivery state
Execute transaction FINS_MIG_REGENERATE by setting the selection parameter ‘Reset to delivery’ to ‘X’ in order to remove all additional fields. The CDS views are afterwards in the delivery state.
Note: Some (customer) reports might contain syntax errors after this intermediate step.
Implement the correction instruction
Implement the correction instruction as usual. This will also change the templates for the generation of the CDS views.
Manually apply the corrections for the CDS view
In this step you manually have to change the delivery state of the source code of the CDS views.
In the you will find
- the ID of the DDL Source (incl. a short text)
- the package of the already existing or new CDS view
- one attachment per CDS view, which is a text file containing the new SQL source code of the view
ABAP CDS views are edited based on ABAP in Eclipse. How to install ABAP in Eclipse is described in 1718399 . In ABAP in Eclipse open the correct system and navigate to the corresponding package. You find the DDL Sources for the CDS views in folder Dictionary / DDL Sources.
a) Correcting CDS Views
Open the DDL Source by double clicking on the ID. Replace the complete source code with the source code as supplied by the corresponding attachment. Save and activate the view.
b) Creating new CDS Views
Create a new DDL Source by right clicking on the folder. Enter the ID, the package and the description (short text) and press next. Create or select a transport request and proceed. Copy the source code as found in the corresponding attachment into the empty source. Save and activate the view.
Regenerate the CDS views
Execute transaction FINS_MIG_REGENERATE by setting the selection parameter ‘Reset to delivery’ to ‘ ’ in order to add all additional fields to the views again.
Note: Afterwards (customer) reports should no longer contain syntax errors.
Transport the Changes
At last you have to transport the changes of the note together with the regenerated views into the subsequent systems. Thereby you ensure that additional fields are transported, too.
Note: Manual Corrections prior to Migration to sFIN
In case you only technically installed sFIN, but did not execute the sFIN Datamigration yet, you can skip some steps. As the CDS views are still in the delivery state, it is not needed to reset the CDS views to delivery state and regenerate the views afterwards. Regerenation of the CDS views is part of the sFIN Datamigration.