HANA Triggers

I was wondering if it would be possible to have a trigger that whenever a row is inserted or updated in Table A, it automatically creates another row in the history table with that same data as in table A, except with one additional column which is a sequence? Any help on this would be appreciated. How would the SQL script to create this look?
Thanks,
Connor

Hello,
There is a CREATE TRIGGER statement. Here you can find more details with examples:
https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/d5a65575191014946db96aaedbef5b/content.htm
Hope this helps.
Lukasz

Similar Messages

  • Event triggers from HANA to sharepoint

    Hi All,
    Is it possible to create a trigger in HANA that on creation of a new row in a particular table, creates an event that goes to a sharepoint portal  and triggers a mail and a push notification to MS BI mobile users?
    Please let me know how that would work.
    Thanks,
    Shyam

    Hi,
    I have the same req, we did like below the problem is resolved.
    1. Craete Event in SM62 in BW , Event name = ECCTOBW.
    2. Assign that Event in BW and give Parameter name = ECCTOBW_P. (Param is directly give in BW)
    (In Case of dataloads, create Process chain and give thios Event and Parameter in Start-->Event) and Activate and Exexute the Processc Chain.
    3. Then Run the below program in ECC then check your processc hain, it will trigger.
    This is the way how to use the Events triggers in different system.
    REPORT  ytestrd1tobd1.
    CALL FUNCTION 'RSSM_EVENT_RAISE'
      DESTINATION 'BWCLNT' ------------> Here give your BW system ID
      EXPORTING
        i_eventid              = 'ECCTOBW'
        i_eventparm            = 'ECCTOBW_P1'
      EXCEPTIONS
        bad_eventid            = 1
        eventid_does_not_exist = 2
        eventid_missing        = 3
        raise_failed           = 4
        OTHERS                 = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Thanks
    Reddy

  • How can I re-load a table into HANA using SLT

    Hi,
    I am using HANA Version: 1.0.24 and SLT SAPK-91705INDMIS.
    I have replicated several tables without any problems in this environment. However, when I tried to replicate T009, T009B and T009C; two tables T009B and T009C show status of replication as "Error" in both LTR and Hana Studio. Table T009 is replicated correctly.
    I noticed that the table structure for T009B and T009C is created in HANA but there is no Data. Not sure what happened during replication. It seems to have stopped in between due to some error and now I have Table structures but with no data. I have tried suspend / stop and replicate but it keeps shown status as 'Error'.
    Tcode LTR on SLT system shows following warnings
    "Trigger exists in Source System although it is internally set as initial" for both tables.
    I just want to start again and redo the load/replication of these two tables. What is the process of doing so?
    Thanks
    Sandeep

    Hi Sandeep,
    I cannot comment on the officially supported way of deleting these triggers. Maybe the following will work,
    Run the below command from SQLEditor:
    insert into <schema>."RS_ORDER" values(<your_table>, null, 'C');
    delete from <schema>."RS_STATUS" where TABLENAME=<your_table>
    Although I think it should delete source triggers(but not sure). You do the cleanup from SLT (transaction IUUC_SYNC_MON)-->Expert Functions --> 'Delete DB triggers' , 'Delete Logging tables entries' and 'Delete Logging tables' for your table.
    Also after doing this, you can check in source system (transaction IUUC_REMOTE) if triggers for your table are deleted.
    Caution Again :-): I don't know if the above method is a documented and officially supported one.
    Regards, Rahul

  • Not able to create row in HANA via .create or ajax call (oData Services)

    Hello Experts,
    SYSTEM: AWS (Amazone Cloud with HANA SPS06), tunneling via VPN. My HANA-Studio is rev.70 with the "Kepler" addons. I´m the owner of this Schema and granted the necessary privliegues to the __SYS_REPO User.
    The following issues when I try to add a row with SAPUI5 - GUI:
    The following code are in the index.controller.js implemented and triggered by a button:
    Further to the developer guide (SAPUI5....) there is a create Statement to add rows into the Table in HANA. I tried the following:
    //Einfacher Datensatz welcher in die HANA geschrieben werden sollte:
    var oModel = new sap.ui.model.odata.ODataModel 
    ("..(censored)../BL_TI/2005/zaginfothek/Opportunities.xsodata", false);
    var oEntry = {};
    oEntry.id = 7777;
    oEntry.LfdNr=1;
    oEntry.Customer=2;
    oEntry.Thema=3;
    oEntry.Leadueber=4;
    oEntry.Owner=5;
    oEntry.MarketDeveloper=6;
    oEntry.ThemenfokusnachBL=7;
    oEntry.Industry=8;
    oEntry.PDs=9;
    oEntry.Revenue=0;
    oEntry.Probability=1;
    oEntry.ProbableRevenue=2;
    oEntry.Start=3;
    oEntry.Finish=4;
    oEntry.Duration=5;
    oEntry.Phase=6;
    oEntry.Status=7;
    oEntry.ATPDecision=8;
    oEntry.Date=9;
    oEntry.SupplyChain=0;
    oEntry.Technology=1;
    oEntry.Region=2;
    oEntry.Kontaktquelle=3;
    oEntry.CASStatus=4;
    oEntry.Angebotsnummer=5;
    oEntry.Archiv=6;
    oEntry.Angebotabgelegt=7;
    oEntry.LeadmeldunganSAP=8;
    oEntry.ArtderAnfrage=9;
    oEntry.tmstmp= "/Date(1390557603727)/";
    //Instantzierung mit Anhang Opportunities
    oModel.create('/Opportunities', oEntry, nullfunction(){
    alert("Create successful");
               },function(e){
    for (var property in e.d){
    alert(property + "=" + e.d[property] + oEntry + "failed"); 
    I get the following Errormessage:
    ERROR: 2014-03-17 12:51:52 The following problem occurred: HTTP request failed501,Not Implemented,<?xml version="1.0" encoding="utf-8" standalone="yes"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code/><message xml:lang="en-US">Feature not supported.</message></error> -
    After this I tried it with an ajax call:
    var aUrl = '..(censored)../BL_TI/2005/zaginfothek/Opportunities.xsodata/Opportunities';
    //all in one ajax – Statement included and tried to create the row via POST:
    jQuery.ajax({
    method:'POST',
    url: aUrl,
    data: {"id": "7778",
    "LfdNr" : "1" ,
    "Customer" : "2",
    "Thema" : "3" ,
    "Leadueber" : "4",
    "Owner" : "5",
    "MarketDeveloper" : "6",
    "ThemenfokusnachBL" : "7",
    "Industry" : "8",
    "PDs" : "9",
    "Revenue" : "0",
    "Probability" : "1",
    "ProbableRevenue" : "2",
    "Start" : "3",
    "Finish" : "4",
    "Duration" : "5",
    "Phase" : "6",
    "Status" : "7",
    "ATPDecision" : "8",
    "Date": "9",
    "SupplyChain" : "0",
    "Technology" : "1",
    "Region" : "2",
    "Kontaktquelle" : "3",
    "CASStatus" : "4",
    "Angebotsnummer" : "5",
    "Archiv" : "6",
    "Angebotabgelegt" : "7",
    "LeadmeldunganSAP" : "8",
    "ArtderAnfrage" : "9",
    "tmstmp": "/Date(1390557603727)/"
    contentType: 'application/json',
    dataType: 'json',
    success: function(e){
    alert(e.response + "success");
    error: function onErrorCall(jqXHR, textStatus, errorThrown){
    alert(jqXHR.status);
    alert(aUrl);
    sap.ui.commons.MessageBox.show(jqXHR.status,   
    "ERROR",  
    "Error in calling Service" );   
    // return;  
    The last statement with ajax send me a success message back, but there is still no row added in the HANA.
    Has anyone an idea what´s going wrong?
    I woulb be happy for any hints, thanks
    André

    Hi Ben,
    well I tried out your code and it works with an small correction of your insert:
    save: function(){
            var oData = new sap.ui.model.odata.ODataModel('...censored.../BL_TI/2005/TEST_USER/Opportunities.xsodata', true); 
            // New user panel 
    //        var pnlUser = new sap.ui.commons.Panel({text: "User-Data"}); 
    //        var tfUserId = new sap.ui.commons.TextField({placeholder: "User-Id"}); 
    //        var tfUserName = new sap.ui.commons.TextField({placeholder: "User-Name"}); 
    //        var btnSave = new sap.ui.commons.Button({text: "Save"}); 
    //        pnlUser.addContent(tfUserId).addContent(tfUserName).addContent(btnSave); 
    //        btnSave.attachPress(function() { 
            var entry = {}; 
            entry.ID = "3"; //tfUserId.getValue(); 
            entry.USERNAME = "4"; //tfUserName.getValue(); 
            oData.create('/USER', entry, null, 
                    function() { 
                alert("Create successful"); 
            function() { 
                alert("Create failed"); 
    Try to write your id instead of  3 -> "3" That was the only what I´ve changed.
    Greetz,
    André

  • Make-to-Order customer Return Order triggers unwanted ATP check

    When executing a return delivery on a Make-to-Order (Strategy 20, no APO) material, we notice that the ATP check (checking rule BE) gets triggered.  On a return this makes no sense  and of course fails, stopping us from creating the delivery. How can we prevent that?
    Strat. 20 has Req.type KE & Req.Class 040 with the Availability Check flagged, but returns should not trigger an ATP check and therefore the  SLCat is unflagged as such ("Define Procedure for  each schedule line category"), but that seems to be ignored - only for this MTO strategy.
    When, for testing, we change the Strategy on the same material to 40,  the ATP check -everything else being equal- no longer happens, which indicates that the Order type, Del Type, ItCat, SLCat are all ok. What link am I missing ?
    Somehow, selecting a different material strategy impacts the running of ATP.  It would already be useful to know, if in your system, when using Make-To-Order strategy, you see the same or not.
    Help would be very appreciated.
    Hans.

    Thank you for the suggestion.   OVZI already has these settings (MRP type and RqType blank). 
    I don't see how a setting in OVZI would explain that just changing the strategy on the material removes the problem : the key fields here (ItCat, MRPType) would have the same values and they would both come up with a requirement type, linked to a requirement class which has the AvC active (ovzg).  How come that gets overruled (I presume by the schedule line category DN) for one strategy and not the other ?
    I could make an entry in ovzi to force it to go to the same requirement type all the time, but that will impact all materials using this ItCat and MRP type.  That seems like a too generic fix for a specific issue.  If you know of any other link between strategy (specifically MTO) and ATP behaviour, I'd be very interested.

  • Will BW on HANA support Control-M?

    Hi,
    We are planning to upgrade from BW 7.0 to BW 7.4 on HANA. Currently we are triggering process chains using BMC Control-M.
    1. Will it have any impact on Control-M scheduling when we upgrade the system?
    2. Which is the Least supported version of Control-M for BW 7.4 on HANA?
    Please suggest.
    -Sriram

    Hi Sriram,
    I hope you will not face any issue,But also need to confirmabout the what release of BMC Control-M you are using.
    You can check release not for particular version.
    here you can find the relase note for version 8.
    ftp://identity-solutions.com.au/pub/Control-M/ReleaseNotes/CTMEM800_FP1_ReleaseNotes.pdf
    BR
    AKJ

  • Scripts to start stop SAP HANA

    Hi Everyone,
    I need to call the script to stop and start sap hana via API. Does any one knows about any API that can be used to do this. I am aware of CLI but I need some API like REST API or XS which will help to do the os level triggering.
    Thanks,
    Amogh Jadhav

    Rodrigo,
    esse espaço é de HANA em Portugues.
    Por favor, refaça a pergunta em Português e/ou pergunte no espaço de HANA em inglês:
    SAP HANA and In-Memory Computing
    Vou bloquear essa thread agora.
    Abs,
    Henrique.

  • Best practices for PAL and HANA Modeling

    Hi all
    I wanted to get your opinion on working with Predictive Analysis Library and SAP HANA modeling- analytical views, calculated views, etc.
    If I have transactional data modelled into analytical view and now wish to run a predictive function on some of it's columns, what are you guys' suggestions on how to best go about building a PAL model within HANA?
    Do I run the PAL procedure every time the table is updated? How do I decide on the frequency of the pal procedure? Any tips?
    And do I use triggers for automated procedure runs?
    What are some of the best practices?
    If this has been brought up before, please point me to the right discussion.
    Thanks!

    Hi all
    I wanted to get your opinion on working with Predictive Analysis Library and SAP HANA modeling- analytical views, calculated views, etc.
    If I have transactional data modelled into analytical view and now wish to run a predictive function on some of it's columns, what are you guys' suggestions on how to best go about building a PAL model within HANA?
    Do I run the PAL procedure every time the table is updated? How do I decide on the frequency of the pal procedure? Any tips?
    And do I use triggers for automated procedure runs?
    What are some of the best practices?
    If this has been brought up before, please point me to the right discussion.
    Thanks!

  • DBIF_REPO_SQL_ERROR while trying to activate ENVIRONMENTSHELL for BPC 10.0 NW on HANA

    Hi experts,
    I'm getting this short dump "DBIF_REPO_SQL_ERROR" while trying to activate the ENVIRONMENTSHELL(UJS_ACTIVATE_CONTENT) for BPC 10.0 NW on Hana database :
    Category                  Resource Shortage
    Runtime Errors         DBIF_REPO_SQL_ERROR
    Short Text
        SQL error "-10760" while accessing program "CX_SY_OPEN_SQL_DB=============CP" part "LOAD".
    What happened?
        Database error text: "Memory allocation failed."
    Error analysis
        Database error text: Memory allocation failed.
        Triggering SQL statement:  "CX_SY_OPEN_SQL_DB=============CP        "
    System environment
        SAP Release..... 740
        SAP Basis level 0005
        Application server... vSAPPRD
        Network address...... 172.16.10.230
        Operating system... Windows NT
        Release.............. 6.2
        Hardware type....... 4x AMD64 Level
        Character length..... 16 Bits
        Pointer length........ 64 Bits
        Work process number... 9
        Shortdump setting. full
        Database server... hana-prd
        Database type..... HDB
        Database name..... PRD
        Database user ID SAPPRD
       Terminal.......... Maha-HP
        Character set C
        SAP kernel....... 741
        Created on....... Mar 21 2014 17:31:58
        Created at....... NT 6.0 6002 x86 MS VC++ 16.00
        Database version SQLDBC 1.00.60.0379371
        Patch level....... 26
        Patch text.......
        Database............. HDB 1.0
       SAP database version. 741
       Operating system... Windows NT 5.1, Windows NT 5.2, Windows NT 6.0, Windows NT
       6.1, Windows NT 6.2, Windows NT 6.3
       Memory consumption
       Roll.... 0
       EM...... 44600400
       Heap.... 0
       Page.... 49152
       MM used. 33089488
       MM free. 4949248
    The program interrupted was SAPLSADB
    Thanks
    Maha

    Hi Maha,
    Please check the versions of:
    HANA server
    HANA client (on HANA server)
    HANA client (on the PAS)
    SAP Kernel (both the generic and HDB specific files)
    The versions between them should be in sync.
    My issue with the error: " CX_SY_OPEN_SQL_DB=============CP        " is resolved by applying the latest SAP Kernel 7.41 Patches which is currently patch level 43.
    Good luck!
    Regards,
    Mike

  • Restrict list of displayed hana models

    Hi,
    We are planning to use AAO for adhoc reporting. I would like to restrict the list of hana models displayed based on the package permission of the logged in user. Currently when a user logs in, the following query is triggered to HANA which gives the list of all existing cubes when the "Folder" tab is selected:
    SELECT "CUBE_NAME", "DESCRIPTION", "CATALOG_NAME"  from "_SYS_BI"."BIMC_CUBES" ORDER BY "CATALOG_NAME" ASC .
    Is there a way to restrict this folder list?
    Thanks

    Hi Aamod - what revision HDB are you on? For a short period of time (rev 60-63) there was control over which views a user can see through a front end tools. This was based on the analytic privileges granted and the can be observed through the system view "SYS"."ACCESSIBLE_VIEWS".
    Before 60 and after revision 64, a user can see ALL views through a front end tool unless further SQL privileges are defined as James has indicated. See OSS message 1907697 for the details. If you check version 1, there is actually a solution given to allow the previous authorization to be in effect but warns of performance issues.
    To me, this seems a little clunky since you really need to maintain the authorizations in two places; one for DISPLAY to the end user (SQL privilege) and one for EXECUTION (analytic privilege). I just tested this, and as an end user I might have analytic privileges assigned for only two views, but I can see all of them.
    Even worse, when I attempt to run the data from one (when I don't have the AP), I get a "not authorized error" from within Analysis for Office, but in Lumira it literally just spins and never stops - no error message or anything.
    Regards,
    Justin

  • HANA XS SAML Configuration - Error when saving Identity Provider

    Dear experts,
    I'm currently using a SAP HANA SP8 environment from my AWS account. During the creation of the Identity Provider, the following error message is being displayed:
    Error: PreparedStatement.setInteger: expected int for second argument, but got: string
    The error is triggered in file http://<host>:8000/sap/hana/xs/admin/logic/idp.xsjs
    The error is very easy to reproduce. Just follow the steps below:
    1. Log into http://<host>:8000/sap/hana/xs/admin/
    2. Go to SAML Configuration > Identity Provider
    3. Click on the button on the left side of the shell to add a new Identity Provider
    4. Paste the IDP Metadata extracted from your IDP on the Metadata field and click on the Parser button
    5. Add a name to your IDP Config
    6. Click on the Create button. The error will be displayed.
    Anyone has faced this problem and know how to fix it?
    Regards,
    Gustavo

    Hi Gustavo,
    I also had this error when adding IDP and I found a workaround for this. The error is due to the port in the "Base URL" field. So, before you click "Save", just remove the port number. For example, if the base URL is parsed into https://ids-test.wdf.sap.corp:443, just remove the port number which means https://ids-test.wdf.sap.corp. Save it first, then you choose this IDP and edit it, just add the port number and save it again.
    Best regards,
    Wenjun

  • 'Function in SAP HANA is currently not possible' error message at KE91 transaction

    System details:
         HANA Server - SPS7
        and  IDES ECC 6.0 EhP 6
    Background:
    Trying to implement  ERP Profitability Analysis accelerator for SAP HANA. We completed the configurations successfully as per the RDS building block guide
    V29 – ERP Finance and Controlling Accelerator with SAP HANA General Configuration and  VD1 – ERP profitability Analysis Accelerator with SAP HANA Configuration
    We could also see the tables (with data) replicated to HANA via HANA Studio.
    And all the statuses at tcode KEHC shows as green.
    Issue Description: When we try to test the Accelerated Transactions like KE91 kind of drill down reports
    Execute.I get the following pop-up. So, here Since I need to get data from HANA I select NO button
    Surprisingly I get the following error message.
    We have tried with other Accelerated transactions like KEU5,KEUB.But I get the same pop-up msg, and get the same error msg at status bar .
    Any help in this would be very helpful.

    Hi Kenny,
    Sorry for my late reply
    Here is the snapshot of SM21 system log
    I realized, this join path 'JP01' error msg I am getting even when running column views at HANA SQL editor.
    Could not execute 'select VRGAR, sum(vv010001) from "ERPTRI_800"."CE2CE4IDEA_HDB" group by vrgar' in 386 ms 128 µs . SAP DBTech JDBC: [2048]: column store error: search table error:  [2920] invalid schema: found inconsistent join path  "jp01" for viewattribute "MANDT" with fact table "ERPTRI_800:CE4IDEA" on olap index; for cube ERPTRI_800:CE2CE4IDEA_HDB
    Actually, All these Column Views and its underlying tables are got created from the given RDS solution only. Not sure why is this errorgetting triggered.IS this kind of bug in RDS solution?!!
    Regards
    Lokesh

  • HANA Stored Procedure in SAP Design Studio

    hi there,
    I developed a HANA stored procedure, I want to implement this procedure in SAP Design Studio. following scenario:
    if Button Click, the Procedure is executed and the result of this Procedure is shown in a crosstab.
    I can maybe help someone, maybe someone has tried something similar.
    Thank you 

    hi,
    I developed in Hana a calculation view with script, cfr stored procedure, this view I can use as a datasource in my SAP Design Studio.  The loading of your datasource can be triggered by your button:  set datasours load in script true, radiobutton event: DS_1.loaddatasource ();
    Is this work around okay for you.
    Greetings
    Koen

  • HANA and Unicode requirement.

    I am not yet an expert in HANA so on reading documentation.
    I have not found any reference to Unicode requirement in this forum..
    Even if in my company we are up to date on Release level ECC 6 (for some of our SAP landscapes) they have been upgraded overtime. For some of them we have never done a Unicode database conversion.
    I have seen a document on the web (link) where it says :
    SAP HANA can work with SAP R/3® starting from release 4.7.
    This is because UNICODE, which is required by Sybase Replication Server, became available with release 4.7.
    Does it mean that a UNICODE conversion is MANDATORY if we want to plug-in HANA on an existing SAP system ?
    Or is it the standard issue to lose some characters ?

    What we know so far (and are waiting for detailed documentation as well) is:
    1/ If you want to connect SAP Business Suite application (like ERP) to SAP HANA database using replication based on Sybase Replication Server - Business Suite application has to be Unicode
    2/ If you want to connect SAP Business Suite application (like ERP) to SAP HANA database using replication based on triggers (SLT tool) - there is no requirement for the source system to be Unicode
    3/ If you want to do DB migration of your BW in the future from its current RDBMS to HANA database - BW has to be Unicode.
    Cheers,
    -Vitaliy

  • Not triggering  Member Formula

    Hi,
    I have created a simple member formula and have processed it. It shows up as Green. But it is not getting triggered when I refresh or save data through EPM Excel Workbook. I have verified that the data exists for the 2 accounts shown below. Please help!!!
    Regards,
    Nicky

    Hi Nicky
    You haven't specified which version of BPC you are currently on, but this might be of help.
    The following SAP Note might be relevant to you if you are on BPC on HANA.
    2122679 - Member formula result member returns no data
    If this note is not applicable to you, then possibly try using the fully qualified path for dimension member in your formula.
    For Example: [ACCOUNT].[PARENTH1].[400000] + [ACCOUNT].[PARENTH1].[600010]
    Hope this helps,
    Kind Regards
    Daniel

Maybe you are looking for

  • Is this a data list photo gallery?

    http://www.heathrowe.com/other/fc2/main.html (click to the gallery page) Someone posted this in the show your Catylst project thread. Is this done with the Data list method? It's late, and I am beat, but I can't seem to get rollover functionality in

  • Explain plan left the building

    Hello guys, i have interesting problem, at least it seemed to me like that. I am on 10.2.0.4.0 and for every statement i do explain plan i get the same plan ???. Propably very known issue to some, but i didn't exeperienced that till now, so if somene

  • XML with BI

    Hi All, I want to access BW data through XML.Could anybody assist me to understand what all steps needs to be followed to access BW data using XML. We are on BW 3.5 and need to use XML to retrieve data from BW. Thanks for your help in advance. Regard

  • Importing WAV files that have been modified with a sound editor

    I tried importing a WAV file to Itunes which I had modified with a fade out effect to remove talking at the end of the song. When I played the song back in Itunes (after importing), the edit effect was ignored. Is there a way to import songs into Itu

  • E-mailing large files

    my brother is making a website for me. i need to send him images of my artwork via e-mail. i don't want to send them one at a time... that would take forever. i think what i need to do is make a zip file. i figured out how to do that..... i just don'