Hi Folks,

Recently, i got a request from one of my customer asking to schedule SAP HANA procedures. We discussed a couple of alternatives. One is to use Linux cron jobs , other is similar, windows task scheduler and also XS job scheduler, but we need something part of our BW world.  Then i decided to create a simple link between SAP BW and HANA procedures. To do that i used AMDP approach. You may find further information about amdp from here

You need to install ABAP for Eclipse plugin to your SAP HANA Studio in order to start development. This can be found here. I recommend to check this document also to get familiar to abate development for hana.

1. First create an ABAP project ( if you don’t know how to create it, refer to this link )  , then add an abap class.

ABAPClass.PNG

2. This class will be our proxy between ABAP layer and HANA DB procedure. As you can see there is an input parameter for the ZBW_MTRC_AMDP_SP_CALL procedure.

ABAPClassDetail.PNG

3. In order to activate ABAP class, you need to create  HANA SP first. Our HANA SP is simple, just the sp that will be called from ABAP layer. Here my intension is to keep it simple as it is possible, you my add dynamic schema name, output parameters to your sp that will return back to ABAP layer.

Procedure.PNG

4. After your AMDP ABAP Class is activated you can also check it from SE24 as read only. You can not edit AMDP classed from SAP GUI.

ABAPClass_Valide.PNG

5. Then create a simple program from SE38 that will be used in process chains with variants later on. Again you can extend scope and functionalities of program according to your requirements. 

ABAPPRogram.PNG

6. Create a variant by running the program.

Variant.PNG

7. then create a BW process chain and add ABAP program from general services.

PC.PNG

8. Then specify program and its variant.

PCVariant.PNG

9. Schedule your process chain as desired!.

I hope it helps in your SAP HANA Journey.

Enjoy!.

Baris Cekic.

@cekicbaris

To report this post you need to login first.

11 Comments

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

  1. Anand Daulat

    Hello Baris,

        This document is very helpful! I’m currently working to try and implement your example in order to see if we can use an AMDP to work with one of our BPC process chains. When trying to run your example however, I’m receiving errors that are show in the images below. Do you happen to know what I’m doing wrong here? Thanks a lot for your help!ABAP Class Code.pngABAP Class Code Error.pngProcedure SQL Script.png

    (0) 
    1. Baris Çekic Post author

      Hi Anand,

      you have forgotten ” : ” in your AMDP near IN_SPNAME

      Instead of

      call your_sp_name(in_spName);

      it should be

      call your_sp_name( :in_spname);

      (0) 
  2. Anand Daulat

    Hi Baris,

    My issue is with what exactly I need to input to the ABAP program. I believe that I’m passing my input parameter using the wrong format. Please bear with me, as I am not an ABAP programmer! Any help would be much appreciated! Please take a look at the screenshots. Thanks!

    ABAP CLASS – ZCL_BPC_AMDP:

    ZCL_BPC_AMDP ABAP Class.PNG

    HANA PROCEDURE – ZPROC_BPC_AMDP:

    ZPROC_BPC_AMDP HANA Procedure.PNG

    ABAP PROGRAM – ZBW_BPC_AMDP:

    ZBW_BPC_AMDP ABAP Program.PNG

    This is my issue!! —–> INPUT of SP Name: (I’ve tried with and without the schema):

    ZBW_BPC_AMDP ABAP Program Input Parameter.PNG

    ABAP PROGRAM ERROR:

    ZBW_BPC_AMDP ABAP Program Runtime Error.PNG

    (0) 
    1. Ferhat Bakan

      Hi Anand,

      You have infinete loop over there. you are calling SP from abap and your Sp is also calling itself.

      You are calling ZPROC_BPC_AMDP which call it again in procedure. There is a logical error.

      Second, there seems to be a security error. You have to read and execute access to _SYS_BIC schema. your user name should be the SCHEMANAME of SAP NW installation.

      (0) 
  3. Rakesh Kumar Bhure

    Hi,

    I am getting the authorization error upon executing the program in SE38. I think some auth is missing in HANA for user SAPXGQ. Anybody have any idea on this?

    ADMP error.PNG

    -Rakesh

    (0) 
    1. Ferhat Bakan

      Hi Rakesh,

      the procedure described in my entry was under the schema _SYS_BIC , therefore your SAPXGQ user in HANA should have been authorized for _SYS_BIC.

      to do it, logon with SYSTEM user and run the following command.

      GRANT SELECT on SCHEMA “_SYS_BIC” to SAPXGQ;

      GRANT SELECT on SCHEMA “_SYS_REPO” to SAPXGQ;

      (0) 
        1. Fernando Mora

          Hi Rakesh,

          were you able to solve the “insufficient privilege” error?

          We are trying to implement this solution and keep getting the same error. Any feedback would be greatly appreciated.

          Thanks

          Fernando Mora

          (0) 
          1. Rakesh Kumar Bhure

            Hi,

            Please check what all operations(SELECT. INSERT, etc..) you are doing in procedure for the schema and make sure you assign all those access to the BW user ( SAP* in HANA) which calls the procedure when you execute it thru SE38 program.

            Hope this will help you.

            Thanks

            (0) 

Leave a Reply