Skip to Content

How to create HANA-based expert routines in BW 7.4 SP9 on HANA


Just a short update about which steps are necessary in order to implement a HANA Expert routine/script.


Important: Check out notes 2159872 and all prerequisite notes shown in the correction instructions. Also search for HANA Transformation in component BW-WHM-DST*.

It is now (SP9, in SP8 it works still the old way, just checked it) based on Abap Managed Database Procedures and you can use the editor of the ADT to write them which is a big help for the developer. The editor offers syntax checks and some functionality which couldn’t be used in the earlier SPs.

Create a transformation for a data target which supports HANA transformations.

The targets that support HANA based transformations are as per today:

• (Classic) DSO

• (Classic) SPOs of type DSO


• Openhub Destination

Check if an initial proposal of direct field assignments can be pushed down to HANA by hitting the button:


You should see this message:


The target structure of the example looks like this:


If the transformation can be pushed down, create a HANA expert script:


Determine the ABAP class which will contain the DB procedure as an ABAP Managed Database Procedure:


Copy the name of the class, here TR_0002…JNCXD into the clipboard. You can write it down on paper as well but I personally prefer the first method.

Once the TRFN is active, you can find the class name also under


Search for the class in the ADT within HANA Studio (the ADT must have been installed previously (if you are using the BW Modelling tools, it is).

Switch to the ADT perspective:


and search for the class:


Find the method ‘PROCEDURE’:


and adjust it to your needs:


Activate the method and return to the transformation.

It should look like this:


Create a DTP  and execute it:


Check the result:



Cheers, Philipp

You must be Logged on to comment or reply to a post.
  • Philip

    when I try to edit the ABAP object I get an error “Carry out repairs in non-original systems only if they are urgent” and if I proceed, I’m asked to enter an object access key.

  • Hi Philipp and experts,

    we upgrade the BW on HANA to note 2159872, but the HANA script expert routine in the new created transformations always return the following syntax error:

    Description Resource Path Location Type

      SQLSCRIPT message: return type mismatch: OUTTAB[ /BIC/ZGICW735:NVARCHAR(13) /BIC/ZGICW021:NVARCHAR(4) RECORDMODE:NVARCHAR(1) /BIC/ZGICR002:NVARCHAR(5) ] !=  [ /BIC/ZGICW735:NVARCHAR(13) /BIC/ZGICW021:NVARCHAR(4) RECORDMODE:NVARCHAR(1) /BIC/ /BIC/003N7VA392E61BGS3FLHDX7ZG (Global Class)         [BWD] /BIC/003N7VA392E61BGS3FLHDX7ZG     line 250 ABAP Syntax Check Problem

    • Typically this happens when you miss RECORD field.

      outTab = Select

      All fields to be used from outTab, if at least one field is missing – then you never going to get code compiled. It seems a limitation as logically would be to pass only required fields as not always you’d want to update all fields.

      Last field is always:

      ” as RECORD




      Also example of the lookup (via left join):

      lt_outtab = select 
                         gr_tab."OI_EBELN"                         as "OI_EBELN",
                         gr_tab."OI_EBELP"                         as "OI_EBELP",
                         gr_tab."N1_DATE" - po_tab."N2_DATE"       as "/BIC/LAG",
                         gr_tab."RECORD"                           as "RECORD"
                         from :inTab as "GR_TAB"
                         left join "/BIC/AZD_...2" as "PO_TAB" on GR_TAB."OI_EBELN" = PO_TAB.OI_EBELN and
                                                                  GR_TAB."OI_EBELP" = PO_TAB.OI_EBELP;

      as example with join and lookup:

      outTab = select
               GR."SOURSYSTEM"    as "SOURSYSTEM",
               GR."PLANT"         as "PLANT",
               GR."MATERIAL"      as "MATERIAL",
               GR."CALDAY"        as "DATE0",
               ''                 as "RECORDMODE",
               GR."VENDOR"        as "VENDOR_GR",
               PO."VENDOR"        as "VENDOR_PO",
               PO."SUPP_PLANT"    as "SUPP_PLANT",
              ( select "/BIC/CSYS"
                        from "/BIC/AZD_****2"
                              SOURSYSTEM = GR."SOURSYSTEM" and
                              PLANT      = PO."SUPP_PLANT" ) as "/BIC/CSYS",
              ( select "/BIC/CVEN"
                        from "/BIC/AZD_****2"
                              SOURSYSTEM = GR."SOURSYSTEM" and
                              PLANT      = PO."SUPP_PLANT" ) as "/BIC/CVEN",
               ''                 as RECORD
               from :inTab as "GR"
               left join "/BIC/AZD_****2" as "PO" on GR.OI_EBELN = PO.OI_EBELN and
                                                     GR.OI_EBELP = PO.OI_EBELP;