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.

Similar Messages

  • Enqueue and dequeue between two databases

    Please help me to solve i was able to eneque and dequeue in the same database but i just want to enqueue in one database and dequeue in another database can some one let me know the process and it may require any listener configuration?

    DECLARE
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message aqt_order;
    BEGIN
    dequeue_options.DEQUEUE_MODE := DBMS_AQ.BROWSE;
    DBMS_AQ.DEQUEUE ('aqt_queue', dequeue_options, message_properties, message, message_handle);
    Dbms_output.put_line(message.ord_name);
    END;
    i want to dequeue the above code in my database 'b'. i am able to enqueue and dequeue in my database 'a'.Whenever i am dequeueing this it keep on executing.please suggest

  • How to update database table !!!

    hi all,
    Please advice how to update database table with certain cndition needs to be checked.
    Please consider below scenario.
    have used enqueu and dequeue function to lock entries  and also i have used BAPI so considering that return parameter . i want to update table
    /tdk/st0027.
    1. I want to update database table
    2. there are certain condition needs to be checked like ,
       loop at it_final into wa_final.
    th_return-type = 'S'.
               if th_final-vbeln = /tdk/st0027-vbeln and
                  th_final-posnr = /tdk/st0027-posnr and
                  th_final-etenr = /tdk/st0027-sdslno.
    above condition which i need to check .and need to append below system fields need to be appended in table.
              th_final-prstsind = '20'.
              th_final-chgdate  = g_date.
              th_final-chgtime  = g_uzeit.
              th_final-chgprog  = g_cprog.
              th_final-chguser  = g_uname.
              append th_final to td_final.
              update /tdk/st0027 FROM th_final.
              endif.
    endloop.
    but i am getting error saying that  "The type od database table and work area (TH_FINAL)  are not unicode convertible"?
    I am not able to understandwhat would be the solution for this ?
    Thanks and regards,
    Prasad K. NAralkar

    The error occurs in the UPDATE statement included in the code. In this statement it is seen that there is a mismatch of structure defined for the DDIC table /tdk/st0027 and that of your work area th_final.
    try to create a structure w.r.t the DDIC table.
    Eg: DATA: wa_temp TYPE /tdk/st0027.
    MOVE-CORRESPONDING th_final TO wa_temp.
    Then try to UPDATE using the temporary work area i.e wa_temp which has structure similar to that of the database table.

  • Enqueue and Dequeue consept----Please explain urgent

    hi all,
    i want to use sap locking mechanisn (Enqueue and dequeue consept) while updating database table....please explain how to use this while updating a database table.
    Thanks in advance
    Nandha kumar

    Nandha,
    Good document on this concept..
      Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
    The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.
    Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.
    Parameters of the Function Modules
    Field Names of the Lock Object
    The keys to be locked must be passed here.
    A further parameter X_<field> that defines the lock behavior when the initial value is passed exists for every lock field <field>. If the initial value is assigned to <field> and X_<field>, then a generic lock is initialized with respect to <field>. If <field> is assigned the initial value and X_<field> is defined as X, the lock is set with exactly the initial value of <field>.
    Parameters for Passing Locks to the Update Program
    A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case a parameter must check that the lock has been removed.
    Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
    _SCOPE = 1: Locks and lock releases are not passed to the update program. The lock is removed when the transaction is ended.
    _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
    _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
    Parameters for Lock Mode
    A parameter MODE_<TAB> exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. Valid values for this parameter are S (shared), E (exclusive) and X (exclusive but not cumulative).
    The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can however be overridden as required when the function module is called.
    If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_<TAB>.
    Controlling Lock Transmission
    Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:
    Initial value: The lock request or lock release is sent directly to the lock server.
    X : The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.
    Behavior for Lock Conflicts (ENQUEUE only)
    The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
    You have the following options:
    Initial value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
    X : If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
    Controlling Deletion of the Lock Entry (DEQUEUE only)
    The DEQUEUE function module also has the parameter _SYNCHRON.
    If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.
    Exceptions of the ENQUEUE Function Module
    FOREIGN_LOCK: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.
    SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.
    If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.
    Reference Fields for RFC-Enabled Lock Objects
    The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
    Parameters
    Reference fields
    X_<field name>
    DDENQ_LIKE-XPARFLAG
    _WAIT
    DDENQ_LIKE-WAITFLAG
    _SCOPE
    DDENQ_LIKE-SCOPE
    _SYNCHRON
    DDENQ_LIKE-SYNCHRON
    Pls. reward if useful

  • Enqueue and Dequeue of BLOB messages

    Hi all,
    Does anyone have any experience with enqueue and dequeue of BLOB messages? I have PDF files that I would like to send via aq. I can enqueue them, but not dequeue them. When I attempt to deque, I get the following error:
    ORA-25236: buffer too small for user data
    Here is my enqueue code:
    set serveroutput on size 1000000
    set timing on
    /* Enqueue to msg_queue: */
    DECLARE
       Enqueue_options     DBMS_AQ.enqueue_options_t;
       Message_properties  DBMS_AQ.message_properties_t;
       Message_handle      RAW(16);
       Message             blob;
         TmpMsg              blob := empty_blob;
         cnt                 number;
    BEGIN
       DBMS_AQ.ENQUEUE(queue_name => 'JOOSTENBERGVLAKTE',
       Enqueue_options            => enqueue_options,
       Message_properties         => message_properties,
       Payload                    => tmpmsg,
       Msgid                      => message_handle);
         select t.user_data into message from test_queue t where t.msgid = message_handle;
         select blob_content into tmpmsg from tbl;
         cnt := length(message) + 1;
         dbms_lob.erase(message, cnt);
         dbms_lob.trim(message, 0);
         dbms_lob.append(message, tmpmsg);
         dbms_output.put_line('Erased ' || cnt || ' characters');
         dbms_output.put_line('Message length ' || length(message));
       COMMIT;
    END;
    /And here is my deque code:
    set serveroutput on 1000000;
    declare
         l_options         dbms_aq.dequeue_options_t;
         l_properties      dbms_aq.message_properties_t;
         l_hnd             RAW(16);
         l_msg             blob := empty_blob;
    begin
         dbms_aq.dequeue(
              queue_name => 'JOOSTENBERGVLAKTE',
              dequeue_options => l_options,
              message_properties => l_properties,
              payload => l_msg,
              msgid => l_hnd
         commit;
    exception
         when others then
              rollback;
              raise;
    end;
    /

    Hi,
    I think you have the order of enqueueing and filling your blob in the wrong order. I understand why you do it, because inserting a blob in the table you could do that in this way. But I think that you should fill and close your blob before enqueueing it.
    Try something like:
    l_attachment blob;-- := :p_attachment;
    begin
    dbms_lob.createtemporary(l_attachment, false);
    dbms_lob.write( lob_loc => l_attachment
    , amount => length(:p_attachment)
    , offset => 1
    , buffer => utl_raw.cast_to_raw(:p_attachment));
    Another small remark is that I see you doing a commit right after the enqueue-dequeue. In your enqueu example it seems to make sense because you try to fill the blob afterwards. But you could also use the enqueue-dequeue option "visibility" and set that on dbms_aq.immediate. Then you don't have to do a commit. This is handy for enqueueing messages with out affecting your transaction.
    Regards,
    Martien

  • Enqueue and Dequeue AUSP

    Hi Experts,
    I'm using FM 'CLVF_INSERT_AUSP' to insert records into AUSP.
    Please let me know how can I Enqueue and Dequeue AUSP before and after insertion.
    Is there any standard BAPI instead of 'CLVF_INSERT_AUSP' that by default enqueues and dequeues?
    Thanks in advance.
    Anirban.

    Hi ,
    Check for the list of available lock object for this table in data dictonary. If there is some lock object then check for the function module using GOTO->Lock Modules option. It will show the list of function module. U can use these FM to lock the table. First use Enqueue to lock the table. Once u finish the job perform dequeue,otherwise it will create problem.
    If lock object is not available then u hav to create lock object for the table and do the above mentioned process.

  • High REDO Generation for enqueue and dequeue

    Hi,
    We have found high redo generation while enqueue and dequeue. Which is in-turn affecting our database performance.
    Please find a sample test result below :
    Create the Type:-
    CREATE OR REPLACE
    type src_message_type_new_1 as object(
    no varchar(10),
    title varchar2(30),
    text varchar2(2000))
    Create the Queue and Queue Table:-
    CREATE OR REPLACE procedure create_src_queue
    as
    begin
    DBMS_AQADM.CREATE_QUEUE_TABLE
    (queue_table => 'src_queue_tbl_1',
    queue_payload_type => 'src_message_type_new_1',
         --multiple_consumers => TRUE,
         compatible=>10.1,
         storage_clause=>'TABLESPACE EDW_OBJ_AUTO_9',
    comment => 'General message queue table created on ' ||
    TO_CHAR(SYSDATE,'MON-DD-YYYY HH24:MI:SS'
         commit;
    DBMS_AQADM.CREATE_QUEUE
    (queue_name => 'src_queue_1',
    queue_table => 'src_queue_tbl_1',
    comment => 'Test Queue Number 1'
         commit;
    dbms_aqadm.start_queue
    ('src_queue_1');
         commit;
    end;
    Redo Log Size:-
    select
    n.name, t.value
    from
    v$mystat t join
    v$statname n
    on
    t.statistic# = n.statistic#
    where
    n.name = 'redo size'
    Output:-
    595184
    Enqueue Message into the Queue Table:-
    CREATE OR REPLACE PROCEDURE enque_msg_ab
    as
    queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;
    message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
    message_id raw(16);
    my_message dev_hub.src_message_type_new_1;
    begin
    my_message:=src_message_type_new_1(
    '1',
    'This is a sample message',
    'This message has been posted on');
    DBMS_AQ.ENQUEUE(
    queue_name=>'dev_hub.src_queue_1',
    enqueue_options=>queue_options,
    message_properties=>message_properties,
    payload=>my_message,
    msgid =>message_id);
    commit;
    end;
    Redo Log Size:-
    select
    n.name, t.value
    from
    v$mystat t join
    v$statname n
    on
    t.statistic# = n.statistic#
    where
    n.name = 'redo size'
    Output:-
    596740
    Can any one tell us the reason for this high redo generation and how can this can be controlled?
    Regards,
    Koushik

    Please find my answers below :
    What full version of Oracle?
    - 10.1.0.5
    How large is the average message?
    - in some byets only, at max 1-2 KB and not more than this.
    What kind of performance problem is 300G of redo causing? How? Have you ran a statspack report? What did it show?
    - Actually we are facing some performance issue as a overall prespective for our daily batch processing, which now causing a delay in the batch SLA. So we have produced an AWR report for our database and from there we have found that total redo generation is around 400 GB, amoung which 300 GB has been generated by enqueue-dequeue process.
    What other activity is taking place on this instance? That is, is all this redo really being generated as the result of the AQ activity or is some of it the result of the messages being processed? How are the messages created?
    - Normal batch process everyday. Batch process also generates REDO but the amount is low compare to enqueue-dequeue process.
    Have you looked at providing a separate physical disk stripe for the online redo logs and for the archive log location from the database data file physical disk and IO channels?
    - No, as we are not the production DBA so we don't have the direct access to production database.
    What kind of file system and disk are you using?
    - I am not sure about it. I will try to confirm it by production DBA. Is there any other way to find it out, whether it is on filesystem or raw device?
    Can you please provide any help in this topic.
    Regards,
    Koushik

  • Where to enqueue and dequeue correctly

    Dear all,
    I have an application in which I need to enqueue tables and dequeue when leavin.
    The application consists of one window. In the window I have several views. One main view with a tray to navigate and a ViewContainerUIElement.
    When choosing an entry in the tray, a view called "A" is loaded into the ViewContainerUIElement. I now need to enqueue a table A and populate a message in the loaded view if a lock already exists.
    If the user then chose another entry of the tray, the existing lock on table A needs to be dequeued before view "B" is loaded into the ViewContainerUIElement and table "B" needs to be locked.
    I wanted to implement the enqueue in method WDDOINIT of each corresponding view and the dequeue in the method WDDOEXIT. But WDDOEXIT is not called when I "leave" view A and navigate to view "B" and WDDOINIT of view "B" not called again when navigate to view "B".
    Could somebody please give me a hint how to do this? I somehow dont get it done correctly.
    Thanks in advance,
    Hendrik

    Hello Handrick ,
                              You can create the INBOUND and OUTBOUND plugs for both of view A and B .
    And fire these plugs to navigate between the views  and write the  ENQUEUE and DEQUEUE in side the Inbound plug handler of both the plugs .
    For example :
    View A  :  
       Inbound plug : A_inbound     ( Handler : A_inboundhandler )
       Outbound plug : A_outbound
    View B:
    inbound  plug : B_inbound    ( Handler : B_inboundhandler)
    outbound plug : B_outbound
    create a navigation link between A_outbound to B_inbound and  B_outbound to A_inbound.
    To switch between the view fire the outbound plugs .
    in A_inboundhandler  :  enqueue A records 
    in B_inboundhandler : enqueue B records
    you can dequeue the records while changing the  tab  or  inside the handlers .
    you have to write enqueue  in the WDDOINIT. it is required  for the first time when view is loaded .
    I hope this will help you .
    Regards
    Vivek

  • Doubt in updating database table

    hi all
    i want to modify values ztable from a internal table ....
    for eg : the ztable contains matnr and accept_qty
    matnr   qty
    mat01   
    mat02
    i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
    thanks
    lokesh

    hi,
    before that :- modify statemnt will modify a record if there is record having the same key like that of record in work area.
    if there is no record in itab with key of work area record, it will insert a new record in itab.
    look this sample code.
    *modify internal table
    loop at itab into wa.
    wa-field1 = data1.
    wa-field2 = data2.
    wa-field 3= data3.
    modify itab from wa transporting field1 field2 field3 where key_field = wa-keyfield. "there shuld not be any chang in key field.
    endloop.
    *now update database table
    *work area and data base structure shuld be same type
    if itab[] is not initial.
    modify ztable from table itab.
    endif.
    rgds
    anver
    if hlped pls mark points

  • Updating database table with DUPLICATE keys

    i have an internal table having data as follows.
    emp_id     name     date           proj_id  activity_id    Hours  Remarks
    101     Pavan    09.10.2007      123     1         2.00       Coding
    101     Pavan     09.10.2007   124     2         1.00        Documentation
    102     Raj     09.10.2007   123        3         6.00     Testing
    Now i need to update a Ztable with above mentioned data.
    The structure of the Ztable is as follows.
    Mandt     emp_id  name    date    proj_id   activity_id   Hours   Remarks
    NOte: i have ticked both check boxes for the field MANDT in table.
    Rest didnt select the check boxes.
    I believe now the field MANDT alone is a primary key for the z-table.
    NOw i have tried with UPDATE/INSERT statments to update the database table.
    But instead of inserting all the rows, the system is over writing on the same emp_id row.
    Even tried with the statments like INSERT INTO <Ztable> values <Internal table> ACCEPTING DUPLICATE KEYS.
    But its not getting inserted as a separate row in the table.
    Requirement is to insert the multiple rows in the database table without any over writing activity.
    Can anyone give me the code to do this?
    Regards
    Pavan

    Hi Pavan,
        Please let me know what are the key fields in your Ztable. Try with below code it may help you. change the "Ztablename" as your database table name and I_INTERNAL TABLE  as your internal table name. still you are facing the problem please let me know.
    lock the custom table before updating the table.
      CALL FUNCTION 'ENQUEUE_E_TABLE'
       EXPORTING
      MODE_RSTABLE         = 'E'
         TABNAME              = 'ZTABLENAME'
      VARKEY               =
      X_TABNAME            = ' '
      X_VARKEY             = ' '
      _SCOPE               = '2'
      _WAIT                = ' '
      _COLLECT             = ' '
       EXCEPTIONS
         FOREIGN_LOCK         = 1
         SYSTEM_FAILURE       = 2
         OTHERS               = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        INSERT  ZTABLENAME FROM TABLE I_INTERNALTABLE ACCEPTING DUPLICATE KEYS.
        COMMIT WORK.
      ENDIF.
    unlock after updating the custom table After updation is done.
      CALL FUNCTION 'DEQUEUE_E_TABLE'
       EXPORTING
        MODE_RSTABLE       = 'E'
         TABNAME            = 'ZTABLENAME'
        VARKEY             =
        X_TABNAME          = ' '
        X_VARKEY           = ' '
        _SCOPE             = '3'
        _SYNCHRON          = ' '
        _COLLECT           = ' '

  • Update database table

    I have 1 million records in application server and I want to update database table from that.
    Is UPDATE statement the best technique to do it.
    Just wanted to know if there is any other better tehcniques.
    Also i want to write the errors to job log. How can we do that?
    Regards,
    DNP

    If they are all new records or all changes, it would be best to use INSERT or UPDATE. You will also want to do mass inserts/changes using an internal table. Since you have so many records, you will probably have to do this in chunks in order to avoid dumping on the rollback area.
    Rob

  • Lock Object: Enqueue and Dequeue

    Hi
    Im using VB.Net, SAP .Net to do data entry, updates to
    SAP R/3.
    Now, I need to lock the data during user changes on
    particular documents.
    What I done is I created a lock object in SE11. Then
    it produce 2 functions which are the ENQUEUE and
    DEQUEUE.
    Since the data reading from Non-SAP, I check for Allow
    RFC and my lock mode is Exclusive and Cumulative.
    After that, I also created a remote-enabled RFCs to be
    call from VB.Net. These RFCs is calling the ENQUEUE
    and DEQUEUE.
    When I tested in SAP itself, the locking data is
    working perfectly. I checked in SM12, it does shows
    the locking entry.
    But when I try in VB.Net and call the function
    modules, it does not shows any entry in SM12. It is
    like nothing happen at all.
    After that, I do little test. Firstly I lock the data
    from SAP then I run VB.Net, and it does shows the
    message who is currently locking the data.
    Anybody could help me on this?
    Thank you.
    Regards.

    See the following extract from documentation. Check if your lock object definition is satisfying all of them.
    <i>Reference Fields for RFC-Enabled Lock Objects
    The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
    Parameters               Reference fields
    X_<field name>           DDENQ_LIKE-XPARFLAG
    _WAIT                    DDENQ_LIKE-WAITFLAG
    _SCOPE                   DDENQ_LIKE-SCOPE
    _SYNCHRON                DDENQ_LIKE-SYNCHRON
    </i>
    Here is the link to the documentation
    http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm
    Srinivas

  • Updating database table based on BAPI response in case of error

    Dear Experts,
    My scenario includes pulling records from database stagging table, and push one record at a time to BAPI_ALM_NOTIF_CREATE.
    I am using sender JDBC adapter(with select query and update query to mark records as processed).
    My question is : Once XI selects records, immediately status is updated in stagging table for the selected records as processed. what if BAPI could not create document? In this case I need to update status of that record as "Not processed".
    What should I use?
    If BPM, then please tell me the steps.
    Is this possible without BPM?
    What are the chances of failure between XI and BAPI?
    Please provide your inputs.
    Thank you.
    Div

    >
    S.R.Suraj wrote:
    > Hi Divyesh,
    >
    > Your steps are correct..
    >
    > 1. JBDC will read record with code = 0 and make it 1...
    > 2. Once the bapi process is completed all these read records shoudl be made as 2 (if completed successful) else 0 if bapi went into some error.. so that again the jdbc adapter can poll these records and give back to bapi for processing...
    >
    > Now your questions
    > >>So after selection and updation only proxy call will be done right? So for every polling of jdbc adapter ,proxy call will happen?
    > YEs every poll of jdbc will result in a proxy call and every time it will contain next set of records (as the earlier one have already marked as 1)
    >
    > >>How to achieve this?
    > Since this is a synchronous scenario JBDC->XI->Proxy and reverse, I have suggested to use responseonewaybean as a module in sender jdbc adapter (because sender jdbc cannot act synchronously thats why you need to use this module)..
    >
    > >>Do i need to use BPM? please suggest steps.
    > and if this is not working then go for BPM..the steps as i mentioned in my first thread..
    >
    > Regards
    > Suraj
    Hi Suraj,
    Thanks a lot for your support.
    It would be good if you can provide your inputs.
    Stagging table records status:
    Flag = 0 (XI will poll records)
    Flag = 1(XI has polled records and XI will se tthis flag by JDBC adapter)
    Flag =2 (should be done based on response from Proxy Tables parameter) Proxy will set tables parameter which will include info on error message and type.
    (Now based on new requiremets: for error records status should not be reset to 0 so that XI can poll records again, now stagging table should contain error records(for which proxy can not create notification in SAP) with error message and status flag 2)
    Now scenario would be JDBC to Proxy.
    Polling interval for JDBC adapter should be 1 minute.
    So I think status 0 to 1 will be done by XI after immediately selecting records.
    But how about Status 2 that has to be set only for error records only and  with error information.
    I have to update stagging table records with status 2 and error info based on proxy table response. How this can be done?
    This updation will be done in case of error only.
    I was thinking this aproach:
    We can have two interfaces.
    First interface will be jdbc to proxy:
    JDBC adapter select and update records with flag =1 and then send to proxy call and create document in SAP. At SAP side if document can not be created then they will store that error info in some table.
    Second Interfgace:
    Client SAP Proxy will periodically run and send these error records info to XI and XI will update stagging table records accordingly.
    Suraj, What is your sugestion in this solution? Do I need to use Responseonewaybean?
    Thanks Suraj
    Div

  • Function module like ENQUEUE and DEQUEUE for function location.

    Hi All,
    I should be highly appreciate if any one help me for locking function module like ENQUEUE and DEQUEUE
    for function location.
    Thanks
    Shaw

    Hi,
    You can either use the standard way of locking by using :
    data:lv_varkey          TYPE rstable-varkey.
    concatenate functional_location sy-mandt into lv_varkey .
    *   Lock table
        CALL FUNCTION 'ENQUEUE_E_TABLEE'
          EXPORTING
            mode_rstable   = 'E'
            tabname        = 'IFLOS'
            varkey         = lv_varkey
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
    *     Unlock table
          CALL FUNCTION 'DEQUEUE_E_TABLEE'
            EXPORTING
              mode_rstable = 'E'
              tabname      = 'IFLOS'
              varkey       = lv_varkey.
    Or,
    As mentioned above create a lock object via transaction SE11.
    Go to transaction se11:
    --> Enter lock object name e.g EZ_IFLOS
    --> Click on create
    --> Enter description
    --> Click on tables tab
    --> Enter 'IFLOS' as table name
    --> select lock mode
    --. click on save and activate.
    2 function modules will be created as DEQUEUE_EZ_IFLOS and ENQUEUE_EZ_IFLOS .
    Regards.

  • What ies ENQUEUE and DEQUEUE in BAPI??

    Enqueue and dequeue when using BAPI function modules...APart from that with data dictionary its locking and unlocking tables.How does it work in BAPI???
    regards ,
    LAvanya

    Hi Lavanya,
    Please reward points if this is helpful and close this thread.
    Enqueue and Dequeue using  BAPI can be used to lock an object.
    <b>For example :</b>
    If we need to lock and employee number to be edited only by the person who set the lock, we can use a BAPI.
    Do read the documentation of  '<b>BAPI_EMPLOYEE_ENQUEUE</b>'. It will give you a better idea of how to implement Enqueue for a BAPI.

Maybe you are looking for