How to use Enqueue/Dequeue to prevent concurrent write?

Hi All,
I have a report program that allows multiple users to save to the database tables.
How do I incorporate ENQUEUE and DEQUEUE statements to prevent concurrent write to ensure data integrity? Are there sample codes that I could refer to?
Thanks

Hi,
here screen get locked
CALL FUNCTION 'ENQUEUE_EIQMEL'
               EXPORTING
                    mandt            = sy-mandt
                    qmnum          = i_final_ap-qmnum  -Notification number
               EXCEPTIONS
                    foreign_lock     = 1
                    system_failure = 2
                    OTHERS         = 3.
*--Setting the  task "PE03" for notification  on screen
          CALL FUNCTION 'IQS4_ADD_DATA_NOTIFICATION'
               EXPORTING
                    i_qmnum    = i_final_ap-qmnum
                    i_conv     = ' '
                    i_post     = c_x
                    i_commit   = c_x
                    i_wait     = c_x
               TABLES
                    i_viqmsm_t = i_viqmsm_tmp
                    return     = i_return.
  CALL FUNCTION 'DEQUEUE_EIQMEL'
               EXPORTING
                    mandt = sy-mandt
                    qmnum = i_final_ap-qmnum.

Similar Messages

  • Lock specific number of records using ENQUEUE & DEQUEUE

    Hi,
    Is it possible to lock a group of records in R/3?
    My requirement is to update a set of records in VBAP table. I'm not using a BAPI here. Instead, I use a direct UPDATE.
    In this case, i know i can lock individual records by passing VBELN and POSNR. But what if i have to lock 10 records?
    Is this possible in any way?
    Thanks in advance.
    The current solution is:
    1) LOOP at ITAB
    2) LOCK each entry
    3) UPDATE VBAP for that entry
    4) UNLOCK the entry
    5) Endloop
    I thought this solution might work: (Assume 10 records are present in ITAB)
    1) LOOP at ITAB (Lock all 10 entries)
    2) LOCK that entry
    3) ENDLOOP
    4) UPDATE VBAP from ITAB (Updates all 10 entries in one databae access)
    5) LOOP at ITAB(Unlock all 10 entries)
    6) UNLOCK that entry
    7) ENDLOOP
    Any help will be appreciated.
    Tabraiz.

    Hello,
    Both of your solutions will work.
    With solution 1 there will always be only 1 enqueue object created, because you always enqueue, perform the update and dequeue.
    This means that in SM12 you will only see 1 enqueue entry on your user ID at the same time when your program runs.
    Solution 2 is also possible but there you will have different enqueue objects that will be created, because you enqueue everything, then perform the updates and then dequeue everything.
    In SM12 (lock entries) this will result in more enqueue records on your user ID the time your program runs.
    You have to pay attention that lock entries (SM12) are stored in a queue that is limited, so make sure with solution 2 that you don't overflow the enqueue queue ! ! !
    Via tcode RZ11 you can check parameter enque/table_size (Size of lock table).
    Check the parameter value but also its documentation and you will understand why you should limit the number of open lock records.
    Success.
    Wim Van den Wyngaert

  • How to use form personalization to lunch concurrent program

    Hi,
    Now I am using the form personalization to lunch a concurrent program with global variables.But how to post the global variables to the program parameters.
    Thanks and best regards
    Fang
    Edited by: 895910 on Dec 25, 2011 7:54 PM

    Hi,
    I have defined global variables using form personalization. But how should i launch a SRS Form to submit a request and pass the variables as parameters. What should the syntax be.
    Thanks and best regards,
    Fang

  • How to use active X controls to read/write protect an excel or word document created by created by Save Report to File VI

    Hi all,
    I'm trying to creat a word and excel documents using Save Report to File VI. When wiring a password to this last VI, the document created are only protected against writing but not reading. How can I use active X controls to password protect these documents against reading?
    Thanks a bunch!
    O

    There is no predefined functionality available in LabVIEW. So you have to implement this on your own.
    It seems to me that you own the Office Report Generation Toolkit. You can use the Excel Get ActiveX References.vi from the Excel Specific >> Advanced palette to get access to the "generic" ActiveX Excel references. Starting from this point, you can use property and invoke nodes to get to the setting you are going to modify.
    Please refer to this link for information on Excel password protection. I have not searched for the object giving you access to those settings though....
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Trying to figure out how to use the Microsoft Speech API to write speech to a WAV file.

    I have tried and tried to do this. I have downloaded the LabVIEW example for doing speech through the sound card and tried to modify it to write to a stream, but can not hook the correct objects together to get something that will work. Anyone have any ideas?

    Never mind - figured it out. Solution attached.
    Attachments:
    Text to WAV .llb ‏36 KB

  • How to use AQ Adapter for Enqueue and Dequeue in BPEL process

    Can anyone help me how to use Enqueue and Dequeue in BPEL process ? Any good sample or material /tutorial??
    Thanks

    You shoul create a while loop, that loops through XML payload for each row. Than you can process each individual row. See also example:
    C:\orabpel\samples\tutorials\112.Arrays\ArraySample.bpel

  • Issue with Enqueue / Dequeue

    We are working on a scenario where data is got into SAP through Web methods to create Sales orders.
    If we were to use Enqueue / Dequeue function while doing this would the web methods connection hold till the process is complete or would this time out in the middle?
    Is there any time out period for the connection with web methods, and if so how can it can be reset to an alternate value

    Hi,
    in ITS if you click on object, you can see the parmaters like
    ~TRANSACTION
    <b>~TIMEOUT</b>
    give more time for Time out parameter, that should solve the problem.
    Regards
    Vijay D T T.

  • How to use the Oracle AQ JMS API using Toplink

    My application is using AQ using PL/SQL. We want to convert the PL/SQL code to the JMS interface Oracle offers, the problem is that I need to use a java.sql.Connection object in order to connect to the AQ. I don't own the java.sql.Connection in Toplink. How can I enqueue/dequeue to a JMS AQ using Toplink?

    In the upcoming 10.1.3 release, TopLink supports mapping to/from Oracle AQ messages through a JCA adapter. This functionality is currently available in the 10.1.3 developer preview release on the Oracle OTN web site. If you have an earlier version of TopLink, using AQ directly may make more sense with TopLink only being used to access an existing JDBC connection.
    To use AQ directly a JDBC connection is required - then the AQ JMS interface can be used to access any messages. If TopLink has a JDBC connection with Oracle AQ, it (the JDBC connection) can be accessed via session.getAccessor().getConnection(). Also, if a J2EE datasource/connection pool is being used a JDBC connection could be obtained there as well. One thing to note is that creating a new JDBC connection would be 'safer', as this would avoid having the connection managed when it shouldn't be.
    For information on how Oracle TopLink provides EIS access to AQ, please refer to: http://www.oracle.com/technology/products/ias/toplink/preview/howto/eisAq/index.htm

  • Enqueue/Dequeue - Locking/Unlocking object

    Hi all,
    Please help me working with this enqueue/dequeue command. What I'm trying to do is to lock a Service Order. My requirement is to do a BDC for the Service Order Settlement Rule. So after hitting SAVE, a secondary process will be kicked off to perform my BDC for the same order. Now what Im doubting is that what if user re-enter the same Service Order again so quick. So my BDC program will not be performed immediately since it will be locked by the usser.
    So my idea is to lock it first while my BDC program is still running. Any help please? Thanks.

    Nope. Just 1 BDC -on my 2nd program only. Or to make it simple, I have modified ZXWOCU07 (IWO10009) to perform/kick off a call function( this is being triggered after hitting on SAVE). And this FM contains my checking if SO is now open for change then do the do the BDC.
    What I'm thinking is to lock first the SO  to block any user from accessing that SO, so it will do the BDC first. But I'm not yet familiar with the locking/unlocking of objects. Please help me on how to use enqueue or locking object.

  • Enqueue/Dequeue in Oracle Aq Adapter

    Hi,
    I need to use enqueue/dequeue option in oracle aq adapter.
    However i need to know how the macthing of ids has to happen.
    Can any one provide me with an example with details steps?
    Thanks,
    Rosh

    The below url will provide information about AQ adapter,
    http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_aq.htm
    Example of AQ adapter.
    http://jamessmith73.wordpress.com/oracle-fusion-middleware/oracle-soa-bpm-11g-blogs/soa-10g/soa-hands-on-4/
    Thanks,
    Vijay

  • How to use ThreadPoolExecutor / ArrayBlockingQueue with event objects

    I am having some trouble figuring out how to use the new java.util.concurrent library for a simple thread pool that has custom threads pulling off event objects from a queue.
    I started with this kind of code below, which I know is not right but am having trouble seeing the correct approach. Any help is appreciated. Thank You!
    -Paul
    public class testThreadPool {
    public static void main( String [] args ) {
    //work queue actaully only takes runnables,
    //but I need to add my event objects to this queue ??
    ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(20);
    ThreadPoolExecutor pool = new ThreadPoolExecutor(10,//pool size
    20,//max pool size
    1,
    TimeUnit.SECONDS,
    workQueue);//the work queue
    //this will ensure that the pool executor creates worker
    //threads of type MyThreadWorker
    pool.setThreadFactory(new MyThreadFactory());
    pool.prestartAllCoreThreads();
    //throw some events on the queue and let the pool workers
    //start to execute with the given event object
    workQueue.add(MyEvent);
    workQueue.add(AnotherEvent);
    class MyThreadFactory implements ThreadFactory {
    public Thread newThread(Runnable runnable) {
    return new (Thread)MyThreadWorker();
    class MyThreadWorker implements Runnable {
    private boolean m_run = true;
    public void run(){
    Object obj;
    while (m_run) {
    obj = null;
    //get the event object from the blocking queue
    try {
    obj = workQueue.take();
    } catch (InterruptedException e) {
    if ( obj == null ) continue;
    if ( obj == null ) continue;
    if (obj instanceof MyEvent) {
    //do this
    } else if (obj instanceof AnotherEvent) {
    //do this
    public void stopRunning(){
    m_run = false;
    this.interrupt();
    }

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • How to use File Adapter Receiver to write attachments

    Hi,
    i have a scenario, in which our own XInotes adapter sends an XIMessage from an IBM Lotus Notes database into XI. This XIMessage contains an XML document as application main document and several PDF files as additional attachments 
    On the receiver side, i must use a File Adapter to write both the XML documents and the PDF attachments into a directory.
    The problem is i don't know how to use the file adapter receiver to write the attachments. In the Channel Monitoring, i can see that all PDF files are transferred to the file receiver. But the file adapter writes only the XML document into the directory.
    I've also tried the AF_Modules/PayloadSwapBean, but it can only swap one PDF file into the application payload. And the file name must be hard coded in the module configuration as swap.KeyName.
    Could anyone give me any ideas?
    thanks a lot in advance
    Xiang

    hi,
    receiver file adapters do not supprt attachments.
    Only File Sender adapter is capable of handling attachments not the receiver.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4b/a20c4cfea96b498b1e1af3f32f0670/frameset.htm
    Configuring the sender FILE adapter
    The sender file adapter is configured to pick the normal payload (file1.xml), which is specified in the File
    access parameters, and the additional image file (file1.jpg) that is to be sent as an attachment is configured
    under the Additional File(s) as shown in the screenshot below. The file type would still remain binary.
    Since, by default, XI sends payload and attachments in XML format, we need to call two beans, namely the
    MessageTransformBean and the PayloadSwapBean to help us is transforming the content to jpeg format
    and also change the file extension.
    The PayloadSwapBean module is used to replace the application payload of the XI message that holds the
    data with another payload which is appended to the message as an attachment. In our case, the payload
    would be file1.xml whereas the attachment would be file1.jpg
    The swap module is denoted in our scenario with the module key ‘swap’. It has two parameters from the
    MIME header.
    regards,
    pradeep.

  • How to use onkeypress in HtmlInputText ?

    If I use a HtmlInputText that only can input number, how can I set onkeypress attribution. I know javascript can control. And now I want to know how to use in JSF. Should I write a customized component? and how to write? Thanks!

    The standard <h:inputText> tag can have "onkeypress" attribute:
    <h:inputText value="#{bean.prop}" onkeypress="return someFunc();"/>

  • JMS Enqueue/Dequeue without using oracle.jms package

    Hi,
    Is it possible to successfully enqueue/dequeue messages from Oracle AQ using JMS which only uses the classes under javax.jms package, not the classes under oracle.jms package. If possible, can anybody please provide some step by step example.
    Thanks

    You can get the connection factory and the queue from an application server's jndi. Create a resource provider reference in oc4j and get them from there. Read the oc4j services guide, oems (jms) chapter for how to do that.
    I think if you are not using an application server you can also get the connection factory and queue from an ldap directory. check out Aq user guide for that.

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Maybe you are looking for

  • How to do Title and Paragraph Side-by-side?

    I'd like to switch from Word to Pages, but I need to figure out how to format a title and/or a subtitle such that it sits to the left of a paragraph (horizontally even) rather than above it. In Word, I would put the Headings/subheadings into a text b

  • Download Flash Player content?

    I have Flash Player 10 & it works great.  I want to know how copy or download what is playing.  I've got a new Braun 790 electric razor.  When I go to: http://www.amazon.co.uk/Braun-System-Electric-Rechargeable-Shaver/dp/B000RNP5B4 - - I have the opt

  • WLP Content Management Repository

    We are using WLP content management system(file based repository), We have some configuration which is in content-config.xml, where we are setting a default value for "cm_fileSystem_path" to "c:\portal\content", so far it is ok, but once deployed in

  • Is it possible to keep a macbook pro charged to only 60%(when plugged in)?

    My purpose is extending the battery lifespan of my rMBP battery. I only use it at home. I know it needs some modification in OS X or Battery firmware and it's not an easy thing to do, and no one has done it yet. Any possibility for this? According to

  • [SOLVED] systemd and ConsoleKit - I'm a little confused

    I'm using SLIM and Openbox and am in the process of converting to systemd. I've added the needed configuration files for systemd. I can boot using the wiki instructions here https://wiki.archlinux.org/index.php/Sy - stallation I've added SLIM as a se