Performance issue Runtime. exec("cp folder1 folder") in Linux,Weblogic.

Using Runtime. exec() copying files from folder1 to folder2 using cp command in Linux. It will take each file copy 2 sec if we use web logic 10.3 and jrocket. if we run in Linux without web logic it takes only 0.013 sec. why it takes more time to load cp command with web logic.
Environment
Weblogic 10.3
Linux 5.2
Jrocket 1.6

A 64 bit VM is not necessarily faster than a 32 bit one. I remember at least on suggestion that it could be slower.
Make sure you use the -server option.
As a guess IBM isn't necessarily a slouch when it comes to Java. It might simply be that their VM was faster. Could have used a different dom library as well.
Could be an environment problem of course.
Profiling the application and the machine as well might provide information.

Similar Messages

  • Security issues - Runtime().exec() on RMIServer

    Hi.
    I have a RMI system where the RMIClient calls the RMIServer to start a new program - notepad.exe - at the RMIServer.
    RMIServer has a remote object that uses Runtime().exec() to start notepad.exe.
    I have the following security policy file on the RMIServer:
    grant {
    permission java.net.SocketPermission "*:1024-65535",
    "connect,accept";
    permission java.net.SocketPermission "*:80", "connect";
    permission java.io.FilePermission "C:\\WINNT\\system32", "read,write,execute";
    I am getting the following exception:
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkExec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at HelloImpl.executeLocalProgram(HelloImpl.java:32)
    at HelloImpl.sayHello(HelloImpl.java:22)
    at java.lang.reflect.Method.invoke(Native Method)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    I am not sure if I am missing any other security configuration. Please advise.
    thankyou.
    Denny

    I think you may have the first path specified wrongly. Try making the first parameter "C:\\WINNT\\system32\\notepad.exe" see the JavaDoc for java.io.FilePermission for specifics.
    Dave.

  • Runtime.exec() does not work under Linux

    Hi,
    I have a generic application runner class that runs an external
    program and redirects stdout/stderr to a buffer/file.
    While everythings works just fine under Windows, I get the
    following exception under Linux trying to run the Java interpreter
    'java':
    java.io.IOException: "/usr/lib/SunJava2-1.3.1/jre/bin/java": not found
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:139)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:546)
    at java.lang.Runtime.exec(Runtime.java:413)
    I have checked that the file /usr/lib/SunJava2-1.3.1/jre/bin/java
    exists.
    Any help appreciated!
    Marc

    can I ask how you solved it? I am having a problem
    with quotes just now to and it might help me!I simply tested what the current platform is and
    only used quotes under Windows.
    Marc

  • Aperture performance issues.

    Dear members:
    After some disappointments with the latest version of Bridge (CS3) I decided to start working with Aperture as I found it offered some interesting tools for viewing and selecting images.
    First I worked on some test images and everything went well. However, last night I did my first import of "real world" images and experienced severe performance issues.
    I imported one folder containing 163 photos to two different locations - the folder and the images were the same but imported into two separate locations in Aperture as I was trying to create the ideal file structure for me.
    These are the questions and/or problems I have.
    1. This IS NOT a major problem. As much as I tried to import photos into an album or folder I couldn't do it. I don't like the project concept and prefer to have my images placed into folders or albums. My iPhoto library was imported by Aperture using this structure. The iPhoto library is a folder with albums as subdivisions as they were set up in iPhoto originally. However, this doesn't seem to be working as I import photos from other locations.
    Q: How can I import photos into folders or albums and completely avoid the projects concept and icons ?
    2. This IS major problem. Performance was very poor. I imported the folders last night and waited for approximately 30 min until I decided to turn my computer off. Aperture gave me a message stating that it was still generating previews and asking me if I wanted to quit. I pressed the OK button and turned the computer off. This morning I launced Aperture again and it went back to the spinning wheel on both projects. It must have taken approximately 45 min until the spinning wheels were no longer turning.
    This is a problem for me as I have a library with approximately 15,000 - 20,000 images. The ones I imported last night were CR2 generated by a Canon 1Ds MK II (17 MB each). I can only imagine how long it would have taken had I chosen to import the 120+ MB TIFF images I also have in my library from slide scans.
    My Aperture preferences have been set for Preview Quality = 12 and Limit Preview Size = Don't Limit. I have it set this way as I don't with to have reduced size previews so that (1) they can display with the highest possible quality as I mostly use the full screen mode for viewing and selecting images, and (2) in case I upgrade to a larger monitor in the near future (I have a 23" cinema display but am planning to upgrade to a 30") the previews will still work with that monitor.
    Is this performace typical of Aperture ? I understand my camera is a professional camera that generates large images but isn't Aperture supposed to be a professional application aimed at professional photographers ? And what about those who work with 39 MB images from a Hasselblad or with scanned 120+ MB slide images ?
    Is there something obvious I have forgotten to look at or set up in Aperture ?
    Thank you in advance,
    Joseph Chamberlain

    Steve:
    Thank you very much for your reply to my post and for your suggestions. Some comments about my experience appear below. I am grateful for your help and don't wish in any way to discuss what you recommend below. I just wish to share my view of this issue and also to try to find the best answers for my problem.
    For 1, use File > Import > Folders Into A Project. That will retain your folder
    structure using brown folders and albums.
    See:
    http://www.bagelturf.com/aparticles/library/fivesimple/index.html and
    http://www.bagelturf.com/aparticles/library/brown/index.html and
    http://www.bagelturf.com/aparticles/library/libinadv/index.html
    A. You can't. Projects are the container for everything in Aperture. No
    projects, no images. So just live with them and subnvert them any way you
    like. I don't have "projects" so I just use months, vacations, events, or
    whatever keeps my image collections a reasonable size.
    As an user I would like to have control over my own filing structure. This works quite well in iPhoto and I don't understand why Aperture chose to adopt this less flexible file structure. Also I noticed that the imported iPhoto library appears in Aperture inside a folder with multiple albums. Since Aperture can do this for iPhoto I find it hard to understand why it can't do for other imported images.
    2. Turn off previews and delete the ones you have. When you find you need > them, use them selectively:
    http://www.bagelturf.com/aparticles/previews/pwho/index.html
    As stated in my previous post I always (no exception) use the full screen mode for viewing my images which is similar to a slide show. So according to the web page you reference above I would fall under the category of users that need previews.
    You don't need high res previews. Aperture already generates thumbnails
    for you.
    General speed tips:
    * Get the best video card with the most RAM you can afford
    I can't. My computer is fairly new as it was purchased a little more than 2 years ago. Although it is a fairly new computer Apple no longer offers parts for it. My video card is an ATI Radeon 9600 Pro with 64 MB of VRAM installed. I have contacted Apple about this issue and they tell me there is nothing they can do. I have also contacted both ATI Radeon and nVidia and both have discontinued the only two cards they would work in my system (X800 XT Mac Edition and GeForce 6800, respectively).
    * Smaller screens are faster than larger screens
    My screen is 23" which I would consider to be a medium size screen by today's standards. However, isn't the purpose of working with Aperture to be able to develop a professional workflow ? And don't most professionals like to use large screens to view their work ?
    * Avoid H&S adjustments until all the others are done
    * Make sure you have sufficient RAM (2G minimum, 3G on a Mac Pro)
    My system has 2.5 GB RAM installed. It has been suggested to me that I should add another 1 or 2 GB RAM as it would improve performance significantly. I have no problem doing that and would welcome that solution if I knew for a fact it was going to address my issues. However, I have already invested too much on hardware and software while still finding myself struggling with the issues I have described. Do you think the additional RAM would solve the problem ?
    * Don't use previews unless you need them
    Based on what I have read on the pages you referenced it seems to me I am one of those users who needs previews.
    * Keep projects small. Use blue folders to group projects
    My current filing structure is simple - I four folders each with subfolders containing in average 200 to 1000 images each. Some have as little as 1 image and some have 1000. But the majority would fall in the 300 to 400 images range.
    * Rebuild the database once in a while
    * Quit other apps if memory is restrictive
    It seems in this case that the RAM upgrade I mention above would be helpful. Would it allow me to run other applications while also running Aperture without any noticeable performance alteration ?
    To a great extent you have to rethink your workflow once you use Aperture.
    Many people do a lot of unnecessary things because they are coming from
    an environment that forced them to. Start from scratch and ask yourself
    why you do everything you do. Much of the effort you will find is wasted
    because Aperture either does it for you or make it unnecessary.
    I am trying to simply my workflow as much as I can but not at the expense of quality. Bridge CS2 did a very good job for me. In many ways it was the perfect application althout it didn't have many of the great features I find in Aperture for reviewing and selecting images. First it was simple - all you had to do was to create your own file structure and then point Bridge to the folders as it would create its own previews. Second it was fast - this process happened a lot faster compared to Aperture and Bridge CS3. Third it was high quality - the previews generated were high quality and could be seen with amazing resolution while in slide show viewing mode on my 23" screen. My upgrade to Bridge CS3 was disastrous as (1) it has many bugs Adobe hasn't taken the time to fix, (2) it is slow on average machines requiring the latest hardware to run efficiently which is unrealistic for most consumers and (3) the previews generated are soft and appear pixilated and in poor quality while in slide show view.
    I am going back to Aperture after a very disappointing start as I was one of the very first to purchase the software as soon as it was introduced only to be frustrated with all of its bugs and design flaws. Aperture has one of the best interfaces I have seen on any imaging application and I would really like to use but after this new attempt to use and the barriers I have encountered I am not sure I can.
    Joseph Chamberlain

  • Performance issues with class loader on Windows server

    We are observing some performance issues in our application. We are Using weblogic 11g with Java6 on a windows 2003 server
    The thread dumps indicate many threads are waiting in queue for the native file methods:
    "[ACTIVE] ExecuteThread: '106' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE
         java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
         java.io.File.exists(Unknown Source)
         weblogic.utils.classloaders.ClasspathClassFinder.getFileSource(ClasspathClassFinder.java:398)
         weblogic.utils.classloaders.ClasspathClassFinder.getSourcesInternal(ClasspathClassFinder.java:347)
         weblogic.utils.classloaders.ClasspathClassFinder.getSource(ClasspathClassFinder.java:316)
         weblogic.application.io.ManifestFinder.getSource(ManifestFinder.java:75)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.application.utils.CompositeWebAppFinder.getSource(CompositeWebAppFinder.java:71)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.CodeGenClassFinder.getSource(CodeGenClassFinder.java:33)
         weblogic.utils.classloaders.GenericClassLoader.findResource(GenericClassLoader.java:210)
         weblogic.utils.classloaders.GenericClassLoader.getResourceInternal(GenericClassLoader.java:160)
         weblogic.utils.classloaders.GenericClassLoader.getResource(GenericClassLoader.java:182)
         java.lang.ClassLoader.getResourceAsStream(Unknown Source)
         javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
         javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
         javax.xml.parsers.FactoryFinder.find(Unknown Source)
         javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
         org.ajax4jsf.context.ResponseWriterContentHandler.<init>(ResponseWriterContentHandler.java:48)
         org.ajax4jsf.context.ViewResources$HeadResponseWriter.<init>(ViewResources.java:259)
         org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:445)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
         org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
    On googling this seems to be an issue with java file handling on windows servers and I couldn't find a solution yet. Any recommendation or pointer is appreciated

    Hi shubhu,
    I just analyzed your partial Thread Dump data, the problem is that the ajax4jsf framework ResponseWriterContentHandler triggers internally a new instance of the DocumentBuilderFactory; every time; triggering heavy IO contention because of Class loader / JAR file search operations.
    Too many of these IO operations under heavy load will create excessive contention and severe performance degradation; regardless of the OS you are running your JVM on.
    Please review the link below and see if this is related to your problem.. This is a known issue in JBOSS JIRA when using RichFaces / ajaxJSF.
    https://issues.jboss.org/browse/JBPAPP-6166
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Issue using Runtime.exec() in Vista

    I've coded a simple method using Runtime.exec() to get the client MAC ID , and it worked alright on XP. Now my client want to switch to vista , and the method is not working. Here's my code
    import java.io.*;
    import java.util.regex.*;
    public class GetMac
         public static String getMacAddress()
              String mac="";
              System.out.println("getMacAddress");
              try {
                   RunTimeExecutor re=new RunTimeExecutor("ipconfig /all");
                    mac=re.executeAndReturnMac();
                    re.destroy();
              } catch (Exception e) {
                   e.printStackTrace();
              return mac;
    import java.io.IOException;
    import java.io.InputStream;
    * @author amal
    public class RunTimeExecutor
              String cmd;
              Process proc;
               * @param cmd
              public RunTimeExecutor(String cmd)
                        this.cmd=cmd;
               * @return boolean
               * @throws WIException
              public  String executeAndReturnMac() throws Exception
                   System.out.println("run");
                   String mac="";
                        if(cmd==null)
                                  throw new Exception("No Commands");
                        try
                              final Runtime rt = Runtime.getRuntime();
                              proc = rt.exec(cmd);
                              final StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream());
                              InputStream iis=proc.getInputStream();
                              final StreamGobbler outputGobbler = new StreamGobbler(iis);
                              errorGobbler.start();
                              outputGobbler.start();
                              int exit=proc.waitFor();
                              System.out.println("exitVAl "+exit);
                              if(exit==0)
                                   mac=outputGobbler.MAC;
                              return (exit==0) ? mac :null;
                    catch (IOException e)
                              e.printStackTrace();
                    catch (InterruptedException e)
                              e.printStackTrace();
                    catch(Exception e)
                         e.printStackTrace();
                    return null;
              public void destroy()
                        if(proc!=null )
                                  proc.destroy();
    * @author amal
    import java.io.*;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * @author amal
    public class StreamGobbler extends Thread
        InputStream is;
        OutputStream os;
        public String MAC;
        StreamGobbler(InputStream is)
            this(is,null);
        StreamGobbler(InputStream is,OutputStream redirectTo)
            this.is = is;
            this.os = redirectTo;
         * @see java.lang.Thread#run()
        public void run()
            try
                PrintWriter pw = null;
                if (os != null)
                    pw = new PrintWriter(os);
                InputStreamReader isr = new InputStreamReader(is);
                int c=0;
                BufferedReader br = new BufferedReader(isr);
                String line=null;
    System.out.println("Start Reading");
                     while ( (line = br.readLine()) != null)
                          System.out.println(line);
                         if (pw != null)
                             pw.println(line);
                         Pattern p = Pattern.compile(".*Physical Address.*: (.*)");
                            Matcher m = p.matcher(line);
                            if (m.matches())
                                 MAC = m.group(1);
                                 System.out.println("seting MAC to "+MAC);
                                 break;
                if (pw != null)
                    pw.flush();
            } catch (Exception e)
                e.printStackTrace(); 
    }The inputStream of the process doesnt get printed at all , the loop condition in StreamGobbler 'while ( (line = br.readLine()) != null)
    ' is never true.
    Also , in random cases i've seen the System.out.println("exitVAl "+exit); line executing before the System.out.println("Start Reading"); line , and i though proc.waitFor() would guarentee otherwise.

    thx guys for ur replies . The issue was because of some browser security system ( or so they said . ).However i'm still puzzled about the 'waiting for the stream to finish' part .
    paul.miner wrote:
    {I think the process is allowed to end with output still in the >>buffers, ..so this would be expected. You should be waiting for >>your .streams to finish, since that's what you really >>care .about. .Also, .you need to add synchronization between your >>threads so you can accurately retrieve "MAC". Also, do not break out >>of the loop when you find what you're looking for, you should >>continue .reading until the end of the stream.Wasn't I suppose to be reading out of the stream to prevent an overflow?Also the break is done there are multiple lines like 'Physical address .....: xxxxxxxxxx ' in the output , and the macid is the first one.About the ProcessBuilder , I'll look into it . Thx for your advice.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Issue using Runtime.exec() to export a DB

    hi ,
    i'm trying to write a piece of code to export an oracle DB using Runtime.exec(). I searched the forums and came up a with a piece of code , modified it a bit .The issue is the system sometimes hangs while executing the code , it's like the proc.waitFor() never returns. However the execution is error-free if using a command like 'shutdown' instead of 'exp' .
    this is my main
    public class DBExporter
               * @param args
              public static void main(String[] args)
                        try
                                  StreamReaderThread outReaderThread = new StreamReaderThread();
                                  StreamReaderThread errReaderThread = new StreamReaderThread();
                                  //StreamReaderThread ww = new StreamReaderThread();
                                  Runtime rt = Runtime.getRuntime();
                                  outReaderThread.start();
                                  errReaderThread.start();
                                  String command = "exp beta/beta@frsp_dbS file=\"c:/shop.dmp\" full=\"N\" ";
                                  //command = "shutdown -s";
                                  Process proc = rt.exec(command);
                                  outReaderThread.setInputStream(proc.getInputStream());
                                  errReaderThread.setInputStream(proc.getErrorStream());
                                  //ww.setOutputStream(proc.getOutputStream());
                                  System.out.println(proc.waitFor());
                                  proc.getInputStream().close();
                                  proc.getErrorStream().close();
                                  proc.getOutputStream().close();
                        catch (Exception e)
                                  e.printStackTrace();
         }and this is the reader class
    import java.io.BufferedWriter;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    *@deprecated
    public class StreamReaderThread extends Thread
         private BufferedReader     br;
         private BufferedWriter     bw;
         private StringBuffer     sb;
         private String               newline;
         private String               line;
         public StreamReaderThread()
              br = null;
              sb = null;
              newline = null;
              line = null;
         public synchronized String getText()
              if( sb == null )
                   return "";
              return sb.toString();
         private boolean     flag     = false;
         public synchronized void setInputStream( InputStream is )
              br = new BufferedReader(new InputStreamReader(is));
              flag = true;
         public synchronized void setOutputStream( OutputStream is )
                   bw = new BufferedWriter(new OutputStreamWriter(is));
                   flag = true;
         public synchronized void run()
              int i = 0;
              try
                   while( !flag )
                        wait();
                   flag = false;
                   while( (line = br.readLine()) != null )
                        try
                             if( sb == null )
                                  sb = new StringBuffer();
                                  newline = System.getProperty("line.separator");
                             else
                                  sb.append(newline);
                             sb.append(line);
                        catch( Exception e )
                             e.printStackTrace();
                        i++;
                        if( br == null )
                             break;
              catch( IOException ex )
                   ex.printStackTrace();
              catch( InterruptedException ex )
                   ex.printStackTrace();
    }

    Looks like a bug in StreamReaderThread. I can't see that it ever exits the wait() call since no one is calling notify or notify all.
    Kaj

  • Runtime exec IOException issues

    Hello,
    I have spent two 10 hours days on this problem with countless search permutations and peering into everything from kernel source to java source. Unfortunately, I am not coming up with useful results.
    Overview:
    I have a very large java application (Apache solr) running on a server with 12GB memory. Without going into too much detail, this application at a point will use a Runtime exec call to fire off a bash shell script. Over time, however, I end up with an IOException "Cannot allocate memory." (More info and stack trace below.)
    That application aside I have been able to reproduce this by varying the -Xms and -Xmx jvm parameters with confusing results using the simple program below:
    //Use with various -Xms and -Xmx arguments to produce
    //IOException on call to Runtime.exec()
    import java.io.*;
    public class DoRuntime {
       public static void main(String args[]) throws IOException {
          Runtime runtime = Runtime.getRuntime();
          long total = runtime.totalMemory();
          long max = runtime.maxMemory();
          long free = runtime.freeMemory();
          System.out.println("total: " + total);
          System.out.println("max: " + max);
          System.out.println("free: " + free);
          Process process = runtime.exec("/bin/ls");
          InputStream is = process.getInputStream();
          InputStreamReader isr = new InputStreamReader(is);
          BufferedReader br = new BufferedReader(isr);
          String line;
          while ((line = br.readLine()) != null) {
             System.out.println(line);
    }Here are some sample runs:
    RUN1
    rwoodrum@util1wad:~/tmp$ java DoRuntime
    total: 188743680
    max: 954466304
    free: 187759312
    DoRuntime.class
    DoRuntime.java
    rwoodrum@util1wad:~/tmp$
    RUN2
    rwoodrum@util1wad:~/tmp$ java -Xms10g -Xmx10g DoRuntime
    total: 10290069504
    max: 10290069504
    free: 10236381080
    Exception in thread "main" java.io.IOException: java.io.IOException: Cannot allocate memory
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
            at java.lang.ProcessImpl.start(ProcessImpl.java:65)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
            at java.lang.Runtime.exec(Runtime.java:591)
            at java.lang.Runtime.exec(Runtime.java:429)
            at java.lang.Runtime.exec(Runtime.java:326)
            at DoRuntime.main(DoRuntime.java:14)
    rwoodrum@util1wad:~/tmp$
    RUN3
    rwoodrum@util1wad:~/tmp$ java -Xms10g -Xmx11g DoRuntime
    total: 10290069504
    max: 10498867200
    free: 10236381080
    DoRuntime.class
    DoRuntime.java
    rwoodrum@util1wad:~/tmp$-----
    (FWIW, I get the same results replacing /bin/ls with something as lightweight as /bin/true.)
    As can be seen in the above output of RUN2, I have set a fixed heap size of 10GB. The jvm seems content with that heap size, but when it goes to exec the child process it becomes rather unhappy. From this I would perhaps conclude that ultimately inside the call to forkAndExec (libjava.so) the call to fork() failed with an ENOMEM. (As a side note, an strace on the process doesn't actually ever show a fork, only a call to clone - which utilizes a fork eventually - more on clone below.)
    The results of RUN3, however, seem to imply that the problem is within the jvm itself. In RUN3, I set the initial heap allocation to 10GB, as in RUN2, but I set the maximum at 11GB. One would think (or at least I would) that if the fork in RUN2 failed that it would certainly fail in the case of RUN3. It doesn't.
    The manpage of clone indicates that the child process will "share parts of its execution context with the calling process". Indeed, if I'm reading it correctly, it indicates that the child process stack (among other things) is housed in the parent process address space.
    Could it be that by setting this very large, fixed heap size as in RUN2, there is no room for the jvm to "maneuver" and properly handle the effort of the Runtime.exec? The fact that RUN3 is successful is what has made me think something like this, but I am by far an expert on how the jvm would handle that sort of thing.
    In our production setup of this application, I adjusted the Xmx setting to be something larger than the Xms setting. This worked for a period of time, but eventually produced the same results. I suspect over time the heap simply increased toward the max and again the jvm couldn't do its thing when it came time to RunTime.exec. The fact that this happens on the trivial Runtime.exec program would seem to rule out a memory leak of the production application.
    Ultimately something fishy is going on with memory, but with seemingly contradictory results, I am at a loss of where the problem lies.
    If I have omittied any potentially relevant information, please let me know. Any thoughts are greatly appreciated.
    Some basic system information:
    rwoodrum@util1wad:~/tmp$ free
                 total       used       free     shared    buffers     cached
    Mem:      12304936   12200376     104560          0     337276    7082508
    -/+ buffers/cache:    4780592    7524344
    Swap:      2097144         32    2097112
    rwoodrum@util1wad:~/tmp$ uname -a
    Linux util1wad 2.6.18-4-amd64 #1 SMP Mon Mar 26 11:36:53 CEST 2007 x86_64 GNU/Linux
    rwoodrum@util1wad:~/tmp$ java -version
    java version "1.5.0_10"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
    Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_10-b03, mixed mode)-ryan woodrum

    I've continued to investigate this with my discoveries below. I've found some more interesting nuances, but am still not satisfied with the explanation of what is going on here. For time reasons, I've capitulated to a somewhat lame workaround.
    The test run in the 1.6.0 jvm environment is somewhat revealing in that it confirms that the eventual call to fork (I'm kind of guessing it's the fork call here) is returning an ENOMEM. The 1.5.0 jvm was not returning the actual errno from the call in the JNI code. Checking out $linux_src/include/asm-generic/errno-base.h indeed enumerates ENOMEM to 12.
    When I saw this, I started looking at the memory commit inside of /proc/meminfo to see what was going on when I would launch the jvm with the varying Xmx and Xms parameters. Somewhat unsurprisingly at this point, when I would run with large a large heap, the Committed_AS would skyrocket by a proportion roughly equal to the fixed heap size. (See here http://lwn.net/Articles/28345/ for an definition of Committed_AS and other /proc/meminfo fields.)
    With the above information in hand, I wanted to confirm without a doubt that the kernel was the thorn in my side. So on a test system I started to play around with the vm_overcommit feature - see $linux_src/Documentation/vm/overcommit-accounting for definitions of modes 0,1, and 2). Sure enough, toying with these modes I was able to alter the behavior of launching the jvm. I switched from the default heuristic mode (0) to an "always overcommit" mode and it would launch and sucessfully fork and exec every time. No surprise there.
    What IS surprising, however, is that if, under the default heuristic mode, I specify the jvm parameters differently it will sucessfully run and fork and exec the subprocess. It seems odd to me that at the OS level, specifying `java -Xms4g -Xmx4g` will cause the subprocess fork to fail but specifying `java -Xms4g -Xmx5g` will NOT cause the fork to fail. Running with the latter parameters shows the exact same Committed_AS spike. This all begs the question(s): What's the difference? With a min heap size set to 4g (or whatever) on the both jvm runs, how does a jvm parameter (especially one that allows MORE growth of the heap) impact this call to fork? One variable in the picture at this point that I'm unsure of is the strace call to clone(). I don't know what this could be doing to make things behave differently.
    So as I noted, above, I have a relatively lame workaround. Blindly add more swap to increase the CommittedLimit inside the kernel. It'll never get used, it's a waste of space, and, perhaps most importantly, on principal it just rubs me the wrong way.
    -ryan woodrum

  • Issue with Runtime.exec() or ProcessBuilder pb.start()

    I am having problem with running a separate JVM process. The finished code must be able to start and forcibly stop the spawned process. The problem I am having is that the spawned process seems to hang. I have tried reading all output from the process with no luck. The java program opens a ServerSocket on a separate thread right away. However, when this is started through Runtime.exec() or ProcessBuilder the socket does not open until the first process is terminated. I have have been looking high and low for an answer that will fix this. I could write this all as a multithreaded application, however I would really like to isolate the second process in terms of the JVM settings. I would like to be able to monitor this process directly and indirectly for failure or early termination and restart it automatically. Other Java program I run with this method experience the same problem--a hang at a variable point in execution that is not relieved until the originating process ends.
            try {
                ProcessBuilder pb = new ProcessBuilder("\"C:\\Program Files\\Java\\jre6\\bin\\java.exe\" -jar -server \"PATHTOJAR\"");
                Process p = pb.start();
                java.io.InputStream is = p.getInputStream();
                while(running) System.out.print(is.read());
            catch (java.io.IOException ioe) { ioe.printStackTrace(); }

    The finished code must be able to start and forcibly stop the spawned process.Process.destroy().
    I have tried reading all output from the process with no luck.No you haven't - see below.
    The java program opens a ServerSocket on a separate thread right away. However, when this is started through Runtime.exec() or ProcessBuilder the socket does not open until the first process is terminated.Which of these programs is which?
    ProcessBuilder pb = new ProcessBuilder("\"C:\\Program Files\\Java\\jre6\\bin\\java.exe\" -jar -server \"PATHTOJAR\"");That should be
    ProcessBuilder pb = new ProcessBuilder("C:\\Program Files\\Java\\jre6\\bin\\java.exe", "-jar", "PATHTOJAR", "-server");
    java.io.InputStream is = p.getInputStream();
    while(running) System.out.print(is.read());(a) call ProcessBuilder.redirectErrorStream(true);
    (b) the loop must stop when is.read() returns -1, and you shouldn't print that value.

  • Performance Issues with Photoshop CS6 64-Bit

    Hello -
    Issue at hand: over the course of the last few weeks, I have noticed significant issues with performance since the last update to PS CS6 via the Adobe Application Manager, ranging from unexpected shut downs to bringing my workstation to a crawl (literally, my cursor seems to crawl across my displays). I'm curious as to if anyone else is experiencing these issues, or if there is a solution I have not yet tried. Here is a list of actions that result in these performance issues - there are likely more that I have either not experienced due to my frustration, or have not documented as occuring multiple times:
    Opening files - results in hanging process, takes 3-10 seconds to resolve
    Pasting from clipboard - results in hanging process, takes 3-10 seconds to resolve
    Saving files - takes 3-10 seconds to open the dialog, another 3-10 seconds to return to normal window (saving a compressed PNG)
    Eyedropper tool - will either crash Photoshop to desktop, or take 5-15 seconds to load
    Attempting to navigate any menu - will either crash Photoshop to desktop, or take 5-15 seconds to load
    Attempts I've taken to resolve this matter, which have failed:
    Uninstalled all fonts that I have added since the last update (this was a pain in the ***, thank you Windows explorer for being glitchy)
    Uninstall application and reinstall application
    Use 32-bit edition
    Changing process priority to Above Normal
    Confirm process affinity to all available CPU cores
    Change configuration of Photoshop performance options
    61% of memory is available to Photoshop to use (8969 MB)
    History states: 20; Cache levels: 6; Cache tile size: 1024K
    Scratch disks: active on production SSD, ~10GB space available
    Dedicated graphics processor is selected (2x nVidia cards in SLI)
    System Information:
    Intel i7 2600K @ 3.40GHz
    16GB DDR3, Dual Channel RAM
    2x nVidia GeForce GTS 450 cards, 1GB each
    Windows 7 Professional 64-bit
    Adobe Creative Cloud
    This issue is costing me time I could be working every day, and I'm about ready to begin searching for alternatives and cancel my membership if I can't get this resolved.

    Adobe Photoshop Version: 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00) x64
    Operating System: Windows 7 64-bit
    Version: 6.1 Service Pack 1
    System architecture: Intel CPU Family:6, Model:10, Stepping:7 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2, HyperThreading
    Physical processor count: 4
    Logical processor count: 8
    Processor speed: 3392 MHz
    Built-in memory: 16350 MB
    Free memory: 12070 MB
    Memory available to Photoshop: 14688 MB
    Memory used by Photoshop: 61 %
    Image tile size: 1024K
    Image cache levels: 6
    OpenGL Drawing: Enabled.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: True.
    OpenGL Allow Old GPUs: Not Detected.
    OpenCL Version: 1.1 CUDA 4.2.1
    OpenGL Version: 3.0
    Video Rect Texture Size: 16384
    OpenGL Memory: 1024 MB
    Video Card Vendor: NVIDIA Corporation
    Video Card Renderer: GeForce GTS 450/PCIe/SSE2
    Display: 2
    Display Bounds: top=0, left=1920, bottom=1080, right=3840
    Display: 1
    Display Bounds: top=0, left=0, bottom=1080, right=1920
    Video Card Number: 3
    Video Card: NVIDIA GeForce GTS 450
    Driver Version: 9.18.13.1106
    Driver Date: 20130118000000.000000-000
    Video Card Driver: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
    Video Mode:
    Video Card Caption: NVIDIA GeForce GTS 450
    Video Card Memory: 1024 MB
    Video Card Number: 2
    Video Card: LogMeIn Mirror Driver
    Driver Version: 7.1.542.0
    Driver Date: 20060522000000.000000-000
    Video Card Driver:
    Video Mode: 1920 x 1080 x 4294967296 colors
    Video Card Caption: LogMeIn Mirror Driver
    Video Card Memory: 0 MB
    Video Card Number: 1
    Video Card: NVIDIA GeForce GTS 450
    Driver Version: 9.18.13.1106
    Driver Date: 20130118000000.000000-000
    Video Card Driver: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
    Video Mode: 1920 x 1080 x 4294967296 colors
    Video Card Caption: NVIDIA GeForce GTS 450
    Video Card Memory: 1024 MB
    Serial number: 90970233273769828003
    Application folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\
    Temporary file path: C:\Users\ANDREW~1\AppData\Local\Temp\
    Photoshop scratch has async I/O enabled
    Scratch volume(s):
      C:\, 111.8G, 7.68G free
    Required Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Required\
    Primary Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\
    Additional Plug-ins folder: not set
    Installed components:
       ACE.dll   ACE 2012/06/05-15:16:32   66.507768   66.507768
       adbeape.dll   Adobe APE 2012/01/25-10:04:55   66.1025012   66.1025012
       AdobeLinguistic.dll   Adobe Linguisitc Library   6.0.0  
       AdobeOwl.dll   Adobe Owl 2012/09/10-12:31:21   5.0.4   79.517869
       AdobePDFL.dll   PDFL 2011/12/12-16:12:37   66.419471   66.419471
       AdobePIP.dll   Adobe Product Improvement Program   7.0.0.1686  
       AdobeXMP.dll   Adobe XMP Core 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPFiles.dll   Adobe XMP Files 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPScript.dll   Adobe XMP Script 2012/02/06-14:56:27   66.145661   66.145661
       adobe_caps.dll   Adobe CAPS   6,0,29,0  
       AGM.dll   AGM 2012/06/05-15:16:32   66.507768   66.507768
       ahclient.dll    AdobeHelp Dynamic Link Library   1,7,0,56  
       aif_core.dll   AIF   3.0   62.490293
       aif_ocl.dll   AIF   3.0   62.490293
       aif_ogl.dll   AIF   3.0   62.490293
       amtlib.dll   AMTLib (64 Bit)   6.0.0.75 (BuildVersion: 6.0; BuildDate: Mon Jan 16 2012 18:00:00)   1.000000
       ARE.dll   ARE 2012/06/05-15:16:32   66.507768   66.507768
       AXE8SharedExpat.dll   AXE8SharedExpat 2011/12/16-15:10:49   66.26830   66.26830
       AXEDOMCore.dll   AXEDOMCore 2011/12/16-15:10:49   66.26830   66.26830
       Bib.dll   BIB 2012/06/05-15:16:32   66.507768   66.507768
       BIBUtils.dll   BIBUtils 2012/06/05-15:16:32   66.507768   66.507768
       boost_date_time.dll   DVA Product   6.0.0  
       boost_signals.dll   DVA Product   6.0.0  
       boost_system.dll   DVA Product   6.0.0  
       boost_threads.dll   DVA Product   6.0.0  
       cg.dll   NVIDIA Cg Runtime   3.0.00007  
       cgGL.dll   NVIDIA Cg Runtime   3.0.00007  
       CIT.dll   Adobe CIT   2.1.0.20577   2.1.0.20577
       CoolType.dll   CoolType 2012/06/05-15:16:32   66.507768   66.507768
       data_flow.dll   AIF   3.0   62.490293
       dvaaudiodevice.dll   DVA Product   6.0.0  
       dvacore.dll   DVA Product   6.0.0  
       dvamarshal.dll   DVA Product   6.0.0  
       dvamediatypes.dll   DVA Product   6.0.0  
       dvaplayer.dll   DVA Product   6.0.0  
       dvatransport.dll   DVA Product   6.0.0  
       dvaunittesting.dll   DVA Product   6.0.0  
       dynamiclink.dll   DVA Product   6.0.0  
       ExtendScript.dll   ExtendScript 2011/12/14-15:08:46   66.490082   66.490082
       FileInfo.dll   Adobe XMP FileInfo 2012/01/17-15:11:19   66.145433   66.145433
       filter_graph.dll   AIF   3.0   62.490293
       hydra_filters.dll   AIF   3.0   62.490293
       icucnv40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       icudt40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       image_compiler.dll   AIF   3.0   62.490293
       image_flow.dll   AIF   3.0   62.490293
       image_runtime.dll   AIF   3.0   62.490293
       JP2KLib.dll   JP2KLib 2011/12/12-16:12:37   66.236923   66.236923
       libifcoremd.dll   Intel(r) Visual Fortran Compiler   10.0 (Update A)  
       libmmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   12.0  
       LogSession.dll   LogSession   2.1.2.1681  
       mediacoreif.dll   DVA Product   6.0.0  
       MPS.dll   MPS 2012/02/03-10:33:13   66.495174   66.495174
       msvcm80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcm90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcp100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcp80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcp90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcr100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcr80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcr90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       pdfsettings.dll   Adobe PDFSettings   1.04  
       Photoshop.dll   Adobe Photoshop CS6   CS6  
       Plugin.dll   Adobe Photoshop CS6   CS6  
       PlugPlug.dll   Adobe(R) CSXS PlugPlug Standard Dll (64 bit)   3.0.0.383  
       PSArt.dll   Adobe Photoshop CS6   CS6  
       PSViews.dll   Adobe Photoshop CS6   CS6  
       SCCore.dll   ScCore 2011/12/14-15:08:46   66.490082   66.490082
       ScriptUIFlex.dll   ScriptUIFlex 2011/12/14-15:08:46   66.490082   66.490082
       svml_dispmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   12.0  
       tbb.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       tbbmalloc.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       updaternotifications.dll   Adobe Updater Notifications Library   6.0.0.24 (BuildVersion: 1.0; BuildDate: BUILDDATETIME)   6.0.0.24
       WRServices.dll   WRServices Friday January 27 2012 13:22:12   Build 0.17112   0.17112
    Required plug-ins:
       3D Studio 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Accented Edges 13.0
       Adaptive Wide Angle 13.0
       Angled Strokes 13.0
       Average 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Bas Relief 13.0
       BMP 13.0
       Camera Raw 8.1
       Camera Raw Filter 8.1
       Chalk & Charcoal 13.0
       Charcoal 13.0
       Chrome 13.0
       Cineon 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Clouds 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Collada 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Color Halftone 13.0
       Colored Pencil 13.0
       CompuServe GIF 13.0
       Conté Crayon 13.0
       Craquelure 13.0
       Crop and Straighten Photos 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Crop and Straighten Photos Filter 13.0
       Crosshatch 13.0
       Crystallize 13.0
       Cutout 13.0
       Dark Strokes 13.0
       De-Interlace 13.0
       Dicom 13.0
       Difference Clouds 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Diffuse Glow 13.0
       Displace 13.0
       Dry Brush 13.0
       Eazel Acquire 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Embed Watermark 4.0
       Entropy 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Extrude 13.0
       FastCore Routines 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Fibers 13.0
       Film Grain 13.0
       Filter Gallery 13.0
       Flash 3D 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Fresco 13.0
       Glass 13.0
       Glowing Edges 13.0
       Google Earth 4 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Grain 13.0
       Graphic Pen 13.0
       Halftone Pattern 13.0
       HDRMergeUI 13.0
       IFF Format 13.0
       Ink Outlines 13.0
       JPEG 2000 13.0
       Kurtosis 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Lens Blur 13.0
       Lens Correction 13.0
       Lens Flare 13.0
       Liquify 13.0
       Matlab Operation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Maximum 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mean 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Measurement Core 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Median 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mezzotint 13.0
       Minimum 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       MMXCore Routines 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mosaic Tiles 13.0
       Multiprocessor Support 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Neon Glow 13.0
       Note Paper 13.0
       NTSC Colors 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Ocean Ripple 13.0
       Oil Paint 13.0
       OpenEXR 13.0
       Paint Daubs 13.0
       Palette Knife 13.0
       Patchwork 13.0
       Paths to Illustrator 13.0
       PCX 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Photocopy 13.0
       Photoshop 3D Engine 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Picture Package Filter 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Pinch 13.0
       Pixar 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Plaster 13.0
       Plastic Wrap 13.0
       PNG 13.0
       Pointillize 13.0
       Polar Coordinates 13.0
       Portable Bit Map 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Poster Edges 13.0
       Radial Blur 13.0
       Radiance 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Range 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Read Watermark 4.0
       Reticulation 13.0
       Ripple 13.0
       Rough Pastels 13.0
       Save for Web 13.0
       ScriptingSupport 13.1.2
       Shear 13.0
       Skewness 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Smart Blur 13.0
       Smudge Stick 13.0
       Solarize 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Spatter 13.0
       Spherize 13.0
       Sponge 13.0
       Sprayed Strokes 13.0
       Stained Glass 13.0
       Stamp 13.0
       Standard Deviation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       STL 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Sumi-e 13.0
       Summation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Targa 13.0
       Texturizer 13.0
       Tiles 13.0
       Torn Edges 13.0
       Twirl 13.0
       Underpainting 13.0
       Vanishing Point 13.0
       Variance 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Variations 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Water Paper 13.0
       Watercolor 13.0
       Wave 13.0
       Wavefront|OBJ 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       WIA Support 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Wind 13.0
       Wireless Bitmap 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       ZigZag 13.0
    Optional and third party plug-ins: NONE
    Plug-ins that failed to load: NONE
    Flash:
       Mini Bridge
       Kuler
    Installed TWAIN devices: NONE

  • Sun JVM Performance Issue in Sun Solaris 10 (SPARC)

    Hi,
    Issue : Performance issue after the migration of a Java application from IBM-AIX 5 to Sun Solaris 10 (SPARC)
    I am facing performance issue after the migration of a Java application from IBM-AIX 5.3 to Sun Solaris 10 (SPARC).
     Normally the application takes less than 1 hour to complete the process in AIX, but after migration in Solaris the application is taking 4+ hours.
    The Java version of IBM AIX is ,
    java version "1.5.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build pap32dev-20051104)
    IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20051103 (JIT enabled)
    The Java version of Solaris 10 is,
    Java(TM) Platform, Standard Edition for Business (build 1.5.0_17-b04)
    Java HotSpot(TM) Server VM (build 1.5.0_17-b04, mixed mode)
    Description of Application
    The application merges 2 XML files of size 300 MB each using DOM Parser and generates flat file according to certain business logic.No remote files are using for the file generation. There are two folders and around 200 XML file in each folders of similar names. The application loads 2 similar XML file at a time from each folder and Processes. Same way, the application processes all the 200 XML file pairs using loop.
    The JVM Parameters are given below.
    /usr/java5/bin/java -cp $CLASSPATH -Xms3072m -Xmx3072M com.db.mcc.creditderiv.GCDXMLTransProc
    Here the extended swap memory in AIX is 3072 (3GB). After copying the same tode to Solaris, the
    application started throwing java.lang.OutofMemoryError. So that we have increased the swap memory up to 12 GB.
    Since 32bit Java allows maximum 4 GB extended memory we started using 64 Bit Java in Solaris using -d64 argument.
    The Current JVM Parameter in Solaris is given below.
    java -d64 -cp $CLASSPATH -Xms8192m -Xmx12288m com.db.mcc.creditderiv.GCDXMLTransProc ( 64 GB Swap Memory is available in the System)
    We have tried the following options
    1.       Extended heap size up to 12 GB using -xms and -xmx parameters and tried multiple -XX options. Earlier the application was working fine in AIX with 3.5 GB extended heap size. ( 64 GB Swap Memory is available in the System)
    2.       Downloaded and installed the Solaris SPARC Patches from the website,
         http://java.sun.com/javase/downloads/index_jdk5.jsp
    4.   Downloaded and installed XML and XSLT patch from sun website
    5.       Tried to run the Java in server mode using -server option.

    A 64 bit VM is not necessarily faster than a 32 bit one. I remember at least on suggestion that it could be slower.
    Make sure you use the -server option.
    As a guess IBM isn't necessarily a slouch when it comes to Java. It might simply be that their VM was faster. Could have used a different dom library as well.
    Could be an environment problem of course.
    Profiling the application and the machine as well might provide information.

  • Performance issues on a 7204VXR/NPE-G1

    We have a 7204VXR router with an NPE-G1 serving as our gateway router. We currently are connected to one ISP, one BGP peering session on which we receive a single default route, and another on which we receive a small table of Internet2 routes.
    Lately, we seem to be having some performance issues. We seem to have trouble during the day getting more than about 330 to 340 Mbps of traffic (about 30-40kpps). The cpu util. percentage is in the 70s. The external facing interfaces shows an increasing number of overruns and ignoreds.
    Shouldn't this be able to handle a bit more traffic than it is? Could something be configured incorrectly? We really haven't been having many issues with performance up to this point.

    Here it is...
    #show proc cpu sorted 1min                                           
    CPU utilization for five seconds: 66%/65%; one minute: 65%; five minutes: 66%   
     PID Runtime(ms)   Invoked      uSecs   5Sec   1Min   5Min TTY Process          
      91     8242420  14077104        585  0.24%  0.21%  0.22%   0 CEF process      
       5    10276968   1050051       9787  0.24%  0.08%  0.06%   0 Check heaps      
     210     7148880    638176      11202  0.00%  0.06%  0.05%   0 BGP Scanner      
       2      446356   1914859        233  0.08%  0.05%  0.08%   0 Load Meter       
      67     6998584  33550072        208  0.00%  0.04%  0.05%   0 IP Input         
      38      417232   1284274        324  0.08%  0.02%  0.00%   0 Net Background   
     196       41720  95630532          0  0.08%  0.02%  0.00%   0 CCPROXY_CT       
       3          64       218        293  0.08%  0.01%  0.00%   0 Exec             

  • IOS 8.1+ Performance Issue

    Hello,
    I encountered a serious performance bug in Adobe Air iOS application on devices running iOS 8.1 or later. Approximately in 1-2 minutes fps drops to 7 or lower without interacting with the app. This is very noticeable in the app. The app looks like frozen for about 0.5 seconds. The bug doesn't appear on every session.
    Devices tested: iPad Mini iOS 8.1.1, iPhone 6 iOS 8.2. iPod Touch 4 iOS 6 is working correctly.
    Air SDK versions: 15 and 17 tested.
    I can track the bug using Adobe Scout. There is a noticeable spike on frame time 1.16. Framerate drops to 7.0. The App spends much time on function Runtime overhead. Sometimes the top activity is Running AS3 attached to frame or Waiting For Next Frame instead of Runtime overhead.
    The bug can be reproduced on an empty application having a one bitmap on stage. Open the app and wait for two minutes and the bug should appear. If not, just close and relaunch the app.
    Bugbase link: Bug#3965160 - iOS 8.1+ Performance Issue
    Miska Savela

    Hi
    Id already activated Messages and entered the 6 digit code I was presented with into my iPhone. I can receive txt messages from non iOS users on my iMac and can reply to those messages.
    I just can't send a new message from scratch to a non iOS user :-s
    Thanks
    Baz

  • Performance issues

    Hi,
    The program(developed by someother person) which was given to me is having performance issue. Its giving RUNTIME ERROR 'TIME LIMIT EXCEEDED'. Can u please suggest me in what way i can improve the performance of the program.
    please help me in resolving this.
    Helpful answers will be rewarded.
    TABLES : MARA, "General Material Data
    MARC, "Plant Data for Material
    VBAP, "Sales Document: Item Data
    MARD, "Storage Location Data for Material
    MAST, "Material to BOM Link
    MKPF, "Header: Material Document
    MSEG, "Document Segment: Material
    PKHD, "Control Cycle
    PKPS, "Control Cycle Item / Kanban
    PVBE, "Supply area
    ZTGRP, "Wabco Technology Group table
    ZZC10. "Kanban status table
    I N T E R N A L T A B L E D E C L A R A T I O N *
    INTERNAL TABLE FOR TECH.GROUP AND PLANT
    DATA: BEGIN OF IT_MARC_ZTGRP OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    ZZPTG LIKE ZTGRP-ZZPTG,
    ZZPTD LIKE ZTGRP-ZZPTD,
    END OF IT_MARC_ZTGRP.
    INTERNAL TABLE FOR RETURN VALUES
    DATA IT_RETURN LIKE TABLE OF BAPIRET2 WITH HEADER LINE.
    INTERNAL TABLE FOR SUBASSEMBLY AND FINISHED GOOD
    DATA: BEGIN OF IT_MATERIAL OCCURS 0,
    IDNRK LIKE STPO-IDNRK,
    MATNR LIKE MAST-MATNR,
    END OF IT_MATERIAL.
    INTERNAL TABLE FOR OUTPUT YESTERDAY
    DATA: BEGIN OF IT_KBED_KAKO OCCURS 0,
    KBEAREST LIKE KBED-KBEAREST,
    KRUEREST LIKE KBED-KRUEREST,
    KEINH LIKE KBED-KEINH,
    END OF IT_KBED_KAKO.
    INTERNAL TABLE FOR MATERIAL AND PLANT
    DATA: BEGIN OF IT_PLANT OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    END OF IT_PLANT.
    DATA: BEGIN OF IT_COBK OCCURS 0,
    RUECK LIKE COBK-REFBN,
    END OF IT_COBK.
    DATA: BEGIN OF IT_COEPL OCCURS 0,
    KOKRS LIKE COEPL-KOKRS,
    BELNR LIKE COEPL-BELNR,
    END OF IT_COEPL.
    DATA: BEGIN OF IT_CAPACITIES OCCURS 0,
    LSBBTR LIKE COEPL-LSBBTR,
    MEINB LIKE COEPL-MEINB,
    END OF IT_CAPACITIES.
    DATA: BEGIN OF IT_MKPF_MSEG OCCURS 0,
    MBLNR LIKE MKPF-MBLNR,
    MJAHR LIKE MKPF-MJAHR,
    BUDAT LIKE MKPF-BUDAT,
    BWART LIKE MSEG-BWART,
    MATNR LIKE MSEG-MATNR,
    MENGE LIKE MSEG-MENGE,
    MEINS LIKE MSEG-MEINS,
    DMBTR LIKE MSEG-DMBTR,
    WERKS LIKE MSEG-WERKS,
    END OF IT_MKPF_MSEG.
    INTERNAL TABLE FOR MATERIAL-TO-BOM LINK
    DATA: IT_MAST LIKE MAST OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL
    DATA: BEGIN OF IT_MAT OCCURS 0,
    MATNR LIKE MARA-MATNR,
    END OF IT_MAT.
    INTERNAL TABLE FOR STORAGE LOCATION DATA FOR SUBASSEMBLY
    DATA: BEGIN OF IT_MARD OCCURS 0,
    LABST LIKE MARD-LABST,
    END OF IT_MARD.
    INTERNAL TABLE FOR PLANT FOR MATERIALS
    DATA IT_MARC LIKE MARC OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR BOM ITEM DATA
    DATA: IT_STPO LIKE STPO OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR KANBAN STATUS DATA
    DATA IT_ZZC10 LIKE ZZC10 OCCURS 0 WITH HEADER LINE.
    TEMPORARY INTERNAL TABLE FOR KANBAN STATUS DATA
    DATA IT_ZZC10_TEMP LIKE ZZC10 OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR CONTROL CYCLE
    DATA IT_PKHD LIKE PKHD OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR CONTROL CYCLE ITEM
    DATA IT_PKPS LIKE PKPS OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL DOCUMENT HEADER
    DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL DOCUMENT ITEM
    DATA IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
    TEMPORARY INTERNAL TABLE FOR ACTUAL QUANTITY
    DATA : BEGIN OF IT_TEMP OCCURS 0,
    TECH LIKE ZTGRP-ZZPTD,
    MATNR LIKE ZZC10-MATNR,
    FINISHED LIKE MAST-MATNR,
    PKNUM LIKE PKHD-PKNUM,
    WERKS LIKE ZZC10-WERKS,
    GSMNG LIKE PLAF-GSMNG,
    MEINS LIKE PLAF-MEINS,
    BEHAZ LIKE PKHD-BEHAZ,
    BEHMG LIKE PKHD-BEHMG,
    PKBMG LIKE ZZC10-PKBMG,
    LATEHOURS LIKE PKHD-KWBZM,
    FILLRATE TYPE P DECIMALS 2,
    REPL_LEAD_TIME TYPE P DECIMALS 3,
    QTY_1 LIKE PLAF-GSMNG,
    QTY_2 LIKE PLAF-GSMNG,
    QTY_3 LIKE PLAF-GSMNG,
    QTY_4 LIKE PLAF-GSMNG,
    QTY_5 LIKE PLAF-GSMNG,
    QTY_6 LIKE PLAF-GSMNG,
    GSMNG_OUTY LIKE PLAF-GSMNG,
    MEINS_OUTY LIKE PLAF-MEINS,
    KAPBD_OUTY LIKE COEPL-LSTBTR,
    KEINH_OUTY LIKE COEPL-MEINH,
    GSMNG_OUTM LIKE MSEG-MENGE,
    MEINS_OUTM LIKE MSEG-MEINS,
    KAPBD_OUTM LIKE COEPL-LSTBTR,
    KEINH_OUTM LIKE COEPL-MEINH,
    GSMNG_BORD LIKE PLAF-GSMNG,
    MEINS_BORD LIKE MSEG-MEINS,
    KAPBD_BORD LIKE KBED-KBEAREST,
    KEINH_BORD LIKE COEPL-MEINH,
    GSMNG_TDAY LIKE PLAF-GSMNG,
    KAPBD_TDAY LIKE KBED-KBEAREST,
    GSMNG_DAY1 LIKE PLAF-GSMNG,
    KAPBD_DAY1 LIKE KBED-KBEAREST,
    GSMNG_DAY2 LIKE PLAF-GSMNG,
    KAPBD_DAY2 LIKE KBED-KBEAREST,
    GSMNG_DAY3 LIKE PLAF-GSMNG,
    KAPBD_DAY3 LIKE KBED-KBEAREST,
    GSMNG_DAY4 LIKE PLAF-GSMNG,
    KAPBD_DAY4 LIKE KBED-KBEAREST,
    GSMNG_DAY5 LIKE PLAF-GSMNG,
    KAPBD_DAY5 LIKE KBED-KBEAREST,
    STOCK_PO01 LIKE MARD-LABST,
    F_GSMNG_BORD LIKE PLAF-GSMNG,
    F_MEINS_BORD LIKE MSEG-MEINS,
    F_KAPBD_BORD LIKE KBED-KBEAREST,
    F_KEINH_BORD LIKE COEPL-MEINH,
    F_GSMNG_TDAY LIKE PLAF-GSMNG,
    F_MEINS_TDAY LIKE MSEG-MEINS,
    F_KAPBD_TDAY LIKE KBED-KBEAREST,
    F_KEINH_TDAY LIKE COEPL-MEINH,
    F_GSMNG_DAY1 LIKE PLAF-GSMNG,
    F_MEINS_DAY1 LIKE MSEG-MEINS,
    F_KAPBD_DAY1 LIKE KBED-KBEAREST,
    F_KEINH_DAY1 LIKE COEPL-MEINH,
    F_GSMNG_DAY2 LIKE PLAF-GSMNG,
    F_MEINS_DAY2 LIKE MSEG-MEINS,
    F_KAPBD_DAY2 LIKE KBED-KBEAREST,
    F_KEINH_DAY2 LIKE COEPL-MEINH,
    F_GSMNG_DAY3 LIKE PLAF-GSMNG,
    F_MEINS_DAY3 LIKE MSEG-MEINS,
    F_KAPBD_DAY3 LIKE KBED-KBEAREST,
    F_KEINH_DAY3 LIKE COEPL-MEINH,
    F_GSMNG_DAY4 LIKE PLAF-GSMNG,
    F_MEINS_DAY4 LIKE MSEG-MEINS,
    F_KAPBD_DAY4 LIKE KBED-KBEAREST,
    F_KEINH_DAY4 LIKE COEPL-MEINH,
    F_GSMNG_DAY5 LIKE PLAF-GSMNG,
    F_MEINS_DAY5 LIKE MSEG-MEINS,
    F_KAPBD_DAY5 LIKE KBED-KBEAREST,
    F_KEINH_DAY5 LIKE COEPL-MEINH,
    F_GSMNG_OUTM LIKE MSEG-MENGE,
    F_MEINS_OUTM LIKE MSEG-MEINS,
    F_KAPBD_OUTM LIKE COEPL-LSTBTR,
    F_KEINH_OUTM LIKE COEPL-MEINH,
    F_GSMNG_OUTN LIKE MSEG-MENGE,
    F_MEINS_OUTN LIKE MSEG-MEINS,
    F_KAPBD_OUTN LIKE KBED-KBEAREST,
    F_KEINH_OUTN LIKE COEPL-MEINH,
    END OF IT_TEMP.
    INTERNAL TABLE FOR PLANNED DATA
    DATA IT_PLAF LIKE PLAF OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR FACTORY CALENDER AND CURRENCY
    DATA: BEGIN OF IT_T001W OCCURS 0,
    WERKS LIKE T001W-WERKS,
    BWKEY LIKE T001W-BWKEY,
    FABKL LIKE T001W-FABKL,
    END OF IT_T001W.
    V A R I A B L E S *
    DATA: AUX_BORD LIKE SY-DATUM,
    AUX_YDAY LIKE SY-DATUM,
    AUX_TDAY LIKE SY-DATUM,
    AUX_DAY1 LIKE SY-DATUM,
    AUX_DAY2 LIKE SY-DATUM,
    AUX_DAY3 LIKE SY-DATUM,
    AUX_DAY4 LIKE SY-DATUM,
    AUX_DAY5 LIKE SY-DATUM,
    AUX_CURRENT LIKE SY-DATUM,
    AUX_PREVIOUS LIKE SY-DATUM,
    AUX_TECH LIKE ZTGRP-ZZPTD,
    AUX_BUDAT LIKE MKPF-BUDAT,
    AUX_LOW LIKE MKPF-BUDAT,
    AUX_HIGH LIKE MKPF-BUDAT,
    AUX_MNG LIKE MSEG-MENGE,
    AUX_MENGE LIKE MSEG-MENGE,
    AUX_QUANT LIKE PLAF-GSMNG,
    AUX_SUM_UNIT LIKE UMADD-MSEHI,
    AUX_TIMESTAMP1 LIKE CCUPEAKA-TIMESTAMP,
    AUX_TIMESTAMP2 LIKE CCUPEAKA-TIMESTAMP,
    AUX_BUKRS LIKE T001K-BUKRS,
    AUX_BWKEY LIKE T001W-BWKEY,
    AUX_GSMNG LIKE PLAF-GSMNG,
    AUX_PKBMG LIKE ZZC10-PKBMG,
    AUX_FILL LIKE ZZC10-PKBMG,
    AUX_TOTAL LIKE ZZC10-PKBMG,
    AUX_FABKL LIKE SCAL-FCALID,
    AUX_WAERS LIKE MSEG-WAERS,
    AUX_ZZC10_HR TYPE P DECIMALS 3,
    AUX_PLAF_HR TYPE P DECIMALS 3,
    AUX_KAPBD_OUTY TYPE P DECIMALS 3,
    AUX_KAPBD_OUTM TYPE P DECIMALS 3,
    AUX_KAPBD_BORD TYPE P DECIMALS 3,
    AUX_F_KAPBD_BORD TYPE P DECIMALS 3,
    AUX_F_KAPBD_TDAY TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY1 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY2 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY3 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY4 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY5 TYPE P DECIMALS 3,
    AUX_F_KAPBD_OUTM TYPE P DECIMALS 3,
    AUX_F_KAPBD_OUTN TYPE P DECIMALS 3,
    AUX_PKHD_TIME TYPE P DECIMALS 3,
    AUX_LATEHOURS TYPE P DECIMALS 3,
    AUX_DIFF TYPE I,
    AUX_FLAG TYPE C,
    AUX_SET TYPE C,
    AUX_DATUMABSOLUT(5) TYPE P,
    AUX_FDAY LIKE SY-DATUM,
    AUX_DAYS LIKE PKHD-KWBZD,
    AUX_HOURS LIKE IT_ZZC10-TIME_EMPTY,
    AUX_TIME LIKE PKHD-KWBZM,
    AUX_PKHD_DAYS LIKE PKHD-KWBZD,
    AUX_PKHD_HOURS LIKE PKHD-KWBZM,
    AUX_TMP_DAYS LIKE PKHD-KWBZM VALUE 24,
    AUX_TMP_HRS LIKE PKHD-KWBZM,
    AUX_FILL_DAYS LIKE PKHD-KWBZD,
    AUX_FILL_HOURS LIKE AUX_HOURS,
    AUX_FILL_TIME LIKE PKHD-KWBZM,
    AUX_TOTAL_QTY LIKE PKHD-BEHMG,
    AUX_RATID LIKE PLAF-RATID,
    AUX_MATNR LIKE PLAF-MATNR,
    AUX_HEADER LIKE MARA-MATNR,
    AUX_ZZPTG LIKE MARC-ZZPTG,
    AUX_PEDTR LIKE PLAF-PEDTR,
    AUX_KRUEREST LIKE KBED-KRUEREST,
    AUX_KBEAREST LIKE KBED-KBEAREST,
    AUX_KRUEREST_T LIKE KBED-KRUEREST,
    AUX_KBEAREST_T LIKE KBED-KBEAREST,
    AUX_KEINH LIKE KBED-KEINH,
    AUX_KAPBD LIKE KBED-KBEAREST,
    AUX_ARBPL LIKE MKAL-MDV01,
    AUX_ARBID LIKE CRHD-OBJID,
    AUX_QUALF LIKE CRHD-QUALF,
    AUX_SAT1800 LIKE SY-UZEIT VALUE '180000'.
    S E L E C T I O N S C R E E N *
    INPUT SELECTION
    SELECTION-SCREEN : BEGIN OF BLOCK BL0 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS : SO_PRVBE FOR PVBE-PRVBE,
    SO_MATNR FOR MARA-MATNR,
    SO_ZZPTG FOR MARC-ZZPTG OBLIGATORY,
    SO_WERKS FOR MARC-WERKS OBLIGATORY,
    SO_BUDAT FOR MKPF-BUDAT OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK BL0.
    I N I T I A L I Z A T I O N *
    INITIALIZATION.
    MOVE SY-DATUM TO AUX_CURRENT.
    AUX_PREVIOUS = AUX_CURRENT - 1.
    MOVE SY-DATUM TO SO_BUDAT-LOW.
    MOVE '01' TO SO_BUDAT-LOW+6(2).
    APPEND SO_BUDAT.
    AUX_PREVIOUS = AUX_CURRENT - 1.
    A T S E L E C T I O N - S C R E E N *
    AT SELECTION-SCREEN.
    CHECK ON SELECTION SCREEN
    PERFORM CHECK_ON_SELECTION.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    CHECK IF BOM EXISTS FOR THE COMPONENTS
    PERFORM CHECK_BOM_EXISTENCE.
    GET FINISHED PRODUCT NUMBER FOR THE SUBASSEMBLIES
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    LOOP AT IT_MARC_ZTGRP.
    PERFORM GET_HEADER_MATERIAL USING IT_MARC_ZTGRP-MATNR.
    IF NOT IT_MAT[] IS INITIAL.
    PERFORM GET_FINISHED_GOOD TABLES IT_MAT.
    ENDIF.
    CLEAR IT_MARC_ZTGRP.
    ENDLOOP.
    ELSE.
    MESSAGE S010 WITH 'No data present for given selection'.
    ENDIF.
    CHECK IF SALES DATA EXIST FOR THE FINISHED GOOD
    PERFORM CHECK_SALESDATA_EXISTENCE.
    GET CONTROL CYCLE AND KANBAN DATA
    PERFORM GET_KANBAN_DATA.
    GET VALUATION AREA DATA
    PERFORM GET_VALUATION_AREA.
    GET MATERIAL DOCUMENT DATA
    PERFORM GET_MATERIAL_DOC_DATA.
    GET KANBAN DETAILS
    PERFORM GET_KANBAN_DETAILS.
    E N D O F S E L E C T I O N *
    END-OF-SELECTION.
    IF NOT IT_TEMP[] IS INITIAL.
    DISPLAY OUTPUT
    PERFORM DISPLAY_OUTPUT.
    ENDIF.
    *& Form CHECK_ON_SELECTION
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_ON_SELECTION .
    CHECK IF ENTERED PLANT IS VALID
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE WERKS EQ SO_WERKS-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_WERKS-LOW'.
    MESSAGE E010 WITH 'Please enter a valid Plant'.
    ENDIF.
    ENDIF.
    CHECK IF SUPPLY AREA AND PLANT IS VALID
    IF NOT SO_PRVBE-LOW IS INITIAL AND SO_PRVBE-HIGH IS INITIAL.
    IF NOT SO_WERKS IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM PVBE WHERE WERKS EQ SO_WERKS-LOW
    AND PRVBE EQ SO_PRVBE-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_PRVBE-LOW'.
    MESSAGE E010 WITH 'Supply Area' SO_PRVBE-LOW 'donot belong to'
    SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    CHECK IF ENTERED MATERIAL NUMBER IS VALID
    IF NOT SO_MATNR-LOW IS INITIAL AND SO_MATNR-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ SO_MATNR-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_MATNR-LOW'.
    MESSAGE E010 WITH 'Please enter a valid Material Number'.
    ELSE.
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE MATNR EQ SO_MATNR-LOW
    AND WERKS EQ SO_WERKS-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_MATNR-LOW'.
    MESSAGE E010 WITH 'Material' SO_MATNR-LOW
    'doesnot belong to plant' SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    CHECK IF TECHNOLOGY GROUP AND PLANT IS VALID
    IF NOT SO_ZZPTG-LOW IS INITIAL AND SO_ZZPTG-HIGH IS INITIAL.
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE WERKS EQ SO_WERKS-LOW
    AND ZZPTG EQ SO_ZZPTG-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_ZZPTG-LOW'.
    MESSAGE E010 WITH 'Tech.Group' SO_ZZPTG-LOW 'doesnot belong to plant'
    SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " CHECK_ON_SELECTION
    *& Form CHECK_BOM_EXISTENCE
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_BOM_EXISTENCE .
    JOIN MARC AND ZTGRP TABLES TO GET THE COMPONENTS BASED ON THE INPUT
    CRITERIA
    REFRESH IT_MARC_ZTGRP.
    SELECT MARCMATNR MARCWERKS ZTGRPZZPTG ZTGRPZZPTD
    INTO TABLE IT_MARC_ZTGRP
    FROM MARC INNER JOIN ZTGRP
    ON MARCWERKS EQ ZTGRPWERKS AND
    MARCZZPTG EQ ZTGRPZZPTG
    WHERE MARC~WERKS IN SO_WERKS
    AND MARC~ZZPTG IN SO_ZZPTG
    AND MARC~MATNR IN SO_MATNR
    AND MARC~LVORM NE 'X'
    AND ( MARC~BESKZ EQ 'E' OR
    MARC~BESKZ EQ 'X' ).
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    CHECK THE EXISTENCE OF BOM FOR THE SELECTED COMPONENTS.
    IF NOT PRESENT, DELETE THE ENTRY FROM INTERNAL TABLE
    LOOP AT IT_MARC_ZTGRP.
    REFRESH IT_RETURN.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = IT_MARC_ZTGRP-MATNR
    PLANT = IT_MARC_ZTGRP-WERKS
    BOMUSAGE = '1'
    TABLES
    RETURN = IT_RETURN.
    IF NOT IT_RETURN[] IS INITIAL.
    DELETE IT_MARC_ZTGRP WHERE MATNR EQ IT_MARC_ZTGRP-MATNR
    AND WERKS EQ IT_MARC_ZTGRP-WERKS
    AND ZZPTG EQ IT_MARC_ZTGRP-ZZPTG.
    ENDIF.
    CLEAR IT_MARC_ZTGRP.
    ENDLOOP.
    ELSE.
    MESSAGE S010 WITH 'No data present for given selection'.
    ENDIF.
    ENDFORM. " CHECK_BOM_EXISTENCE
    *& Form GET_HEADER_MATERIAL
    text
    -->P_IT_MARC_ZTGRP_MATNR text
    FORM GET_HEADER_MATERIAL USING P_MATNR.
    REFRESH IT_STPO.
    GET BOM ITEM DATA FOR THE COMPONENT
    SELECT * FROM STPO INTO TABLE IT_STPO WHERE IDNRK EQ P_MATNR
    AND DATUV LE SO_BUDAT-LOW
    AND LKENZ NE 'X'.
    IF NOT IT_STPO[] IS INITIAL.
    IF BOM ITEM DATA IS PRESENT FOR THE COMPONENT
    REFRESH IT_MAST.
    GET MATERIAL TO BOM LINK
    SELECT * FROM MAST INTO TABLE IT_MAST FOR ALL ENTRIES IN IT_STPO
    WHERE STLNR EQ IT_STPO-STLNR.
    IF NOT IT_MAST[] IS INITIAL.
    SORT IT_MAST BY MATNR.
    DELETE ADJACENT DUPLICATES FROM IT_MAST COMPARING MATNR.
    LOOP AT IT_MAST.
    CLEAR AUX_SET.
    REFRESH IT_PLANT.
    GET ALL THE PLANTS FOR THE COMPONENT
    SELECT MATNR WERKS FROM MARC INTO TABLE IT_PLANT
    WHERE MATNR EQ IT_MAST-MATNR.
    LOOP AT IT_PLANT.
    REFRESH IT_RETURN.
    CHECK FOR BOM EXISTENCE FOR MATERIAL IN ALL PLANTS
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = IT_MAST-MATNR
    PLANT = IT_PLANT-WERKS
    BOMUSAGE = '1'
    TABLES
    RETURN = IT_RETURN.
    IF IT_RETURN[] IS INITIAL.
    MOVE 'X' TO AUX_SET.
    ENDIF.
    CLEAR IT_PLANT.
    ENDLOOP.
    IF BOM EXISTS FOR THE COMPONENT IN ANY PLANT, MOVE THE COMPONENT
    TO INTERNAL TABLE IT_MAT
    IF AUX_SET EQ 'X'.
    MOVE IT_MAST-MATNR TO IT_MAT-MATNR.
    APPEND IT_MAT.
    CLEAR IT_MAT.
    ELSE.
    IF BOM DOESNOT EXISTS FOR THE COMPONENT IN ALL PLANTS,
    SELECT THE COMPONENT AS THE FINISHED PRODUCT
    CLEAR MARA.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ IT_MAST-MATNR.
    IF SY-SUBRC EQ 0 AND MARA-LVORM NE 'X'.
    MOVE: IT_MARC_ZTGRP-MATNR TO IT_MATERIAL-IDNRK,
    IT_MAST-MATNR TO IT_MATERIAL-MATNR.
    APPEND IT_MATERIAL.
    CLEAR IT_MATERIAL.
    ENDIF.
    ENDIF.
    CLEAR IT_MAST.
    ENDLOOP.
    ENDIF.
    ELSE.
    IF BOM ITEM DATA DOESNOT PRESENT FOR THE COMPONENT,
    CONSIDER THE COMPONENT AS FINISHED PRODUCT
    CLEAR MARA.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ P_MATNR.
    IF SY-SUBRC EQ 0 AND MARA-LVORM NE 'X'.
    MOVE: IT_MARC_ZTGRP-MATNR TO IT_MATERIAL-IDNRK,
    P_MATNR TO IT_MATERIAL-MATNR.
    APPEND IT_MATERIAL.
    CLEAR IT_MATERIAL.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_HEADER_MATERIAL
    *& Form GET_FINISHED_GOOD
    text
    -->P_IT_MAT text
    FORM GET_FINISHED_GOOD TABLES P_IT_MAT LIKE IT_MAT[].
    LOOP AT P_IT_MAT.
    PERFORM GET_HEADER_MATERIAL USING P_IT_MAT-MATNR.
    DELETE P_IT_MAT INDEX 1.
    CLEAR P_IT_MAT.
    ENDLOOP.
    ENDFORM. " GET_FINISHED_GOOD
    *& Form CHECK_SALESDATA_EXISTENCE
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_SALESDATA_EXISTENCE .
    IF NOT IT_MATERIAL[] IS INITIAL.
    LOOP AT IT_MATERIAL.
    CLEAR VBAP.
    SELECT SINGLE * FROM VBAP WHERE MATNR EQ IT_MATERIAL-MATNR.
    IF SY-SUBRC NE 0.
    DELETE IT_MATERIAL WHERE IDNRK EQ IT_MATERIAL-IDNRK
    AND MATNR EQ IT_MATERIAL-MATNR.
    ENDIF.
    CLEAR IT_MATERIAL.
    ENDLOOP.
    ENDIF.
    ENDFORM. " CHECK_SALESDATA_EXISTENCE
    *& Form GET_KANBAN_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_KANBAN_DATA.
    SORT IT_MATERIAL BY IDNRK MATNR.
    DELETE ADJACENT DUPLICATES FROM IT_MATERIAL COMPARING ALL FIELDS.
    IF NOT IT_MATERIAL[] IS INITIAL.
    GET CONTROL CYCLE HEADER DATA
    SELECT * FROM PKHD INTO TABLE IT_PKHD
    FOR ALL ENTRIES IN IT_MATERIAL
    WHERE WERKS IN SO_WERKS
    AND MATNR EQ IT_MATERIAL-IDNRK
    AND PRVBE IN SO_PRVBE.
    IF NOT IT_PKHD[] IS INITIAL.
    GET CONTROL CYCLE ITEM DATA
    SELECT * FROM PKPS INTO TABLE IT_PKPS
    FOR ALL ENTRIES IN IT_PKHD
    WHERE PKNUM EQ IT_PKHD-PKNUM.
    IF NOT IT_PKPS[] IS INITIAL.
    GET KANBAN STATUS DATA
    SELECT * FROM ZZC10 INTO TABLE IT_ZZC10_TEMP
    FOR ALL ENTRIES IN IT_PKPS
    WHERE PKKEY EQ IT_PKPS-PKKEY
    AND PKNUM EQ IT_PKPS-PKNUM
    AND ZDATE BETWEEN SO_BUDAT-LOW AND SY-DATUM
    AND STATUS EQ '5'.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_KANBAN_DATA
    *& Form GET_VALUATION_AREA
    text
    --> p1 text
    <-- p2 text
    FORM GET_VALUATION_AREA.
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    SELECT WERKS BWKEY FABKL FROM T001W INTO TABLE IT_T001W
    FOR ALL ENTRIES IN IT_MARC_ZTGRP
    WHERE WERKS EQ IT_MARC_ZTGRP-WERKS.
    ENDIF.
    ENDFORM. " GET_VALUATION_AREA
    *& Form GET_MATERIAL_DOC_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_MATERIAL_DOC_DATA.
    GET MATERIAL DOCUMENT HEADER DATA
    SELECT * FROM MKPF INTO TABLE IT_MKPF
    WHERE BUDAT IN SO_BUDAT.
    IF NOT IT_MKPF[] IS INITIAL.
    GET MATERIAL DOCUMENT ITEM DATA
    SELECT * FROM MSEG INTO TABLE IT_MSEG
    FOR ALL ENTRIES IN IT_MKPF
    WHERE MBLNR EQ IT_MKPF-MBLNR
    AND WERKS IN SO_WERKS
    AND MJAHR EQ SY-DATUM+0(4)
    AND ( BWART EQ '131' OR BWART EQ '132' ).
    IF NOT IT_MATERIAL[] IS INITIAL.
    LOOP AT IT_MSEG.
    READ TABLE IT_MATERIAL WITH KEY IDNRK = IT_MSEG-MATNR.
    IF SY-SUBRC NE 0.
    DELETE IT_MSEG WHERE MATNR EQ IT_MSEG-MATNR.
    ENDIF.
    CLEAR: IT_MATERIAL, IT_MSEG.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_MATERIAL_DOC_DATA
    *& Form GET_KANBAN_DETAILS
    text
    --> p1 text
    <-- p2 text
    FORM GET_KANBAN_DETAILS .
    SORT IT_PKHD BY PKNUM.
    IF NOT IT_ZZC10_TEMP[] IS INITIAL.
    LOOP AT IT_ZZC10_TEMP.
    CLEAR: AUX_FILL, AUX_PKBMG.
    MOVE IT_ZZC10_TEMP] TO IT_ZZC10[.
    DELETE IT_ZZC10 WHERE MATNR NE IT_ZZC10_TEMP-MATNR
    AND WERKS NE IT_ZZC10_TEMP-WERKS.
    LOOP AT IT_ZZC10.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2, AUX_ZZC10_HR, AUX_DIFF.
    EMPTY DATE GREATER THAN FULL DATE
    IF IT_ZZC10-DATE_EMPTY GT IT_ZZC10-DATE_FULL.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL DATE GREATER THAN EMPTY DATE
    ELSEIF IT_ZZC10-DATE_FULL GT IT_ZZC10-DATE_EMPTY.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP2.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP1.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL DATE EQUAL TO EMPTY DATE
    ELSEIF IT_ZZC10-DATE_FULL EQ IT_ZZC10-DATE_EMPTY.
    EMPTY TIME GREATER THAN FULL TIME
    IF IT_ZZC10-TIME_EMPTY GT IT_ZZC10-TIME_FULL.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL TIME GREATER THAN EMPTY TIME
    ELSEIF IT_ZZC10-TIME_FULL GT IT_ZZC10-TIME_EMPTY.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP2.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP1.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL TIME EQUAL TO EMPTY TIME
    ELSEIF IT_ZZC10-TIME_FULL EQ IT_ZZC10-TIME_EMPTY.
    AUX_ZZC10_HR = 0.
    ENDIF.
    ENDIF.
    READ TABLE IT_PKHD WITH KEY PKNUM = IT_ZZC10-PKNUM
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2,
    AUX_PKHD_DAYS, AUX_PKHD_HOURS, AUX_TMP_DAYS,
    AUX_PKHD_TIME.
    AUX_PKHD_DAYS = IT_PKHD-KWBZD.
    AUX_PKHD_HOURS = IT_PKHD-KWBZM.
    IF AUX_PKHD_DAYS NE 0.
    AUX_TMP_DAYS = AUX_PKHD_DAYS * 24.
    AUX_PKHD_TIME = AUX_TMP_DAYS + AUX_PKHD_HOURS.
    ELSE.
    AUX_PKHD_TIME = AUX_PKHD_HOURS.
    ENDIF.
    COMPARE STATUS CHANGE TIME WITH REPLENISHMENT LEAD TIME
    IF AUX_ZZC10_HR GT AUX_PKHD_TIME.
    CLEAR: AUX_LATEHOURS.
    LATE HOURS
    AUX_LATEHOURS = AUX_ZZC10_HR - AUX_PKHD_TIME.
    LATE QUANTITY FOR +1 DAY
    IF AUX_LATEHOURS LE 24.
    IT_TEMP-QTY_1 = IT_TEMP-QTY_1 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +2 DAYS
    ELSEIF AUX_LATEHOURS GT 24
    AND AUX_LATEHOURS LE 48.
    IT_TEMP-QTY_2 = IT_TEMP-QTY_2 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +3 DAYS
    ELSEIF AUX_LATEHOURS GT 48
    AND AUX_LATEHOURS LE 72.
    IT_TEMP-QTY_3 = IT_TEMP-QTY_3 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +4 DAYS
    ELSEIF AUX_LATEHOURS GT 72
    AND AUX_LATEHOURS LE 96.
    IT_TEMP-QTY_4 = IT_TEMP-QTY_4 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +5 DAYS
    ELSEIF AUX_LATEHOURS GT 96
    AND AUX_LATEHOURS LE 120.
    IT_TEMP-QTY_5 = IT_TEMP-QTY_5 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR MORE THAN 5 DAYS
    ELSEIF AUX_LATEHOURS GT 120.
    IT_TEMP-QTY_6 = IT_TEMP-QTY_6 + IT_ZZC10-PKBMG.
    ENDIF.
    TOTAL KANBAN LATE QUANTITIES
    AUX_PKBMG = AUX_PKBMG + IT_ZZC10-PKBMG.
    ELSE.
    AUX_FILL = AUX_FILL + IT_ZZC10-PKBMG.
    CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    SUBASSEMBLY PART NUMBER
    IT_TEMP-MATNR = IT_ZZC10-MATNR.
    FINISHED GOOD
    READ TABLE IT_MATERIAL WITH KEY IDNRK = IT_ZZC10-MATNR.
    IT_TEMP-FINISHED = IT_MATERIAL-MATNR.
    TECHNOLOGY GROUP
    READ TABLE IT_MARC_ZTGRP WITH KEY WERKS = IT_ZZC10-WERKS
    MATNR = IT_ZZC10-MATNR.
    IF SY-SUBRC EQ 0.
    MOVE IT_MARC_ZTGRP-ZZPTD TO IT_TEMP-TECH.
    ENDIF.
    NUMBER OF KANBAN CONTAINERS
    IT_TEMP-BEHAZ = IT_PKHD-BEHAZ.
    KANBAN QUANTITY
    IT_TEMP-BEHMG = IT_PKHD-BEHMG.
    LATE HOURS
    AUX_LATEHOURS = AUX_ZZC10_HR - AUX_PKHD_TIME.
    IT_TEMP-LATEHOURS = AUX_LATEHOURS.
    REPLENISHMENT LEAD TIME
    IT_TEMP-REPL_LEAD_TIME = AUX_PKHD_TIME.
    KANBAN LATE QUANTITIES
    IT_TEMP-GSMNG = AUX_PKBMG.
    FILL RATE
    AUX_TOTAL = AUX_PKBMG + AUX_FILL.
    IT_TEMP-FILLRATE = ( AUX_FILL / AUX_TOTAL ) * 100.
    GET STOCK IN PO01
    REFRESH IT_MARD.
    SELECT LABST FROM MARD INTO TABLE IT_MARD
    WHERE MATNR EQ IT_ZZC10-MATNR
    AND WERKS EQ IT_ZZC10-WERKS.
    IF SY-SUBRC EQ 0.
    LOOP AT IT_MARD.
    SUM.
    ENDLOOP.
    MOVE IT_MARD-LABST TO IT_TEMP-STOCK_PO01.
    CLEAR IT_MARD.
    ENDIF.
    GET YESTERDAY'S OUTPUT QUANTITY
    PERFORM GET_YESTERDAY_QTY.
    CUMULATIVE OUTPUT FOR ACTUAL MONTH
    PERFORM GET_CUMULATIVE_OUTPUT.
    GET BACKORDER SUBASSEMBLY DATA
    PERFORM GET_BACKORDER_QTY.
    GET BACKORDER FINISHED GOODS, TODAY, +1, +2, +3, +4, +5
    AND AVERAGE OUPTUT NEEDED DATA
    PERFORM GET_FINISHEDGOODS_DATA.
    GET DATA FOR ACTUAL MONTH DELIVERED
    PERFORM GET_ACTUAL_MONTH_DATA.
    APPEND IT_TEMP.
    CLEAR IT_TEMP.
    DELETE IT_ZZC10_TEMP WHERE MATNR EQ IT_ZZC10_TEMP-MATNR
    AND WERKS EQ IT_ZZC10_TEMP-WERKS.
    CLEAR: IT_ZZC10, IT_ZZC10_TEMP, IT_PKHD.
    ENDLOOP.
    ENDIF.
    ENDFORM. " GET_KANBAN_DETAILS
    *& Form GET_YESTERDAY_QTY
    text
    --> p1 text
    <-- p2 text
    FORM GET_YESTERDAY_QTY .
    CLEAR: AUX_BUKRS, AUX_WAERS.
    READ TABLE IT_T001W WITH KEY WERKS = IT_PKHD-WERKS.
    IF SY-SUBRC EQ 0.
    CLEAR AUX_FABKL.
    MOVE IT_T001W-FABKL TO AUX_FABKL.
    SELECT SINGLE BUKRS INTO AUX_BUKRS FROM T001K
    WHERE BWKEY = IT_T001W-BWKEY.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE WAERS INTO AUX_WAERS FROM T001
    WHERE BUKRS = AUX_BUKRS.
    ENDIF.
    IF 'WD;WF;WN;WP;WU' CS AUX_FABKL.
    AUX_FABKL(1) = 'P'.
    ENDIF.
    MOVE SY-DATUM TO AUX_DATUMABSOLUT.
    PERFORM WEEKDAY USING AUX_DATUMABSOLUT.
    MOVE 'W' TO AUX_FLAG.
    PERFORM CHECK_WORKING_DAY CHANGING AUX_FLAG.
    IF AUX_DATUMABSOLUT = 0.
    AUX_YDAY = SY-DATUM.
    ELSEIF AUX_DATUMABSOLUT = 1.
    AUX_YDAY = SY-DATUM - 1.
    ELSEIF AUX_FLAG = 'F'.
    AUX_YDAY = SY-DATUM.
    ENDIF.
    IF AUX_DATUMABSOLUT = 0 OR
    AUX_DATUMABSOLUT = 1 OR
    AUX_FLAG = 'F'.
    PERFORM DATE_WITH_OFFSET USING 0 CHANGING AUX_TDAY.
    PERFORM DATE_WITH_OFFSET USING 1 CHANGING AUX_DAY1.
    PERFORM DATE_WITH_OFFSET USING 2 CHANGING AUX_DAY2.
    PERFORM DATE_WITH_OFFSET USING 3 CHANGING AUX_DAY3.
    PERFORM DATE_WITH_OFFSET USING 4 CHANGING AUX_DAY4.
    PERFORM DATE_WITH_OFFSET USING 5 CHANGING AUX_DAY5.
    ELSE.
    PERFORM DATE_WITH_OFFSET USING 0 CHANGING AUX_YDAY.
    PERFORM DATE_WITH_OFFSET USING 1 CHANGING AUX_TDAY.
    PERFORM DATE_WITH_OFFSET USING 2 CHANGING AUX_DAY1.
    PERFORM DATE_WITH_OFFSET USING 3 CHANGING AUX_DAY2.
    PERFORM DATE_WITH_OFFSET USING 4 CHANGING AUX_DAY3.
    PERFORM DATE_WITH_OFFSET USING 5 CHANGING AUX_DAY4.
    PERFORM DATE_WITH_OFFSET USING 6 CHANGING AUX_DAY5.
    ENDIF.
    AUX_BORD = '19000101'.
    GET PLANNED ORDER DATA FOR YESTERDAY
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_PKHD-MATNR
    AND PLWRK EQ IT_PKHD-WERKS
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR EQ AUX_YDAY.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    REFRESH IT_KBED_KAKO.
    SELECT KBED~KBEAREST KBED~KRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBED~KAPID EQ KAKO~KAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    ADD IT_KBED_KAKO-KBEAREST TO AUX_KBEAREST.
    ADD IT_KBED_KAKO-KRUEREST TO AUX_KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    CLEAR IT_PLAF.
    ENDLOOP.
    ENDIF.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE: AUX_KAPBD TO IT_TEMP-KAPBD_OUTY,
    IT_KBED_KAKO-KEINH TO IT_TEMP-KEINH_OUTY.
    GET OUTPUT QUANTITY FOR YESTERDAY
    REFRESH: IT_MKPF, IT_MSEG.
    CLEAR: AUX_MENGE.
    SELECT * FROM MKPF INTO TABLE IT_MKPF
    WHERE BUDAT EQ AUX_PREVIOUS.
    IF NOT IT_MKPF[] IS INITIAL.
    GET MATERIAL DOCUMENT ITEM DATA
    SELECT * FROM MSEG INTO TABLE IT_MSEG
    FOR ALL ENTRIES IN IT_MKPF
    WHERE MBLNR EQ IT_MKPF-MBLNR
    AND MATNR IN SO_MATNR
    AND WERKS IN SO_WERKS
    AND MJAHR EQ SY-DATUM+0(4)
    AND ( BWART EQ '131' OR BWART EQ '132' ).
    IF NOT IT_MSEG[] IS INITIAL.
    LOOP AT IT_MSEG.
    AUX_MENGE = AUX_MENGE + IT_MSEG-MENGE.
    CLEAR IT_MSEG.
    ENDLOOP.
    ENDIF.
    ENDIF.
    READ TABLE IT_MSEG INDEX 1.
    MOVE: AUX_MENGE TO IT_TEMP-GSMNG_OUTY,
    IT_MSEG-MEINS TO IT_TEMP-MEINS_OUTY.
    CLEAR IT_T001W.
    ENDIF.
    ENDFORM. " GET_YESTERDAY_QTY
    *& Form GET_BACKORDER_QTY
    text
    --> p1 text
    <-- p2 text
    FORM GET_BACKORDER_QTY .
    GET PLANNED ORDER DATA FOR BACKORDER
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG, AUX_QUANT.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_ZZC10-MATNR
    AND PLWRK EQ IT_ZZC10-WERKS
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR GE SO_BUDAT-LOW
    AND PEDTR LE SY-DATUM.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2, AUX_PLAF_HR, AUX_DIFF.
    EMPTY DATE GREATER THAN FULL DATE
    CONCATENATE SY-DATUM SY-UZEIT
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_PLAF-PEDTR IT_PLAF-PEDTI
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_PLAF_HR = AUX_DIFF / 3600.
    IF AUX_PLAF_HR > AUX_PKHD_TIME.
    AUX_GSMNG = AUX_GSMNG + IT_PLAF-GSMNG.
    REFRESH IT_KBED_KAKO.
    SELECT KBEDKBEAREST KBEDKRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBEDKAPID EQ KAKOKAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    AUX_KBEAREST = AUX_KBEAREST + IT_KBED_KAKO-KBEAREST.
    AUX_KRUEREST = AUX_KRUEREST + IT_KBED_KAKO-KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    ENDIF.
    ENDLOOP.
    READ TABLE IT_PLAF INDEX 1.
    MOVE: AUX_GSMNG TO IT_TEMP-GSMNG_BORD,
    IT_PLAF-MEINS TO IT_TEMP-MEINS_BORD.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE: AUX_KAPBD TO IT_TEMP-KAPBD_BORD,
    IT_KBED_KAKO-KEINH TO IT_TEMP-KEINH_BORD.
    ENDIF.
    ENDFORM. " GET_BACKORDER_QTY
    *& Form WEEKDAY
    text
    -->P_AUX_DATUMABSOLUT text
    FORM WEEKDAY USING P_DATUMABSOLUT.
    P_DATUMABSOLUT = P_DATUMABSOLUT MOD 7.
    ENDFORM. " WEEKDAY
    *& Form CHECK_WORKING_DAY
    text
    <--P_AUX_FLAG text
    FORM CHECK_WORKING_DAY CHANGING P_FLAG.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
    EXPORTING
    DATE = SY-DATUM
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    DATE = AUX_FDAY
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    CORRECT_OPTION_INVALID = 2
    DATE_AFTER_RANGE = 3
    DATE_BEFORE_RANGE = 4
    DATE_INVALID = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    IF AUX_FDAY NE SY-DATUM.
    AUX_FLAG = 'F'.
    ENDIF.
    ENDFORM. " CHECK_WORKING_DAY
    *& Form DATE_WITH_OFFSET
    text
    -->P_0 text
    <--P_AUX_TDAY text
    FORM DATE_WITH_OFFSET USING AUX_OFFSET
    CHANGING P_TDAY.
    DATA:
    AUX_CALENDARDATE LIKE SCAL-DATE,
    AUX_FACTORYDATE LIKE SCAL-FACDATE.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
    EXPORTING
    DATE = SY-DATUM
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    FACTORYDATE = AUX_FACTORYDATE
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    CORRECT_OPTION_INVALID = 2
    DATE_AFTER_RANGE = 3
    DATE_BEFORE_RANGE = 4
    DATE_INVALID = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    AUX_FACTORYDATE = AUX_FACTORYDATE + AUX_OFFSET.
    CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
    EXPORTING
    FACTORYDATE = AUX_FACTORYDATE
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    DATE = AUX_CALENDARDATE
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    FACTORYDATE_AFTER_RANGE = 2
    FACTORYDATE_BEFORE_RANGE = 3
    FACTORYDATE_INVALID = 4
    FACTORY_CALENDAR_ID_MISSING = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    P_TDAY = AUX_CALENDARDATE.
    ENDFORM. " DATE_WITH_OFFSET
    *& Form GET_CUMULATIVE_OUTPUT
    text
    --> p1 text
    <-- p2 text
    FORM GET_CUMULATIVE_OUTPUT .
    CLEAR: AUX_LOW, AUX_HIGH.
    MOVE: SY-DATUM TO AUX_LOW,
    SY-DATUM TO AUX_HIGH.
    MOVE: '01' TO AUX_LOW+6(2),
    '31' TO AUX_HIGH+6(2).
    REFRESH IT_MKPF_MSEG.
    CLEAR AUX_MNG.
    SELECT MKPFMBLNR MKPFMJAHR MKPF~BUDAT
    MSEGBWART MSEGMATNR MSEGMENGE MSEGMEINS MSEGDMBTR MSEGWERKS
    INTO TABLE IT_MKPF_MSEG
    FROM MKPF JOIN MSEG
    ON MKPFMBLNR EQ MSEGMBLNR
    WHERE MKPF~BUDAT BETWEEN AUX_LOW AND AUX_HIGH
    AND MKPF~MJAHR EQ AUX_CURRENT+0(4)
    AND MKPF~VGART EQ 'WS'
    AND MSEG~ZEILE EQ 1
    AND MSEG~WERKS EQ SO_WERKS
    AND MSEG~MATNR EQ IT_PKHD-MATNR
    AND MSEG~BWART IN ('131', '132').
    IF NOT IT_MKPF_MSEG[] IS INITIAL.
    LOOP AT IT_MKPF_MSEG.
    AUX_MNG = AUX_MNG + IT_MKPF_MSEG-MENGE.
    CLEAR IT_MKPF_MSEG.
    ENDLOOP.
    ENDIF.
    MOVE AUX_MNG TO IT_TEMP-GSMNG_OUTM.
    READ TABLE IT_MKPF_MSEG INDEX 1.
    MOVE IT_MKPF_MSEG-MEINS TO IT_TEMP-MEINS_OUTM.
    REFRESH IT_COBK.
    SELECT DISTINCT BLPP~RUECK FROM BLPK INNER JOIN BLPP
    ON BLPKPRTNR EQ BLPPPRTNR
    INTO TABLE IT_COBK
    WHERE BLPK~WERKS EQ SO_WERKS
    AND BLPK~MATNR EQ SO_MATNR
    AND BLPK~DATUM BETWEEN AUX_LOW
    AND AUX_HIGH
    AND BLPP~PRTPS EQ '0002'.
    IF NOT IT_COBK[] IS INITIAL.
    REFRESH IT_COEPL.
    SELECT KOKRS BELNR FROM COBK
    INTO CORRESPONDING FIELDS OF TABLE IT_COEPL
    FOR ALL ENTRIES IN IT_COBK
    WHERE REFBT EQ 'R'
    AND REFBN EQ IT_COBK-RUECK
    AND BLDAT BETWEEN AUX_LOW AND AUX_HIGH.
    CLEAR IT_CAPACITIES.
    REFRESH IT_CAPACITIES.
    LOOP AT IT_COEPL.
    SELECT LSBBTR MEINB FROM COEPL
    APPENDING CORRESPONDING FIELDS OF TABLE IT_CAPACITIES
    WHERE KOKRS EQ IT_COEPL-KOKRS
    AND BELNR EQ IT_COEPL-BELNR
    AND OBJNR LIKE '%DLABOR'.
    CALL FUNCTION 'UNIT_SUM'
    IMPORTING
    QUANTITY_SUM = IT_TEMP-KAPBD_OUTM
    UNIT_SUM = AUX_SUM_UNIT
    TABLES
    QUANTITIES_UNITS = IT_CAPACITIES.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_TEMP-KAPBD_OUTM
    UNIT_IN = AUX_SUM_UNIT
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_TEMP-KAPBD_OUTM.
    ENDLOOP.
    READ TABLE IT_CAPACITIES INDEX 1.
    MOVE IT_CAPACITIES-MEINB TO IT_TEMP-KEINH_OUTM.
    ENDIF.
    ENDFORM. " GET_CUMULATIVE_OUTPUT
    *& Form GET_FINISHEDGOODS_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_FINISHEDGOODS_DATA .
    GET PLANNED ORDER DATA
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_TEMP-FINISHED
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR GE AUX_BORD
    AND PEDTR LE AUX_DAY5.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_GSMNG.
    REFRESH IT_KBED_KAKO.
    SELECT KBEDKBEAREST KBEDKRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBEDKAPID EQ KAKOKAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    CLEAR AUX_KAPBD.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    ADD IT_KBED_KAKO-KBEAREST TO AUX_KBEAREST.
    ADD IT_KBED_KAKO-KRUEREST TO AUX_KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    READ TABLE IT_KBED_KAKO INDEX 1.
    CASE IT_PLAF-PEDTR.
    WHEN AUX_DAY5.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY5 = IT_TEMP-F_GSMNG_DAY5 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY5 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY5 = IT_TEMP-F_KAPBD_DAY5 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY5 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY4.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY4 = IT_TEMP-F_GSMNG_DAY4 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY4 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY4 = IT_TEMP-F_KAPBD_DAY4 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY4 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY3.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY3 = IT_TEMP-F_GSMNG_DAY3 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY3 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY3 = IT_TEMP-F_KAPBD_DAY3 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY3 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY2.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY2 = IT_TEMP-F_GSMNG_DAY2 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY2 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY2 = IT_TEMP-F_KAPBD_DAY2 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY2 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY1.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY1 = IT_TEMP-F_GSMNG_DAY1 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY1 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY1 = IT_TEMP-F_KAPBD_DAY1 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY1 = IT_KBED_KAKO-KEINH.
    WHEN AUX_TDAY.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_TDAY = IT_TEMP-F_GSMNG_TDAY + AUX_GSMNG.
    IT_TEMP-F_MEINS_TDAY = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_TDAY = IT_TEMP-F_KAPBD_TDAY + AUX_KAPBD.
    IT_TEMP-F_KEINH_TDAY = IT_KBED_KAKO-KEINH.
    WHEN OTHERS.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_BORD = IT_TEMP-F_GSMNG_BORD + AUX_GSMNG.
    IT_TEMP-F_MEINS_BORD = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_BORD = IT_TEMP-F_KAPBD_BORD + AUX_KAPBD.
    IT_TEMP-F_KEINH_BORD = IT_KBED_KAKO-KEINH.
    ENDCASE.
    IT_TEMP-F_GSMNG_OUTN = IT_TEMP-F_GSMNG_OUTN + AUX_GSMNG.
    IT_TEMP-F_KAPBD_OUTN = IT_TEMP-F_KAPBD_OUTN + AUX_KAPBD.
    ENDLOOP.
    READ TABLE IT_PLAF INDEX 1.
    MOVE IT_PLAF-MEINS TO IT_TEMP-F_MEINS_OUTN.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE IT_KBED_KAKO-KEINH TO IT_TEMP-F_KEINH_OUTN.
    ENDIF.
    ENDFORM. " GET_FINISHEDGOODS_DATA
    *& Form GET_ACTUAL_MONTH_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_ACTUAL_MONTH_DATA .
    CLEAR: AUX_LOW, AUX_HIGH.
    MOVE: '01' TO SO_BUDAT-LOW+6(2),
    SO_BUDAT-LOW TO AUX_LOW,
    '31' TO SO_BUDAT-LOW+6(2),
    SO_BUDAT-LOW TO AUX_HIGH.
    REFRESH IT_MKPF_MSEG.
    CLEAR AUX_MNG.
    SELECT MKPFMBLNR MKPFMJAHR MKPF~BUDAT
    MSEGBWART MSE

    Hi Ramya,
    Your program contains a lot of BIG standard tables, these tables
    usually contain huge amount of data,
    plus you have used SELECT * in many places, try to avoid that and replace with only those field names that are reqd.
    even the joins are on huge tables, performance could improve on those  if you can put some more conditions or keys to the joins to make it more specific.
    even after that if it gives the Runtime Error then you have 2 options:
    1. Ask your Basis to increase Time limit for program executing in foreground.
    2. Execute your program in Background Mode.
    Regards,
    Samson Rodrigues.

  • Performance issues when creating a Report / Query in Discoverer

    Hi forum,
    Hope you are can help, it involves a performance issues when creating a Report / Query.
    I have a Discoverer Report that currently takes less than 5 seconds to run. After I add a condition to bring back Batch Status that = ‘Posted’ we cancelled the query after reaching 20 minutes as this is way too long. If I remove the condition the query time goes back to less than 5 seconds.
    Please see attached the SQL Inspector Plan:
    Before Condition
    SELECT STATEMENT
    SORT GROUP BY
    VIEW SYS
    SORT GROUP BY
    NESTED LOOPS OUTER
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    TABLE ACCESS BY INDEX ROWID GL.GL_CODE_COMBINATIONS
    AND-EQUAL
    INDEX RANGE SCAN GL.GL_CODE_COMBINATIONS_N2
    INDEX RANGE SCAN GL.GL_CODE_COMBINATIONS_N1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUES
    INDEX RANGE SCAN APPLSYS.FND_FLEX_VALUES_N1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUE_SETS
    INDEX UNIQUE SCAN APPLSYS.FND_FLEX_VALUE_SETS_U1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUES_TL
    INDEX UNIQUE SCAN APPLSYS.FND_FLEX_VALUES_TL_U1
    INDEX RANGE SCAN APPLSYS.FND_FLEX_VALUE_NORM_HIER_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_LINES
    INDEX RANGE SCAN GL.GL_JE_LINES_N1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_HEADERS
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_DAILY_CONVERSION_TYPES_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_SOURCES_TL
    INDEX UNIQUE SCAN GL.GL_JE_SOURCES_TL_U1
    INDEX UNIQUE SCAN GL.GL_JE_CATEGORIES_TL_U1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_JE_BATCHES_U1
    INDEX UNIQUE SCAN GL.GL_BUDGET_VERSIONS_U1
    INDEX UNIQUE SCAN GL.GL_ENCUMBRANCE_TYPES_U1
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_BATCHES
    INDEX UNIQUE SCAN GL.GL_JE_BATCHES_U1
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    INDEX UNIQUE SCAN GL.GL_JE_BATCHES_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_PERIODS
    INDEX RANGE SCAN GL.GL_PERIODS_U1
    After Condition
    SELECT STATEMENT
    SORT GROUP BY
    VIEW SYS
    SORT GROUP BY
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS
    NESTED LOOPS
    NESTED LOOPS OUTER
    NESTED LOOPS
    TABLE ACCESS FULL GL.GL_JE_BATCHES
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    INDEX UNIQUE SCAN GL.GL_JE_BATCHES_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_HEADERS
    INDEX RANGE SCAN GL.GL_JE_HEADERS_N1
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    INDEX UNIQUE SCAN GL.GL_ENCUMBRANCE_TYPES_U1
    INDEX UNIQUE SCAN GL.GL_DAILY_CONVERSION_TYPES_U1
    INDEX UNIQUE SCAN GL.GL_BUDGET_VERSIONS_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_SOURCES_TL
    INDEX UNIQUE SCAN GL.GL_JE_SOURCES_TL_U1
    INDEX UNIQUE SCAN GL.GL_JE_CATEGORIES_TL_U1
    INDEX UNIQUE SCAN GL.GL_JE_BATCHES_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_JE_LINES
    INDEX RANGE SCAN GL.GL_JE_LINES_U1
    INDEX UNIQUE SCAN GL.GL_SETS_OF_BOOKS_U2
    TABLE ACCESS BY INDEX ROWID GL.GL_CODE_COMBINATIONS
    INDEX UNIQUE SCAN GL.GL_CODE_COMBINATIONS_U1
    TABLE ACCESS BY INDEX ROWID GL.GL_PERIODS
    INDEX RANGE SCAN GL.GL_PERIODS_U1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUES
    INDEX RANGE SCAN APPLSYS.FND_FLEX_VALUES_N1
    INDEX RANGE SCAN APPLSYS.FND_FLEX_VALUE_NORM_HIER_U1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUES_TL
    INDEX UNIQUE SCAN APPLSYS.FND_FLEX_VALUES_TL_U1
    TABLE ACCESS BY INDEX ROWID APPLSYS.FND_FLEX_VALUE_SETS
    INDEX UNIQUE SCAN APPLSYS.FND_FLEX_VALUE_SETS_U1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    INDEX UNIQUE SCAN GL.GL_JE_HEADERS_U1
    Is there anything i can do in Discoverer Desktop / Administration to avoid this problem.
    Many thanks,
    Lance

    Hi Rod,
    I've tried the condition (Batch Status||'' = 'Posted') as you suggested, but the qeury time is still over 20 mins. To test i changed it to (Batch Status||'' = 'Unposted') and the query was returned within seconds again.
    I’ve been doing some more digging and have found the database view that is linked to the Journal Batches folder. See below.
    I think the problem is with the column using DECODE. When querying the column in TOAD the value of ‘P’ is returned. But in discoverer the condition is done on the value ‘Posted’. I’m not too sure how DECODE works, but think this could be the causing some sort of issue with Full Table Scans. How do we get around this?
    Lance
    DECODE( JOURNAL_BATCH1.STATUS,
    '+', 'Unable to validate or create CTA',
    '+*', 'Was unable to validate or create CTA',
    '-','Invalid or inactive rounding differences account in journal entry',
    '-*', 'Modified invalid or inactive rounding differences account in journal entry',
    '<', 'Showing sequence assignment failure',
    '<*', 'Was showing sequence assignment failure',
    '>', 'Showing cutoff rule violation',
    '>*', 'Was showing cutoff rule violation',
    'A', 'Journal batch failed funds reservation',
    'A*', 'Journal batch previously failed funds reservation',
    'AU', 'Showing batch with unopened period',
    'B', 'Showing batch control total violation',
    'B*', 'Was showing batch control total violation',
    'BF', 'Showing batch with frozen or inactive budget',
    'BU', 'Showing batch with unopened budget year',
    'C', 'Showing unopened reporting period',
    'C*', 'Was showing unopened reporting period',
    'D', 'Selected for posting to an unopened period',
    'D*', 'Was selected for posting to an unopened period',
    'E', 'Showing no journal entries for this batch',
    'E*', 'Was showing no journal entries for this batch',
    'EU', 'Showing batch with unopened encumbrance year',
    'F', 'Showing unopened reporting encumbrance year',
    'F*', 'Was showing unopened reporting encumbrance year',
    'G', 'Showing journal entry with invalid or inactive suspense account',
    'G*', 'Was showing journal entry with invalid or inactive suspense account',
    'H', 'Showing encumbrance journal entry with invalid or inactive reserve account',
    'H*', 'Was showing encumbrance journal entry with invalid or inactive reserve account',
    'I', 'In the process of being posted',
    'J', 'Showing journal control total violation',
    'J*', 'Was showing journal control total violation',
    'K', 'Showing unbalanced intercompany journal entry',
    'K*', 'Was showing unbalanced intercompany journal entry',
    'L', 'Showing unbalanced journal entry by account category',
    'L*', 'Was showing unbalanced journal entry by account category',
    'M', 'Showing multiple problems preventing posting of batch',
    'M*', 'Was showing multiple problems preventing posting of batch',
    'N', 'Journal produced error during intercompany balance processing',
    'N*', 'Journal produced error during intercompany balance processing',
    'O', 'Unable to convert amounts into reporting currency',
    'O*', 'Was unable to convert amounts into reporting currency',
    'P', 'Posted',
    'Q', 'Showing untaxed journal entry',
    'Q*', 'Was showing untaxed journal entry',
    'R', 'Showing unbalanced encumbrance entry without reserve account',
    'R*', 'Was showing unbalanced encumbrance entry without reserve account',
    'S', 'Already selected for posting',
    'T', 'Showing invalid period and conversion information for this batch',
    'T*', 'Was showing invalid period and conversion information for this batch',
    'U', 'Unposted',
    'V', 'Journal batch is unapproved',
    'V*', 'Journal batch was unapproved',
    'W', 'Showing an encumbrance journal entry with no encumbrance type',
    'W*', 'Was showing an encumbrance journal entry with no encumbrance type',
    'X', 'Showing an unbalanced journal entry but suspense not allowed',
    'X*', 'Was showing an unbalanced journal entry but suspense not allowed',
    'Z', 'Showing invalid journal entry lines or no journal entry lines',
    'Z*', 'Was showing invalid journal entry lines or no journal entry lines', NULL ),

Maybe you are looking for

  • Animated drop down buttons not working in movie clip

    Hi, I am working on this site: (AS2) http://www.steamandclean.com/Index_w_1.html I have two types of drop down menu. One under Commercial and one under Technical The buttons are movie clips. The drop downs are also movie clips that start in frame 2 a

  • Where is the .m2v menu file located for saved projects?

    Hi, i've done this before, but seem to have forgotten...I was wondering where is the location of the .m2v files of a saved project. The reason why i would like to find the .m2v file, is so i could convert the .m2v to .dv in order to create a menu on

  • My bb doesn't connect to browser or app world pls help.

    i have a bb 9300 and my browser does not load, also app world doesn't work, it tells me i have to upgrade but since i cannoct connect to the browser i cant do it. i cannot connect my emails either although apps such as fb work.. whats the problem and

  • Linux window display size is small

    I installed oracle linux on my Laptop. The linux widow size display is small where as the windows XP window display is comming full screen. What can i do to make the linux window to ne displayed full screen? Can someone please provide me the solution

  • Photoshop crashes when opening 2 files

    I can open one file fine. As soon as I try to open a second document, so that I have 2 files open at the same time, it crashes. It can be anything, from a .PSD to a plain .jpg. It started after I installed 3ds max 2009. I've uninstalled it, and I sti