Skip to Content

Hi,

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

Note:

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

• ADSO

• Openhub Destination

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

/wp-content/uploads/2015/05/1_697107.png

You should see this message:

/wp-content/uploads/2015/05/1_2_697108.png

The target structure of the example looks like this:

/wp-content/uploads/2015/05/2_697112.png

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

/wp-content/uploads/2015/05/3_697113.png

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

/wp-content/uploads/2015/05/4_697114.png

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

/wp-content/uploads/2015/05/5_697115.png/wp-content/uploads/2015/05/6_697116.png

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:

/wp-content/uploads/2015/05/7_697117.png

and search for the class:

/wp-content/uploads/2015/05/8_697118.png

Find the method ‘PROCEDURE’:

/wp-content/uploads/2015/05/9_697119.png

and adjust it to your needs:

/wp-content/uploads/2015/05/10_697120.png

Activate the method and return to the transformation.

It should look like this:

/wp-content/uploads/2015/05/11_697121.png

Create a DTP  and execute it:

/wp-content/uploads/2015/05/12_697122.png

Check the result:

/wp-content/uploads/2015/05/13_697123.png

Enjoy!

Cheers, Philipp

To report this post you need to login first.

13 Comments

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

  1. Rudolph Botha

    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.

    (0) 
  2. Junliang Li

    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

    (0) 
    1. Alex Polyakov

      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

      or

      RECORD 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;
      (0) 
    1. Alex Polyakov

       

      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"
                        where
                              SOURSYSTEM = GR."SOURSYSTEM" and
                              PLANT      = PO."SUPP_PLANT" ) as "/BIC/CSYS",
              ( select "/BIC/CVEN"
                        from "/BIC/AZD_****2"
                        where
                              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;
      (0) 

Leave a Reply