Is it Advisable to use wait in program ?

Is is advisable to use 'wait' in programs ? I need to do a select on a table , that i just wrote ....If i dont do a wait in the program , the select returns blank...!!
Does this make a major performance setback in a program ?
clear bkpf.
clear bkpf2.
wait up to 2 seconds.
    select single * from bkpf into bkpf where
    belnr = belnr1 and bukrs = messtab-msgv2 .
    if sy-subrc = 0.
if dist >= 2.
    select single * from bkpf into bkpf2 where
    bvorg = bkpf-bvorg and belnr <> belnr1 and gjahr = bkpf-gjahr.
    if sy-subrc = 0.
    write :/  Cross Company doc num: ' , bkpf-bvorg color 5.
    write :/  'Posted In Company Code : ' , bkpf-bukrs color 5.
    uline.

Hi,
I don't think wait up to 2 seconds will cause major performance while waiting messtab-msgv2 value.
Is this inside loop statement?
Regards,
Ferry Lianto

Similar Messages

  • Advise on using DBMS_XA with multiple branches under one global transaction

    Dear all
    I need some advise on using DBMS_XA from PL/SQL with tightly coupled multiple branches under one global transaction. Basically, I've successfully written some PL/SQL code that in 3 different sessions attaches to 3 different branches of one global transaction and before ending each branch they can see each others uncommitted data. So far so good.
    However, I'm not sure I completely understand how each branch must call xa_end, xa_prepare and xa_commit correctly using two phase commit and my calls result in errors like:
    ORA-24767: transaction branch prepare returns read-only (XA error code 3 = Transaction was read-only and has been committed)
    ORA-24756: transaction does not exist (XA error code -4 = XID is not valid)
    ORA-02051: another session or branch in same transaction failed or finalized
    This is the structure of my programs (3 SQL*Plus sessions):
    main: Uses xid 123|0 (branch 0 of global transaction 123). This should be the coordinator that commits using two phase commit across the 3 branches
    m1.xa_start tmnoflags
    m2.DML
    m3.Wait for thread A + B to manually be started and run xa_end
    m4.xa_end tmsuccess
    m5.xa_prepare
    m6.xa_commit false
    thread A: Uses xid 123|A (branch A of global transaction 123)
    a1.xa_start tmnoflags
    a2.DML -- thread A can see main and thread B's data
    a3.xa_end tmsuccess
    a4.xa_prepare -- required?
    a5.Should we also call xa_commit false?
    thread B: Uses xid 123|B (branch B of global transaction 123)
    b1.xa_start tmnoflags
    b2.DML -- thread B can see main and thread A's data
    b3.xa_end tmsuccess
    b4.xa_prepare -- required?
    b5.Should we also call xa_commit false?
    The failing steps are:
    m5
    m6
    a4
    a5
    b4
    b5
    Before starting calling xa_end I see 3 rows in V$GLOBAL_TRANSACTION, eg (hex 7B = decimal 123):
    FORMATID GLOBALID BRANCHID BRANCHES REFCOUNT PREPARECOUNT STATE FLAGS COUPLING
    203348753 0000007B 00000000000000000000000000000000 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    203348753 0000007B 0000000000000000000000000000000A 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    203348753 0000007B 0000000000000000000000000000000B 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    Thanks a lot in advance.
    Cheers
    Finn

    OK, I've figured it out. This is poorly documented as it's not well explained how to handle the various return codes. Turns out that all but the last xa_prepare calls return dbms_xa.xa_rdonly (tightly coupled branches are combined -- "read only" optimization), the last one returns dbms_xa.xa_ok and this is when you should call xa_commit.
    Now my next problem is that DBMS_XA doesn't work from within jobs (DBMS_JOB and DBMS_SCHEDULER), which makes it very difficult to use DBMS_XA. My purpose of using DBMS_XA is to coordinate work across multiple sessions in one transaction but if I can't easily create the multiple sessions, I'm stuck.
    When called from a job, xa_start throws:
    ORA-24789: start not allowed in recursive call
    on Oracle 11.2. In Oracle 11.1 it works, but xa_end fails with
    ORA-25352: no current transaction
    so I guess in fact the xa_start call didn't really work either, even though it returned tm_ok.
    I'm now trying to find a workaround on how to use DBMS_XA from within jobs, please comment if you have any suggestions. Or if you have any suggestions on other means of establishing the concurrent sessions (I wouldn't like to resort to external programs that need username/password to connect as password management would be a security issue).
    Thanks in advance.
    Cheers
    Finn

  • Report to check authorization object used in customized programs

    Hi Guys,
    An auditor came and he raised a question to us, he asked whether all of our customized transactions and programs are maintained with authorization checks? The question is how can we check what authorization objects are used for our customized programs and transaction codes? The developer did not maintain the objects used for that program in SU24 table. Is there a program or a report to show us all the authorization object used for a customised program or transaction? Example : T-code MIGO we can check in SU24 table for all the authorization object used. How do we check for customized tcodes? Please advise. Thanks!
    Edited by: Jarod Tan on Nov 25, 2010 9:42 AM

    Note that some programs are built in such a way that no (visible) auth check is necessary, or even desired at all.
    To determine the necessity of an auth check, you should check that starting it has an entry point (tcode, rfc, service) which is appropriately restricted. The rest (whether and where and how a further check is evaluated) is entirely dependent to what the program actually does.
    Well designed applications generally have centralized functions and methods, and the checks are in there or a "base check" they use.
    Others again use the same in UI programming to determine the visibility of functions, to make the application more intuitive for the user. This on it's own is however not a sufficient auth check to rely on.
    Code review is an art form!
    Cheers,
    Julius

  • How to use wait/nofity in socket server

    Dear all
    that is one of sample code from a book which's use mutil connection with socket program , but i if it is possible to use wait and nofity to controle client activety by wait and notify in this sample code ?
    some idea hope someone give me a help please
    import java.net.*;
    import java.io.*;
    * Threaded Echo Server, pre-allocation scheme.
    * Each Thread waits in its accept() call for a connection; this synchronizes
    * on the serversocket when calling its accept() method.
    * @author Ian F. Darwin.
    public class EchoServerThreaded2 {
         public static final int ECHOPORT = 7;
         public static final int NUM_THREADS = 4;
         /** Main method, to start the servers. */
         public static void main(String[] av)
              new EchoServerThreaded2(ECHOPORT, NUM_THREADS);
         /** Constructor */
         public EchoServerThreaded2(int port, int numThreads)
              ServerSocket servSock;
              Socket clientSocket;
              try {
                   servSock = new ServerSocket(ECHOPORT);
              } catch(IOException e) {
                   /* Crash the server if IO fails. Something bad has happened */
                   System.err.println("Could not create ServerSocket " + e);
                   System.exit(1);
                   return;     /*NOTREACHED*/
              // Create a series of threads and start them.
              for (int i=0; i<numThreads; i++) {
                   new Thread(new Handler(servSock, i)).start();
         /** A Thread subclass to handle one client conversation. */
         class Handler extends Thread {
              ServerSocket servSock;
              int threadNumber;
              /** Construct a Handler. */
              Handler(ServerSocket s, int i) {
                   super();
                   servSock = s;
                   threadNumber = i;
                   setName("Thread " + threadNumber);
              public void run()
                   /* Wait for a connection. Synchronized on the ServerSocket
                    * while calling its accept() method. */
                   while (true){
                        try {
                             System.out.println( getName() + " waiting");
                             Socket clientSocket;
                             // Wait here for the next connection.
                             synchronized(servSock) {
                                  clientSocket = servSock.accept();
                             System.out.println(getName() + " starting, IP=" +
                                  clientSocket.getInetAddress());
                             DataInputStream is = new DataInputStream(
                                  clientSocket.getInputStream());
                             PrintStream os = new PrintStream(
                                  clientSocket.getOutputStream(), true);
                             String line;
                             while ((line = is.readLine()) != null) {
                                  os.print(line + "\r\n");
                                  os.flush();
                             System.out.println(getName() + " ENDED ");
                             clientSocket.close();
                        } catch (IOException ex) {
                             System.out.println(getName() + ": IO Error on socket " + ex);
                             return;
    }if i add end of my code like this and then the error message indicat that
    java.lang.IllegalMonitorStateException: current thread not owner
    try{
                        clientSocket.wait();
                 }catch(InterruptedException e){
                                              clientSocket.close();
                                              clientSocket.notify();
                                            }

    Why? Closing the socket will cause the client to return from reading the socket with a null or zero or EOFException. You don't need anything else.
    In any case notifying the clientSocket will only wakeup threads in the current JVM that are waiting on it. This mechanism isn't magic, and it can't wake up another JVM.

  • Hi. I am trying to use Bridge to make web galleries. There used to be something on PS for that but now I cant find it in PS so I was advised to use Bridge.  However, there is something called Output Module (AOM) that is missing from my Bridge.  I download

    Hi. I am trying to use Bridge to make web galleries. There used to be something on PS for that but now I cant find it in PS so I was advised to use Bridge.  However, there is something called Output Module (AOM) that is missing from my Bridge.  I downloaded this.  The instructions say :Copy the Adobe Output Module folder (not the AOM_Package_[OS] folder) into the Bridge CC Extensions folder in the appropriate location: 
    Windows: C:\Program Files\Common Files\Adobe\Bridge CC Extensions
    Mac OS: /Library/Application Support/Adobe/Bridge CC Extensions.  However there is noplace on my Macbook Air running Yosemetie that has this /Library/Applications SUpport/Bridge CC Extensions. Can anyone advise?

    That file could be set as a Launch Agent or Daemon in your ~/Library or /Library, You could try to look for it or Safeboot your computer and then empty the trash. Safebooting disables Launch Agents/Daemon and Third Party Kernal extensions. Here's the article to Safeboot OS X: What is Safe Boot, Safe Mode? - Apple Support

  • How and when to use WAIT parameter in BAPI_TRANSACTION_COMMIT? Help!

    Hi Experts,
       In the BAPI_TRANSACTION_COMMIT function module there is an input parameter "WAIT".
      What is the significance or use of WAIT?
      How do we use it? What values does it take?
      For which case do we use WAIT and for which not?
    KIndly help me understand this.
    Thanks
    Gopal

    Hi,
    This method executes a COMMIT WORK command. It is required for transactions developed externally to the R/3 System  that change data in the R/3 System via BAPI calls.
    When you call BAPIs in your program that change data in the R/3 System, afterwards you must call this method to write the changes to the database.
    The default value of this parameter is SPACE. If the parameter contains the value SPACE or it does not contain a value at all, then a simple COMMIT WORK is executed.
    If the parameter WAIT contains a value other than SPACE, a COMMIT WORK AND WAIT command is executed.
    The result is that the data within a Logical Unit of Work (LUW), changed by one or more BAPIs after the BAPI 'BapiService.TransactionCommit' has been called, is immediately available in the database.
    The following values are possible:
    The command 'COMMIT WORK' is executed - the program does not wait, until COMMIT WORK is completed. When the database is next accessed directly, all the old data may still be able to be read.
    'X'
    The command 'COMMIT WORK AND WAIT' is executed - the program waits until the COMMIT WORK is completed. When the database is next accessed, the updated data is read.
    reference : function module documentation.
    thanx.
    Edited by: Dhanashri Pawar on Sep 18, 2008 6:41 AM

  • My Cam says it is in use by another program.

    Hello, I have just bought a new Rocketfish Notebook Camera and got a program that will run it on ichat for my mac mini. It is a USB cord and I have used Mac Cam to help but everytime I try using the camera, it says that it is in use by another program even when there is no other running. I have already deleted the Web Cam program like I was supposed to but I get nothing, please help me.
    mac mini   Mac OS X (10.4.9)  

    mwigie2007,
    Did you seek for information on these pages by MVL design?
    This site is very often advised and it has a tendency to cause the
    error return, good site though. Little last year but clear.
    http://www.mvldesign.com/videoconferencetutorial.html
    If so, close the browser, it uses your camera as long as you have the browser
    open.
    You don't have to install additional software to use your camera if it
    has the UVC feature . It should say so on the box or in the manual.
    I think it doesn't need the software you installed, switch off
    the mini, unplug the camera. Resart, use the uninstall feature of the
    camera software. (check the manual). Plug the camera, another restart
    and I cross my fingers.
    To uninstall the Mac driver:
    1 Insert the Rocketfish Installation CD into the CD-ROM drive in your
    computer, then double click on the CD-ROM drive.
    2 Click the Rocketfish Driver OSX 1.0 file folder.
    3 Click on Rocketfish Driver Uninstall, then follow the on-screen instructions.
    JP

  • Just upgraded to Lion and can not use my QuarkXpress program.

    Just upgraded to Lion and can not use my QuarkXpress program.

    Your best bet is to check the version of QuarkXPress you have. Since Lion does not include Rosetta my guess is this may be why it is not working. Check out this site http://roaringapps.com/apps:table. This site has a list of apps that work and don't work under Mac OS X Lion.
    If you are working in a production environment freelance or stuido that uses design apps like QuarkXPress, Adobe InDesign, Illustrator, Photoshop you should always wait to upgrade your OS. We have a 3 to 6 month policy for upgrading computers and software.
    I hope the website helps.  http://roaringapps.com/apps:table
    Good Luck

  • How to use wait.for() /wait() commands for MAC? Not working...

    I am trying to run an external application on mac using runtime.exec() and it runs fine but after it runs it suddenly terminates the program. I have a waitFor() command after the runtime.exec() waiting for that program to end. If i comment out the waitFor() then the program terminates by going through the run command. The waitFor() worked fine for PC but doesnt work for MAC... anyone know what i did wrong or alternative way of listening for it? thanks!

    On the PC i have the following:
    Process p = Runtime.getRuntime().exec("C:\\program Files\\QuickTime\\QuickTimePlayer.exe "
    +file.getPath());
    p.waitFor();
    It basically creates a process of QuicktimePlayer and runs the file specified. I then have p.waitFor() used to wait for the user to close the application so i can do listener stuff for it- it worked for PC.
    On Mac
    String b= "open"+ tempFile.getPath();
    Process p= Runtime.getRuntime().exec(b);
    System.out.println("before wait");
    p.waitFor(); .
    System.out.println("app. terminated");
    output:*
    "before wait".
    Program terminates before System.out.println("app. terminated"); but the application (quicktime) starts.
    if I do this:
    String b= "open"+ tempFile.getPath();
    Process p= Runtime.getRuntime().exec(b);
    System.out.println("before wait");
    // p.waitFor(); .
    System.out.println("app. terminated");
    output:*
    before wait
    app.terminated
    program terminates "normally" and I see "app.terminated".
    I used Eclipse so the "red square" turns red when running it and suddenly grays out when the player appears. So to me the program terminated before the p.waitFor(); If i commented out p.waitFor() then the program goes to the System.out statement and everything goes "fine". I tried using thread.wait(), this.wait() p.wait() etc. but i get errors saying they are not owner of the thread.
    hope this helps. thanks

  • Can i use wait up to 10000 seconds?

    can i use wait up to 10000 seconds?
    wht is the impact of the program ? efficeincy? possibility? etc etc

    Hi Shahid,
    What you are trying to do is impractical.There is a maximum time that a transaction can run.This is set by BASIS team.Typically it will be between 10 min and 1 hr.After which program terminates
    Moreover this will be have adverse affects..Better schedule a job in background that runs once in 3 hrs...
    Please reward if useful
    Thanks Arjun

  • Hi, I've just downloaded Aperture 3.2 and transfered all my iPhoto Library but now when I use the Aperture program it runs at the slowest speed possible and is almost impossible to work with. It is constantly processing why is this?

    Hi, I've just downloaded Aperture 3.2 and transfered all my iPhoto Library but now when I use the Aperture program it runs at the slowest speed possible and is almost impossible to work with. It is constantly processing why is this?

    You can click on the text that says 'processing' in the main windows and it will open (toggle) the Activity Window, (can also be accessed via the Window menu -> Show Activity.
    It will tell you what Aperture is doing with more precision and perhaps even how many photos it still needs to process. It is generally best to wait until all that processing is done before you start working with the photos (well it is best to first turn of options what you dont want to use, perhaps Faces or Previews and then let it process the new photos).

  • Using iPad mail program I have a draft of an email. I attempted to "cancel" and "delete draft" but it is still on my screen even after shutting down and restarting. How do I exit so that I can use other mail functions?

    Using iPad mail program I have a draft of an email. I have attempted to "cancel" this and "delete draft" but the email stays on my screen. How can I exit this so that I can use other email functions?

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • I have a fully paid subscription to CC and use of installed programs but I can no longer sign in to CC. It repeatedly says "You've been signed out". I have the need to install another program but I can't sign in.

    I have a fully paid subscription to CC and use of installed programs but I can no longer sign in to CC. It repeatedly says "You've been signed out". I have the need to install another program but I can't sign in.

    Sign Out When Sign In http://forums.adobe.com/thread/1450581?tstart=0 may help
    -and http://helpx.adobe.com/creative-cloud/kb/unable-login-creative-cloud-248.html

  • If i purchase a movie from iTunes on my Windows 7 PC is there a way I can download it and watch it offline without using the iTunes program?

    I have been trying to figure out the answer to this all day I want to purchase The Interview I know you can download but I want to know if you can watch it offline without using the iTunes program like will i get the file to this movie i purchased?

    Thank you i been looking for a  answer to this all day but I couldn't find anything on it! Now I know I will find a file with it! thanks!

  • I am trying to use an education program that needs Java applets to install and use and it will not use Safari. When I download IE from the web it will not install. How can I get a browser that will work on my MacAir for travel use of this program?

    I am trying to use and education program that needs Java applets and it will not run on Safari. IE will not install from the web. How do I get a browser that will work to install so I can use this program when I travel.

    Try using FireFox. IE will only run on a Mac if you run Windows on the Mac.
    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    Install the Apple Boot Camp software.  Purchase Windows 7 or Windows 8.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    VM Fusion and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    VirtualBox is a new Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. A more recent comparison of Parallels, VM Fusion, and Virtual Box is found at Virtualization Benchmarks- Parallels 10 vs. Fusion 7 vs. VirtualBox. Boot Camp is only available with Leopard and later. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

Maybe you are looking for

  • "The content server is unreachable" recurrent error

    In trying to "Download Additional Content" I am having the recurrent error This is despite the networn being fully connected (I am typing this online!), with no firewall, and having rebooted the computer twice. Is there any way around this? Software

  • TS3899 How do I send a "spam" email as an attachment to iCloud using my iPad or iPhone

    ICloud directs you to send spam email as an attachment in an email to [email protected] I have no problem doing that on my MacBook Pro but cannot find "message=>forward As Attachment" from the menu bar on my iPhone or iPad. Can anyone direct me?

  • Muse with Business Catalyst vs GoDaddy

    My client would like to make edits on his own to his website I built for him in Muse.  I currently host his site the their emails via GoDaddy. I also have two Wordpress blogs wrapped into the same hosting package.  That being said, I really don't wan

  • Server Not Found/CD not avaliable

    I've been trying for two day to purchace my cart. I the the following messages when I click on purchace cart at the bottom. The contents of your chart have changed, please review when I click ok "We could not complete your music store request. The se

  • Custom mouse icons

    I would like to import a different image for a mouse icon on several slides. I would like to create the image of a bar scanner moving so that the scanner can "read" the code in the lesson I am creating. I have Captivate 2, we will be upgrading to Cap