Process triggered before update table filled

Hello,
We have a program that
- calls one FM (RSSM_SDL_INFOPACKAGE_DIALOG) that gives direct access to a specific infopackage (via program parameters) that is uploading an ODS when executed
- secondly calls another FM (BP_EVENT_RAISE) that triggers an event that activates the ODS (and some other processes afterwards).
The problem is: The event is triggered when the infopackage is left - and the infopackage might be left before the update table is filled. So the activating process might start before the filling of the update table has been done (monitor status not green).
How can this issue be solved keeping in mind that the end-user should only execute one transaction (the one that's execute the program).
Kind regards,
Johnny

Hi Simon,
Can you provide me with information of how to build in this loop. Please check the relevant part of our program:
  CALL FUNCTION 'RSSM_SDL_INFOPACKAGE_DIALOG'
    EXPORTING
      SOURCE.......
IMPORTING
EXCEPTIONS
   error                  = 1
   OTHERS                 = 2.
  IF sy-subrc <> 0.
  PERFORM log_nogo.
    MESSAGE e001(00) WITH 'FM Error: Infopackage error message succesfully logged'.
  ELSE.
    IF NOT p_evtid IS INITIAL.
      PERFORM raise_event
           USING p_evtid
        CHANGING ret_code.
      IF ret_code <> 0.
        MESSAGE e002(zbps) WITH 'Error raising event '
                               p_evtid.
      ELSE.
        MESSAGE s002(zbps) WITH 'Event'
                              p_evtid
                              ' successfully' ' raised'.
      ENDIF.
    ENDIF.
  ENDIF.
Thanks,
Johnny

Similar Messages

  • Apply validations on internal table fields before updating table

    I have to upload data from a CSV file to R3 ztable, but before that I have to apply diffrent validations to check if fileds does not contaion invalid characters ....
    eg
    for a currency field I want to check if user has entered value in decimail format e.g 3.23, -22.33 etc but not like this 3..2, _+3.33, e3e& etc
    How can I do this .....

    hi ,
    There are lots of thread  related to upload data  .
    you can search in SDN  .
      One method is to upload data in excel format  and getting data in one internal table and then validatiing
      before insert or update  .
    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    Regards
    Deepak.
    Edited by: Rob Burbank on Oct 3, 2010 3:36 PM

  • Is there a process/program  to update tables/data after System Refresh?

    We are planning a refresh of SAP R/3 47 and SRM EBP 4.0. Copies of all data from our production system will be refreshed onto our test environment. 
    Is there a program that can be run to reset the "Destination" targets as there is with "source" using BDLS?
    We can copy out certain tables and reimport, but we fear that we may be missing something. If anyone has informatoin on the process for performing a refresh, we would appreciate hearing about it.
    Thanks,
    BIll
    Message was edited by: William Olliver
    Using BDLS and clearing out some of the custom tables (allowing normal programs to rebuild data points) did the trick. 

    Hi Bill,
    BDLS takes care of the table entries that correspond to the Logical System.  This takes care of almost 80-90% of the entries. 
    Keep in mind however, you will need to change all the entries that correspond to an backend RFC destination or other webservers once a copy is made; as those are not updated by BDLS. 
    Some of these are (as it is entirely dependent on the scenarios being implemented):
    DEFINE BACKEND SYSTEMS:
    --IMG>SRM>...
    ORGANIZATION STRUCTURE
    --Use standard program RHOMATTRIBUTES_REPLACE
    --Plus, Change other attributes: POrg,PGrp,Plants...
    EDI/IDOC/ALE entries for partner profiles
    --WE21 etc.
    TWPURLSVR, TWPURLPATH, etc
    --Table entries
    WORKFLOW Verification Steps
    --IMG>Workflow...
    MIDDLEWARE PARAMETERS in R/3 and SRM.
    --Table Entries
    CATALOG ENTRIES
    --IMG>Master Data...
    Hope this helps.
    -Sachin Sethi

  • Strating a process triggered by db table content change

    Hi all
    I am new to BPM.
    I am trying to understand if BPM answers our requirements.
    Is there a possibility to start a process when a field from data base table changes?
    Thanks,
    Nitsan

    Hi,
    Yes It can be acheived Check this [document|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/80ddeba4-e780-2b10-7bb2-fc7a33efabbd]
    also search with keyword Change Document in SCN lot of discussions are available...
    Regards
    Pavan

  • Error updating table 37

    HI,
    When I am generating a excise invoice the system triggers u201CError updating table 372"
    I have not maintained of table 372 in access seq (Cd type (JEXP) . Previous i have maintained this table in my access seq and its working fine but I am not able to save the document,
    in that time i got error like
    No account is specified in item 0000000001
    Message no. F5670
    Diagnosis
    No account was specified for account type "S" in item "0000000001" of the FI/CO document.
    System Response
    The Financial Accounting program cannot process the document.
    Procedure
    A system error has probably occurred in the application you called up. Check the data transferred to item "0000000001" of the FI/CO document.
    Pl let me know if anything else is required to avoid further problems
    All errors I have attached with screen shot pl give me reply .
    Pl let me know if anything else is required to avoid further problems
    Any possible solution for this?
    1 ) IN VKOA transaction G/L accounts which are assigned in our sales account keys with combination of condition table fields is :
    App CndTy. ChAc SOr AAG AAG ActKy G/L acct
    V KOFI CAIN ERRO 01 06 ERL 300009 Sales
    V KOFI CAIN ERRO 01 06 EXD 140014 CENVAT Clearing
    V KOFI CAIN ERRO 01 06 EXS 140009 Ed Cess
    V KOFI CAIN ERRO 01 06 MW3 140071 VAT
    V KOFI CAIN ERRO 01 06 MWS 140071
    V KOFK CAIN ERRO 01 06 ERL 300009
    V KOFK CAIN ERRO 01 06 EXD 140014
    V KOFK CAIN ERRO 01 06 EXS 140009
    V KOFK CAIN ERRO 01 06 MW3 140071
    V KOFK CAIN ERRO 01 06 MWS 140071
    In Customer account assignment group and material account assignment groups. Setting is correct
    in the IMG settings
    IMG>Logistics general>Tax on Goods movements>India>Account determination.
    What GL should be assign here
    Excise G/L A/c for RG23A BED CENVAT offset account Mod.Clerng
    ARE1
    ARE3
    DLFC   ?          ?                     ?                  ?                   ?
    EWPO ?          ?                    ?                   ?                  ?
    GRPO
    TR6C
    UTLZ
    Pl let me know if anything else is required to avoid further problems
    Regards
    SAPCO

    Solved. Thanks to....
    http://www.vecna.com/whatWeDo/projects/9ias-experience.html

  • U201CError updating table 372"

    HI,
    When I am generating a excise invoice the system triggers u201CError updating table 372"
    I have not maintained of table 372 in access seq (Cd type (JEXP) . Previous i have maintained this table in my access seq and its working fine but I am not able to save the document,
    in that time i got error like
    No account is specified in item 0000000001
    Message no. F5670
    Diagnosis
    No account was specified for account type "S" in item "0000000001" of the FI/CO document.
    System Response
    The Financial Accounting program cannot process the document.
    Procedure
    A system error has probably occurred in the application you called up. Check the data transferred to item "0000000001" of the FI/CO document.
    Pl let me know if anything else is required to avoid further problems
    All errors I have attached with screen shot pl give me reply .
    Pl let me know if anything else is required to avoid further problems
    Any possible solution for this?
    1 ) IN VKOA transaction G/L accounts which are assigned in our sales account keys with combination of condition table fields is :
    App CndTy. ChAc  SOr  AAG  AAG   ActKy G/L acct
    V   KOFI    CAIN   ERRO  01   06      ERL   300009  Sales
    V   KOFI    CAIN   ERRO  01   06      EXD  140014  CENVAT Clearing
    V   KOFI    CAIN   ERRO  01   06      EXS  140009  Ed Cess
    V   KOFI    CAIN   ERRO  01   06      MW3  140071  VAT
    V   KOFI    CAIN   ERRO  01   06      MWS  140071  
    V   KOFK   CAIN  ERRO   01  06      ERL    300009  
    V   KOFK   CAIN  ERRO   01  06      EXD   140014  
    V   KOFK   CAIN  ERRO   01  06      EXS   140009  
    V   KOFK   CAIN  ERRO   01  06      MW3   140071  
    V   KOFK   CAIN  ERRO   01  06      MWS   140071  
    In Customer account assignment group and material account assignment groups. Setting is correct
    in the IMG settings
    IMG>Logistics general>Tax on Goods movements>India>Account determination.
    What GL should be assign here
    Excise  G/L A/c  for RG23A  BED     CENVAT offset account               Mod.Clerng
    ARE1
    ARE3
    DLFC    ?            ?                      ?           ?          ?
    EWPO  ?           ?                       ?          ?          ?
    GRPO
    TR6C
    UTLZ
    Pl let me know if anything else is required to avoid further problems
    Regards
    SAPCO

    Hi
      If you are using subtransaction type then ensure the same setting as of without subtransaction type for ETT DLFC under CIN customization.
    I mean you should maintain same setting for ETT DLFC with and without subtransaction type.
    Also check the setting ETT  GRPO EWPO and DIEX should be same as with and without subtransaction type.
    Regards
    MBS

  • After/before update trigger

    Hi All
    Does any onoe know
    what 's the difference between after update/insert trigger and before update/insert trigger
    on database tables.

    Hi
    The basic diffrence is
    Before Update triggers before the table is updated and
    After update triggers after the table is updated but
    before the implicit commit fires.
    therefore when you raise the application error a
    implicit Rollback happens and the record is not commited.
    Regards
    Shajesh Nair
    Deloitte.
    [email protected]

  • Error updating table 372"

    Hi friends,
    when iam generating a excise invocie the system triggers"Error updating table 372"
    Any possible solution for this?
    Thanks
    Ivy

    Dear All,
    I done this--by doing some configuration changes.
    Normally while doing Exports we are tempted to use the same sales area and accordingly we may give the combination of excise grp+series grp+export type in IMG>>>Logistics General>>>India>>>Business transactions>>>Outgoing excise invoices>>>Maintain default excise groups and series groups.
    Once after removing the export type to your sales area combination--system will show this error--and we cannot even post the Excise invoices.(J1IIN)
    I tried in my IDES--that with export type(Ex.Export under Bond)--with this assignment--i am able to post my excise invoices.
    Once after removing this assignment of export type--again i am getting this error.
    Actually i am not even aware why it is happening--almost after two months of struggle--i find this.
    (i feel it is in the same way that we cannot even open/See a sales order by deleting sales group which was created&used previously)
    i am sharing this because somebody may get a little help with my thread.
    Mark this if helpful--there by others can easily find this thread.
    Phanikumar

  • How to lock a database Z table before updating it through a report program

    Hi,
    How to lock a database Z table before updating it through a report program and also how to unlock it after my updation.
    The whole process is done through report program.

    Hi,
    Go to SE11, in the option 'Lock object' enter the name of your lock,
    begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the
    table name where the record you want to lock exist and select the
    lock mode. Lock mode can be shared and exclusive. If 'shared',
    when you lock the record, other can also read data, but can not
    modify. If 'exclusive', when you lock the record, other can neither
    read nor modify the record. After save and activate, you will get two
    function module.'ENQUEUE_EXXXX' to lock record,
    'DEQUEUE_EXXXX' to release lock on one record.
    When use this function module it only lock one record at a time. It
    does not lock the table.
    Regards,
    Omkaram.

  • Check before update in table

    Hi Guru's,
    I am a new developper in abap. I have a question concerning the check before the update in a table.
    I uploaded a csv file by the function module GUI_DOWNLOAD but now before to do the update I have to check if the correct value for the controlling area and profit centre are used .
    I don't know where do my test.
    Anyone can help me?
    Regards,
    Mohamed.
    UPDATE
    -          fill table --> check all values of the file and if one error stop processing and do not update anything in the table
    -          check if controlling area is correct
    -          check if profit center is correct
      LOOP AT it_datatab INTO wa_datatab.
        split wa_datatab at ';'  into
                          wa_cepc_segm-KOKRS
                          wa_cepc_segm-PRCTR
                          wa_cepc_segm-DATBI
                          wa_cepc_segm-DATAB
                          wa_cepc_segm-SEGMENT.
        APPEND i_cepc.
        CLEAR i_cepc.
      ENDLOOP.
      END-OF-SELECTION.

    Hi,
    Updating a database table
    Single-line updates
    SELECT * FROM TABLE
    COLUMN-UPDATE STATEMENT
    UPDATE TABLE
    ENDSELECT
    Column updates
    UPDATE TABLE SET COLUMN-UPDATE STATEMENT
    Regards

  • Triggers to update one column on 3 tables

    hi,
    I've three tables:
    TABLE TN:
    COD_ID.........VARCHAR2(32) primary key
    NAME...........VARCHAR2(64) NOT NULL
    COD_ID..............NAME
    A12.................AT32
    A13.................AT33
    A14.................AT35
    A30.................AT32
    TABLE TM:
    ID_X..........VARCHAR2(32) PRIMARY KEY
    NAME..........VARCHAR2(64)
    ID_X..............NAME
    A12
    A13
    A14
    A30
    TABLE TL:
    COD_ID..........VARCHAR2(32) FOREIGN KEY ON TN
    ID_X............VARCHAR2(32) FOREIGN KEY ON TM
    TL_ID...........VARCHAR2(32) PRIMARY KEY
    NAME............VARCHAR2(64)
    I'd like to create triggers (or procedure) that update automatically the value NAME in the tables TM and TL.
    for example:
    If I insert into TN a new COD_ID (A39) and a new NAME (AT38), when I insert a new ID_X in tble TM, I'd like
    to have the value AT38 in NAME of TM, and when I insert a new record in table TL I'd like
    to have the value AT38 in NAME of TL.
    Also when I update NAME of TN.
    I tried with these triggers:
    CREATE OR REPLACE TRIGGER TN_PR_BEFORE_UPD
    BEFORE UPDATE OF NAME ON TL
    FOR EACH ROW
    DECLARE
    tmpVar NUMBER;
    BEGIN
    update TL set NAME=:new.NAME where TL.COD_id=:new.COD_id;
    UPDATE TM SET NAME=:NEW.NAME WHERE ID_X=:NEW.COD_ID;
    END TN_PR_BEFORE_UPD;
    CREATE OR REPLACE TRIGGER TN_COD_ID
    BEFORE UPDATE OF COD_ID ON TL
    FOR EACH ROW
    BEGIN
    SELECT NAME INTO :NEW.NAME FROM TN WHERE TN.COD_ID=:NEW.COD_ID;
    END TN_COD_ID;
    CREATE OR REPLACE TRIGGER TL_pr
    BEFORE UPDATE OF NAME ON TL
    BEGIN
    UPDATE TM SET NAME=:NEW.NAME WHERE ID_X=:NEW.ID_X AND :NEW.ID_X IS NOT NULL;
    END TL_pr;
    CREATE OR REPLACE TRIGGER TL_PR_BEFORE_INSERT
    before INSERT ON TL
    FOR EACH ROW
    DECLARE
    tmpVar varchar2(64);
    BEGIN
    SELECT NAME
    into tmpVar
    FROM TN
    WHERE COD_ID=:NEW.COD_ID;
    END TL_PR_BEFORE_INSERT;
    when I update TN triggers run CORRECTLY but when I insert a new record in TM, TN, TL I don't see a new NAME.
    What I wrong??
    Thanks
    Raf

    Use when updating then insert into table_name
    and
    when inserting then insert into table_name
    clauses in your Triggers to do this

  • Triggers before and after update

    Hi
    I would like to add triggers before and after update for the following code. I would be thankful if someone give some guidance
    update per_all_people_f a
    set start_date = (select min(effective_start_date)
    from per_all_people_f a1
    where a1.person_id = a.person_id)
    where person_id in (1114,115);Thanks
    anna

    Hi
    I was unable to answer you. I agree with Peter . Also i want to add
    that in HRMS you should check what triggers are already on that table and be carefull with creating your own one. With your own trigger you can influence on some application logic you know.
    ( And i hope that is a table first of all :) - but as i know _F at the end of table name means table  )
    T

  • Help on triggers needed-update other tables

    Hi,
    I am using 10g and is very new to triggers and I hope I can gain some advises here.
    I have the following 3 tables. MainInterfaceTable is a table where it stores records of values which are to be updated to tables: log1 and log2 respectively. One application will insert record into MainInterfaceTable and the inserted record contains only values for columns which are to be updated into tables: log1 and log2 respectively. Columns which contain null values are not to be updated into log1 and log2 tables.
    I can only think of using many "if" statements in my trigger to concatenate the UPDATE DML to update log1 and log2 tables. But if the MainInterfaceTable table contains many columns, it is not very efficient. {color:#800080}Is there any built in oracle functions or a more efficient to perform this task??{color}
    {color:#800080}Any advises are greaatly appreciated. Thanks{color}
    For E.g. In the below MainInterfaceTable record, I only update table log1 with txt1A column values. And update log2 table with col1 and col2B column values.
    Column Values
    txt1 null
    txt1A 6
    txt1B null
    col1 &lsquo;new orders'
    col2A null
    col2B &lsquo;new purchase'
    ------------------------------my trigger -------------------------------------
    CREATE TRIGGER TRG_MainInterfaceTable
    AFTER INSERT ON MainInterfaceTable
    FOR EACH ROW
    DECLARE
    sqlStmt VARCHAR2(2000); -- the SQL statement
    BEGIN
    sqlStmt := 'UPDATE log1 a SET 1=1 ';
    if :*new*.txt1 is not null then
    sqlStmt := sqlStmt || ' ,a.txt1 = ' || :*new*.txt1;
    END IF
    if :*new*.txt1A is not null then
    sqlStmt := sqlStmt || ' ,a.txt1A = ' || :*new*.txt1A;
    END IF
    if :*new*.txt1B is not null then
    sqlStmt := sqlStmt || ' ,a.txt1B = ' || :*new*.txt1B;
    END IF
    prc_run_update_sql_log1(sqlStmt);
    ------repeat more IF THEN for other tables
    EXCEPTION
    WHEN
    -- exception handling
    end TRG_MainInterfaceTable
    --------------------------------------Table Structure------------------------------------------------------------------
    create table MainInterfaceTable (
    statuscol char(1),
    txt1 varchar2(20),
    txt1A number(6),
    txt1B varchar2(20),
    col1 varchar2(20),
    col2A number(6),
    col2B varchar2(20),
    create table log1 (
    txt1 varchar2(20),
    txt1A number(6),
    txt1B varchar2(20),
    create table log2 (
    col1 varchar2(20),
    col2A number(6),
    col2B varchar2(20),

    Thanks. I put the IF ELSE.. into a function and my codes looks neater. However I encounter a error when i try to pass in a DATE value.
    ORA_06502 numeric or value error: host bind array too small
    The error occur at the line in bold .
    I try to run
    Select TO_CHAR(sysdate, 'DD-MON-YYYY HH24:MI') from dual
    in PL/SQL screen and it works.
    Why the same TO_CHAR() syntax doesn't work in a function????
    FUNCTION concatupdatequery(pVal IN DATE, pCol IN VARCHAR2, pSql IN VARCHAR2) RETURN VARCHAR2 IS
    lvQueryStr VARCHAR2(30000);
    lvTempDate VARCHAR2(100);
    BEGIN
    lvQueryStr := pSql;
    IF pVal IS NOT NULL THEN
    dbms_output.put_line('pVal = ' || pVal);
    lvTempDate := TO_CHAR(pVal, 'DD-MON-YYYY HH24:MI:SS');
    lvQueryStr:=pSql||','||pCol||'=TO_DATE('''||lvTempDate||''',''DD-MON-YYYY HH24:MI'')'; -- DATE data type
    dbms_output.put_line('lvTempDate = ' || lvTempDate);
    END IF;
    RETURN lvQueryStr;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('concatupdatequery (DATE) :pCol:'||pCol||' ,pVal:'||pVal||' ,pSql:'||pSql);
    dbms_output.put_line(SQLCODE||' - '||SQLERRM);
    RAISE;
    END concatupdatequery;

  • Enqueue and Dequeue before updating Database table

    Hi all,
    We are updating database tables using INSERT, MODIFY and UPDATE statements. Since many people will be running the application at the same time we need to lock the table before updating database table. So we need to use ENQUEUE and DEQUEUE functionality for this purpose.
    Can any plz explain what are the steps we should follow now?
    Thanks in advance.

    Hi,
    Any Database access should carefully handled as multiple applications may be accessing the database at the same time. To read a record from the database you don't need to implement a lock, but to write you need not only locks but also ideally should use the Update Function Modules to comply SAP "All or Nothing" Principle. This will prevent data inconsistency of the database and the data will be proper state. You need to use the COMMIT WORK and ROLLBACK WORK in you code to handle the consistency part of the database.
    The best design approach would be seperate the Database Layer completely from the business layers. This will make your code robust and easy to maintain.
    As, for the Locking Concepts, you will get multiple resources from SDN as how to create Locks and implement the Locking modules in your code. But more than that what matters is why and how to implement the SAP Locking concepts to make your application run better.
    Have a look at the following link
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • Before update and after Update trigger

    Hi,
    I am following the below approach to overcome ORA-04091: table XXXX is mutating error.
    1. In the after update row level trigger i am capturing rowids of changed rows into a table type (of type rowid) defined in a package.
    2. In the after update statement level trigger i am using the data from the table type ( that got populated in the first step) to do my work.
    3. In the before update statement level trigger i am resetting the table type defined in the package.
    Now, can the below situation occur causing the system to fail
    1. A Update to the table occurred causing the before update statement level trigger to fire and reset the table type.
    2. After that row level after update trigger gets executed and captures the required data.
    3. Now before the after update statement level trigger gets executed a new update to the table happened ( to some other row as multiple users are using the application) causing the
    before update statement level to fire and erase the data from the table type?
    I want to know if above situation can occur or is the execution or before and after update triggers atomic?
    Thanks for helping.
    TIA
    Harsha

    A collection in a package is local to the session. And a given session can be processing one SQL statement at a time. So any concurrent updates would be happening in a different session with a different logical collection.
    You may encounter problems if your session is trying to update the same rows that other sessions are trying to update (whether via the original update statement or via the updates issued by the trigger). You could encounter performance problems because of row level locks or you could encounter deadlocks. But your session's collection won't be initialized by some other session's actions (other than DDL that replaced the package itself).
    Justin

Maybe you are looking for