Associate sumitbajaj


In this blog we will discuss on the best practices we need to follow while migrating SAP Commissions from Oracle to SAP HANA


  • Before giving estimation of completion of project, one should consider manual work needed to convert Oracle Objects (Procedures, Packages, Tables) to HANA. Although SAP has provided Tool to convert Oracle SQL code to HANA, but since this tool is designed by keeping generic solution in consideration, we need manual Intervention and SQL Knowledge Convert it Successfully to HANA.
  • We need to consider No of Reports, Types of report (Crystal/Webi) and complexity of each report at the time of estimation.
  • Since many times, Custom Models need to be created using CSN file, we need to keep that also in consideration.
  • Type of Security which was applied in SAP Commissions is entirely different from Oracle security, so need to setup that as well.
  • Since Crystal, WEBI reporting solutions are entirely different from SAC(Embedded)Solutions, so some of the functionalities of Crystal and WEBI does not match with SAC , so finalising design with client as per SAC should be kept in consideration.

Converting Oracle Objects to HANA

Once you have converted Oracle object to HANA using Oracle to HANA migration Tool, you need to manually adjust below query changes.

  • Prefix Schema name (EXT, TCMP etc) before every Table/Procedure name.
  • Data Type Number (Oracle) should be changed to Integer (HANA).
  • Exception Handling in Oracle is done at end of procedure but in HANA it is done at beginning after Begin Keyword.
  • Comment all unnecessary statements starting with EXECUTE IMMEDIATE.
  • Comment all unnecessary CREATE STATISTICS statements.
  • Comment All Partitioning statements if it is not needed as HANA database is strong enough to handle slow processing automatically.
  • Change keyword localtimestamp(6) (Oracle) to CURRENT_TIMESTAMP(HANA).
  • Change TO_CHAR() to TO_NVARCHAR().
  • Change TO_NUMBER() to TO_INTEGER().
  • Instead of Hardcoding tenant id, store the tenant id system in variable and use it in procedure.

select tenantid into v_tenantid from TCMP.CS_TENANT;

  • Try to Push down all the logics written at reporting tool level to procedure level, so that report processing will be fast.
  • Run the Procedure manually and ensure that data in oracle tables is matching with HANA tables.

Creating views on top of HANA Tables

Custom data models in SAP Commissions are built by creating SQL views in Web IDE.

SAP commission database has two default schemas EXT and TCMP. The custom data models that need to be exposed to embedded analytics in SAC should be in EXT schema.



  • Ensure that Views have minimum logics/Calculations. All Calculations should be handled at Procedure level for better performance.
  • Ensure to Apply Structured Privileges to views, so that Employee /Manager can see correct data as per their role.
  • For better Visibility and maintenance, try to Keep column sequence of View similar to sequence of base table.

Creating CSN file using views

Custom data model is exposed to Embedded Analytics SAC by creating a CSN file. The CSN file is a JSON format that defines the metadata necessary for the physical tables and views. These tables and views are exposed in the Embedded Analytics for SAP Commissions UI.



  • Context of the CSN file must be set to EXT.
  • CSN file must have at least one measure.
  • Rather can creating multiple CSN file, try to add multiple models in single file for better maintenance.
  • @Common.Label annotation must be before @analytics query annotation.
  • For better Visibility and maintenance, try to Keep column sequence of CSN file similar to sequence of base view.
  • Before replacing the old CSN file with new one, download the copy of Old File in local so that, if anything went wrong, changes can be easily reverted.


Creating Story in Embedded Analytics 

  • Since Suppression is not supported in SAC, we need to use Widget level filter to filter data as per user.
  • Use Multiple Table in same page and filter each table (Widget) with specific condition (Similar to grouping in Oracle) to implement Suppression Logic.
  • Keep Design crisp and clear.
  • Try to Avoid doing calculation at story level.
  • To Export the data in PDF, try to use Batch Export functionality in SAC.

File –> Export–> Batch Export by Story Filter (Uncheck Insert Appendix) –> Select a filter and click on Export.

  • Book the story so set it as Default and Global, so that when users opens it , it will always open in default state.
  • Try to set Page width , size, so that when report is exported to PDF or Printed, it will have proper visibility.
  • Try to restrict data using Page filters.

For other SAC Best Practises, you can refer to below Blog

Conclusion: You can use the standard models provided out of the box to create custom stories/dashboards as per your needs.

More information about embedded analytics for commissions can be found here . Please feel free to provide any feedback you have in the comments section below and ask your questions about the topic in sap community using this link.

SAP SuccessFactors Incentive Management   SAP Analytics Cloud, connectivity   #SAP Analytics   SAP HANA Cloud, SAP HANA database