From BW 7.4 on HANA, SAP provides options to push the ABAP logic to HANA, by rewriting the ABAP code using HANA script. The purpose of the code push down is to leverage the in-memory capabilities of HANA to boost performance. SAP terms it as HANA Optimization.
In our recent BW migration project, we measure the performance of HANA optimization. After migrating the BW system to HANA, we measure a typical DTP which contains a start routine, written in ABAP. The performance does not improve much after migrating to HANA, say 15-20% improvement. We then rewrite the Start routine in HANA script, the performance gain was enormous, with the run time of 2 billion records improve from 6 hours to 3 minutes.
For detail Hana Script syntax and use case example, refer to https://help.sap.com/doc/6254b3bb439c4f409a979dc407b49c9b/2.0.00/en-US/SAP_HANA_SQL_Script_Reference_en.pdf. Here we describe the steps to create a HANA Script.
All development works are to be performed in the transformation routine. The HANA optimization coding must be developed in the BW Eclipse based modeller, while the other steps could be performed in the original SAPGUI transaction, RSA1.
- Double click on the transformation which contains customized ABAP code. The Runtime status field should be “Only ABAP runtime is supported” or not.
- Delete all ABAP start routine, end routine, customized field routines which are not supported in HANA optimization mode.
- Once all Start, End and field Routine are deleted, the Runtime Status should be changed to “ABAP and HANA runtime are supported” after save action.
- Create new HANA routine.Click on any one of the “Start Routine”, “End Routine” or “Insert Rule” in target field, then press “Continue”. The following screen will be prompted to select type. Choose “AMDP script” to create Hana script window.
- HANA Script could only be coded in the Eclipse based ADT.
After all code completed and syntax check, you should be able to activate the HANA script.
6. Go to the corresponding DTP process. Check the attribute ‘SAP Hana Execution’ and select processing mode “Parallel SAP Hana Execution”. Now you can run your DTP using the newly developed HANA optimized script.