In HANA development, if you happen to have a need to perform same modifications to the model multiple times in the same model or copy them over to different models, then XML editing would help you save a lot of effort.
In cases like, if your data is based on “Account model”, but the reporting requirement is “Key Figure model”, then you may end up creating a lot of Restricted Key figures and Calculated Key figures. Or consider a case, when the data model contains more than 70 – 80 key figures and you need to apply currency conversion to these Key figures, then the XML editing can help you reduce a lot of manual effort.
If your XML coding skills are advanced, then it can certainly help model large UNION operations, which in current eclipse editor can certainly be painful and may result in hanging the HANA studio.
And in case, if you don’t have any such requirement mentioned above, it would still help you look into the generated XML for the HANA information models to understand how different settings like Default schema, Default Client, Default Language, various input parameters, variables, data sources etc are mapped.
The XML file can be generated from the right hand side option as shown below, but I prefer the EXPORT functionality so that the same file can be imported back after editing.
The EXPORT / IMPORT option can be found in HANA Studio as shown below. A detailed document on how to use the EXPORT / IMPORT functionality can be found at http://scn.sap.com/docs/DOC-26381
For the demonstration purpose, let us consider a data model with
The model can look like :
The Key Figure (C_SALES) has been defined as Amount with Currency with Dynamic Currency conversion as shown below. Such setting can be copied to the other Key Figures in the generated XML file. This can save considerable effort as compared to performing the modifications in HANA Studio, when the number of Key figures to be modified are significantly high.
Please note that the Schema for currency conversion has been hidden in the screenshot above.
The setting in the XML file can be seen in the following screenshot.
The changes to be done for the Key Figures C_SALES_1, C_SALES_2, C_SALES_3 are as follows:
After the re-import of the XML file, the changes can be seen in the Key Figures C_SALES_1, C_SALES_2, C_SALES_3 as follows:
Please note that the Schema for currency conversion has been hidden in the screenshot above. The same technique can be used to create additional Key Figures in the model as mentioned below.
Additional Key figures can also be created by copying the existing code blocks for Restricted and Calculated Key figures and modifying the technical name, description and filter / expression conditions. For simplicity, we can copy the existing RKF and CKF and modify the filter conditions and calculations.
To add a Restricted Key figure with Sales for 2013, the XML file can be modified as shown below. The <measure> block can be copied and modified as shown in the screenshot below:
The measure id, description and the restriction values (including the attributes) can be modified after copying. The same concept can be applied for the Calculated Key Figures as shown in the below screenshot. The <measure> block can be copied and modified for the new Calculated Key Figure.
After the modification to the XML file, it can be re-imported and the view can be VALIDATED and ACTIVATED in HANA Studio. The validation process can identify any error in the imported model and can be corrected. The generated model can look like:
Apart from the above mentioned use cases, there could be multiple other use cases, where the XML file modification can help you in the development.
So I leave it to your better judgement on the alternative approach, which can help you reduce your development effort. :smile:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |