SMON process taking more CPU approx.49% of total CPU

Hi,
we have one isuue with one of our production database.
database version 10.2.0.4
OS Version AIX 5.3
DB SIZE=450Gb
when i check in database one delete Query is running in database is as follows and smon process of that perticular database consuming about 49%CPU.
delete from smon_scn_time where thread=0 and scn = (select min(scn) from smon_scn_time where thread=0)
please help me to resolved this issue.
Thanks.

SMON   and unaccessible   SMON_SCN_TIME table
Please check the mentioned MOS doc in first place.

Similar Messages

  • Oracle internal queries taking more CPU time

    Hi,
    Following are queries taking more CPU time. I got this from awr report. Can anyone tell me why these queries are running? Is it a oracle enterprise manager query? should I use
    emctl stop dbconsole to stop this?
    DECLARE job BINARY_INTEGER := :job; next_date DATE := :mydate; broken BOOLEAN := FALSE; BEGIN EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS(); :mydate := next_date; IF broken THEN :b := 1; ELSE :b := 0; END IF; END;
    SELECT COUNT(*) FROM MGMT_METRIC_DEPENDENCY_DETAILS DEP, MGMT_SEVERITY SEV WHERE DEP.TARGET_GUID = :B5 AND DEP.METRIC_GUID = :B4 AND DEP.KEY_VALUE = :B3 AND DEP.EDEP_TARGET_GUID = SEV.TARGET_GUID AND DEP.EDEP_METRIC_GUID = SEV.METRIC_GUID AND DEP.DEP_KEY_VALUE = SEV.KEY_VALUE AND SEV.COLLECTION_TIMESTAMP BETWEEN :B2 AND :B1
    SELECT CURRENT_STATUS FROM MGMT_CURRENT_AVAILABILITY WHERE TARGET_GUID = :B1
    Thanks in advance
    With Regards
    boobathi.P

    Hi,
    maybe this document will help if you are using 10g:
    SQL run by SYSMAN consuming a lot of resources on OMS with 800+ targets [ID 330383.1]
    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLEM&id=330383.1
    there you'll find Cause and Solution too:
    SYSMAN Job and Queries are Taking Up High CPU (DB Console) [ID 1288301.1]
    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLEM&id=1288301.1
    For databases above version 11.1 there are paches available.
    Best,
    Michael T. Z.

  • How to find which query taking more cpu

    Hi,
    How to find which query taking more CPU
    at a particular point of time .
    Chhers,

    Take a look at Server Standard Reports. It has a few CPU usage oriented reports.
    You can also track CPU usage by server-side tracing:
    http://www.sqlusa.com/bestpractices/createtrace/
    Glenn Berry's CPU usage query:
    SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime],
    qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count,
    ISNULL(qs.execution_count/DATEDIFF(Second, qs.cached_time, GETDATE()), 0) AS [Calls/Second],
    qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count
    AS [avg_elapsed_time], qs.cached_time
    FROM sys.procedures AS p WITH (NOLOCK)
    INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
    ON p.[object_id] = qs.[object_id]
    WHERE qs.database_id = DB_ID()
    ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE);
    LINK:
    http://dba.stackexchange.com/questions/52216/sql-server-2008-high-cpu-historical-queries
    Query optimization:
    http://www.sqlusa.com/articles/query-optimization/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Dbms_stats.cleanup_stats_db_proc taking more CPU time.

    Hi All,
    Oracle 11g R2(11.2.0.3) EE , on Linux machine.
    Oracle auto optimizer stats collection enabled in our environment. In that dbms_stats.cleanup_stats_db_proc() taking more CPU time (more than 24 hours).
    Could you please suggest any solution.
    Thanks in advance.
    BR,
    Surya

    suresh.ratnaji wrote:
    NAME                                 TYPE        VALUE
    _optimizer_cost_based_transformation string      OFF
    filesystemio_options                 string      asynch
    object_cache_optimal_size            integer     102400
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.4
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      choose
    optimizer_secure_view_merging        boolean     TRUE
    plsql_optimize_level                 integer     2
    please let me know why it taking more time in INDEX RANGE SCAN compare to the full table scan?Suresh,
    Any particular reason why you have a non-default value for a hidden parameter, optimizercost_based_transformation ?
    On my 10.2.0.1 database, its default value is "linear". What happens when you reset the value of the hidden parameter to default?

  • Which process taking high CPU

    Hi
    Our environment is having SCOM 2007 R2.
    I want to get the details of processes taking high CPU,memory in windows server 2003 , 2008. These details are stored in Opsmgr DatawareHouse ? , can I get in the form of reports? OR any script available.Please help.
    Regards
    Madhavi

    Hi Madhavi,
    Run this script on a server and you will get the individual process utilization. I am not sure how you exactly need this.
    strComputer = "localhost"
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" _
        & strComputer & "\root\cimv2")
    Set colProcesses = objWMIService.ExecQuery _
       ("Select * from Win32_Process")
    For Each objProcess in colProcesses
        Wscript.Echo "Process: " & objProcess.Name
        sngProcessTime = (CSng(objProcess.KernelModeTime) + _
            CSng(objProcess.UserModeTime)) / 10000000
        Wscript.Echo "Processor Time: " & sngProcessTime
        Wscript.Echo "Process ID: " & objProcess.ProcessID
        Wscript.Echo "Working Set Size: " _
        & objProcess.WorkingSetSize
        Wscript.Echo "Page File Size: " _
        & objProcess.PageFileUsage
        Wscript.Echo "Page Faults: " & objProcess.PageFaults
    Next
    Let me know if this helps
    Regards, Dhanraj

  • SMON process consume High CPU in production setup.

    Hi,
    Recently we migrate our storage from IBM DS4700 to IBM v7000. on last Saturday from yesterday and today cpu almost 100 percent in peak hours.
    Right now our datafiles in SSD and archivelogs in SAS disk.
    Please suggest
    regards,
    Karthi.

    Hi Karthi,
    Which SMON process is consuming CPU ,I mean,Database SMON /ASM SMON if is in use.
    + Install and enable OSwatcher with atleast 30 seconds interval and monitor which process /what is causing high CPU.
    + If they are oracle processes ,then validate what are they doing at database level .
       Does it comes from any application code ,if so validate those sqls.
    + Install procwatcher to understand what are they doing .
    Refer::-----------
    ==============
    Procwatcher: Script to Monitor and Examine Oracle DB and Clusterware Processes (Doc ID 459694.1)
    + Then as per your environment get pstack/procstack of that process in 30 seconds interval for 3-4 times .
    If try to identify the issue ,if required please open service request with us.
    Regards,
    Aritra

  • Server Process taking all CPU time intermittently on Solaris

    Hi,
    What does my program do :-
    We have been facing this problem from many days, We have a server
    process which is continuously listening at a port on Solaris 5.8.
    Whenever a request is sent to this server a new thread & a socket is created for that client.
    This process is running as a proxy server, which connects to some other machine on client request.
    Problem:
    The process start taking whole CPU after few days, happens in a weeks
    period. The process remain in this state for few hours & after that it
    stops responding to any requests.
    & the only thing which can be done, to make it work is to restart the
    process.
    If someone has faced a similar problem then please let me know if you
    have found a solution for that.
    I will give 10 duke dollars to you if you can provide a solution for this problem.
    Regards,
    Sachin

    Here is another class which is used in my code:
    package com.ge.med.service.olea.telnetapplet.proxy;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    * This class is a generic framework for a flexible, multi-threaded server.
    * It listens on any number of specified ports, and, when it receives a
    * connection on a port, passes input and output streams to a specified Service
    * object which provides the actual service. It can limit the number of
    * concurrent connections, and logs activity to a specified stream.
    public class Server {
    // This is the state for the server
    ConnectionManager connectionManager; // The ConnectionManager object
    Hashtable services; // The current services and their ports
    ThreadGroup threadGroup; // The threadgroup for all our threads
    PrintWriter logStream; // Where we send our logging output to
    * This is the Server() constructor. It must be passed a stream
    * to send log output to (may be null), and the limit on the number of
    * concurrent connections. It creates and starts a ConnectionManager
    * thread which enforces this limit on connections.
    public Server(OutputStream logStream, int maxConnections) {
    setLogStream(logStream);
    log("Starting server");
    threadGroup = new ThreadGroup("Server");
    connectionManager = new ConnectionManager(threadGroup, maxConnections);
    connectionManager.start();
    services = new Hashtable();
    * A public method to set the current logging stream. Pass null
    * to turn logging off
    public void setLogStream(OutputStream out) {
    if (out != null) logStream = new PrintWriter(new OutputStreamWriter(out));
    else logStream = null;
    /** Write the specified string to the log */
    protected synchronized void log(String s) {
    if (logStream != null) {
    logStream.println("[" + new Date() + "] " + s);
    logStream.flush();
    /** Write the specified object to the log */
    protected void log(Object o) { log(o.toString()); }
    * This method makes the server start providing a new service.
    * It runs the specified Service object on the specified port.
    public void addService(Service service, int port) throws IOException {
    Integer key = new Integer(port); // the hashtable key
    // Check whether a service is already on that port
    if (services.get(key) != null)
    throw new IllegalArgumentException("Port " + port + " already in use.");
    // Create a Listener object to listen for connections on the port
    Listener listener = new Listener(threadGroup, port, service);
    // Store it in the hashtable
    services.put(key, listener);
    // Log it
    log("Starting service " + service.getClass().getName() +
    " on port " + port);
    // Start the listener running.
    listener.start();
    * This method makes the server stop providing a service on a port.
    * It does not terminate any pending connections to that service, merely
    * causes the server to stop accepting new connections
    public void removeService(int port) {
    Integer key = new Integer(port); // hashtable key
    // Look up the Listener object for the port in the hashtable of services
    final Listener listener = (Listener) services.get(key);
    if (listener == null) return;
    // Ask the listener to stop
    listener.pleaseStop();
    // Remove it from the hashtable
    services.remove(key);
    // And log it.
    log("Stopping service " + listener.service.getClass().getName() +
    " on port " + port);
    * This nested class manages client connections for the server.
    * It maintains a list of current connections and enforces the
    * maximum connection limit. It creates a separate thread (one per
    * server) that sits around and wait()s to be notify()'d that a connection
    * has terminated. When this happens, it updates the list of connections.
    public class ConnectionManager extends Thread {
    int maxConnections; // The maximum number of allowed connections
    Vector connections; // The current list of connections
    * Create a ConnectionManager in the specified thread group to enforce
    * the specified maximum connection limit. Make it a daemon thread so
    * the interpreter won't wait around for it to exit.
    public ConnectionManager(ThreadGroup group, int maxConnections) {
    super(group, "ConnectionManager");
    this.setDaemon(true);
    this.maxConnections = maxConnections;
    connections = new Vector(maxConnections);
    log("Starting connection manager. Max connections: " + maxConnections);
    * This is the method that Listener objects call when they accept a
    * connection from a client. It either creates a Connection object
    * for the connection and adds it to the list of current connections,
    * or, if the limit on connections has been reached, it closes the
    * connection.
    synchronized void addConnection(Socket s, Service service) {
    // If the connection limit has been reached
    if (connections.size() >= maxConnections) {
    try {
    PrintWriter out = new PrintWriter(s.getOutputStream());
    // Then tell the client it is being rejected.
    out.println("Connection refused; " +
    "server has reached maximum number of clients.");
    out.flush();
    // And close the connection to the rejected client.
    s.close();
    // And log it, of course
    log("Connection refused to " + s.getInetAddress().getHostAddress() +
    ":" + s.getPort() + ": max connections reached.");
    } catch (IOException e) {log(e);}
    else {  // Otherwise, if the limit has not been reached
    // Create a Connection thread to handle this connection
    Connection c = new Connection(s, service);
    // Add it to the list of current connections
    connections.addElement(c);
    // Log this new connection
    log("Connected to " + s.getInetAddress().getHostAddress() +
    ":" + s.getPort() + " on port " + s.getLocalPort() +
    " for service " + service.getClass().getName());
    // And start the Connection thread running to provide the service
    c.start();
    * A Connection object calls this method just before it exits.
    * This method uses notify() to tell the ConnectionManager thread
    * to wake up and delete the thread that has exited.
    public synchronized void endConnection() { this.notify(); }
    /** Change the current connection limit */
    public synchronized void setMaxConnections(int max) { maxConnections=max; }
    * Output the current list of connections to the specified stream.
    * This method is used by the Control service defined below.
    public synchronized void printConnections(PrintWriter out) {
    for(int i = 0; i < connections.size(); i++) {
    Connection c = (Connection)connections.elementAt(i);
    out.println("CONNECTED TO " +
    c.client.getInetAddress().getHostAddress() + ":" +
    c.client.getPort() + " ON PORT " + c.client.getLocalPort()+
    " FOR SERVICE " + c.service.getClass().getName());
    * The ConnectionManager is a thread, and this is the body of that
    * thread. While the ConnectionManager methods above are called by other
    * threads, this method is run in its own thread. The job of this thread
    * is to keep the list of connections up to date by removing connections
    * that are no longer alive. It uses wait() to block until notify()'d by
    * the endConnection() method.
    public void run() {
    while(true) {  // infinite loop
    // Check through the list of connections, removing dead ones
    for(int i = 0; i < connections.size(); i++) {
    Connection c = (Connection)connections.elementAt(i);
    if (c != null && !c.isAlive()) {
    connections.removeElementAt(i);
                   try      {
                        //close server socket. SPR SVCge16539. Sachin Joshi.
                        Socket server = ProxyServer.Proxy.getServerSocket(c.client);                    
                        if (server != null)
                             server.close();
                        //close client socket.
                        if (c.client != null)
                             c.client.close();                    
                   catch (java.io.IOException e)     {
                        System.err.println("Error closing connection " + e);
                   catch (Exception e)     {
                        System.err.println("Cannot Establish Connection !! " + e);
    log("Connection to " + c.client.getInetAddress().getHostAddress() +
    ":" + c.client.getPort() + " closed.");
              System.out.println("Total Connections now = " + connections.size());
    // Now wait to be notify()'d that a connection has exited
    // When we wake up we'll check the list of connections again.
    try { synchronized(this) { this.wait(); } }
    catch(InterruptedException e) {}
    * This class is a subclass of Thread that handles an individual connection
    * between a client and a Service provided by this server. Because each
    * such connection has a thread of its own, each Service can have multiple
    * connections pending at once. Despite all the other threads in use, this
    * is the key feature that makes this a multi-threaded server implementation.
    public class Connection extends Thread {
    Socket client; // The socket to talk to the client through
    Service service; // The service being provided to that client
    * This constructor just saves some state and calls the superclass
    * constructor to create a thread to handle the connection. Connection
    * objects are created by Listener threads. These threads are part of
    * the server's ThreadGroup, so all Connection threads are part of that
    * group, too.
    public Connection(Socket client, Service service) {
    super("Server.Connection:" + client.getInetAddress().getHostAddress() +
    ":" + client.getPort());
    this.client = client;
    this.service = service;
    * This is the body of each and every Connection thread.
    * All it does is pass the client input and output streams to the
    * serve() method of the specified Service object. That method
    * is responsible for reading from and writing to those streams to
    * provide the actual service. Recall that the Service object has been
    * passed from the Server.addService() method to a Listener object
    * to the ConnectionManager.addConnection() to this Connection object,
    * and is now finally getting used to provide the service.
    * Note that just before this thread exits it calls the
    * ConnectionManager.endConnection() method to wake up the
    * ConnectionManager thread so that it can remove this Connection
    * from its list of active connections.
    public void run() {
    try {
    InputStream in = client.getInputStream();
    OutputStream out = client.getOutputStream();
    // service.serve(in, out);
    ((ProxyServer.Proxy)service).serve(in, out,client);
    catch (IOException e) {log(e);}
    finally { connectionManager.endConnection(); }
    * Here is the Service interface that we have seen so much of.
    * It defines only a single method which is invoked to provide the service.
    * serve() will be passed an input stream and an output stream to the client.
    * It should do whatever it wants with them, and should close them before
    * returning.
    * All connections through the same port to this service share a single
    * Service object. Thus, any state local to an individual connection must
    * be stored in local variables within the serve() method. State that should
    * be global to all connections on the same port should be stored in
    * instance variables of the Service class. If the same Service is running
    * on more than one port, there will typically be different Service instances
    * for each port. Data that should be global to all connections on any port
    * should be stored in static variables.
    * Note that implementations of this interface must have a no-argument
    * constructor if they are to be dynamically instantiated by the main()
    * method of the Server class.
    public interface Service {
    public void serve(InputStream in, OutputStream out) throws IOException;     
         }

  • Query to find out which process consuming more cpu?

    Hi All,
    some one please tell me the query to find out which process is consuming more
    cpu resources?
    Thanks and Regards
    Srikanth

    Use V$SESSTAT to determine which sessions are using most CPU, and investigate what SQL these users/sessions are executing:
    SQL> select ss.sid, se.command, ss.value CPU, se.username, se.program
    from v$sesstat ss, v$session se
    where ss.statistic# in
    (select statistic#
    from v$statname
    where name = 'CPU used by this session')
    and se.sid=ss.sid
    order by ss.value desc;

  • REPORT TAKING MORE CPU UTILIZATION

    Hello Experts,
    my following report is of sales order report it gives me an output in less than 250 seconds,
    But taking 80 percentage CPU time so tell me how to overcome this problem ??
    <b>&----
    *& Report  ZMSL_SALES_ORDER_REPORT
    REPORT  ZMSL_SALES_ORDER_REPORT.
    DEFINE: M_FIELDCAT.
      ADD 1 TO LS_FIELDCAT-COL_POS.
      LS_FIELDCAT-FIELDNAME = &1.
      LS_FIELDCAT-SELTEXT_L = &2.
      LS_FIELDCAT-OUTPUTLEN = &3.
      LS_FIELDCAT-TABNAME = 'gt_final_data'.
      APPEND LS_FIELDCAT TO FELD_CAT.
    END-OF-DEFINITION.
    *==================Start of Datebase tables Declaration=================
    TABLES : VBAK, "Sales Document: Header Data
             VBAP, "Sales Document: Item Data
             MARA, "Matrial Master
             VBEP, "Sales Document: Schedule Line Data
             VBPA, "Sales Document: Partner
             TVROT,
             YMSLT_MAIL_ID.
    *=================End of Datebase tables Declaration====================
    *==================Start of Virable  ALV  declaration=================
    **=============================
    TYPE POOLS
    *=============================
    TYPE-POOLS: SLIS.
    *=============================
    *FIELD CATALOG DECLARATION
    *=============================
    CONSTANTS : CO_FORMNAME_TOP_OF_PAGE  TYPE SLIS_FORMNAME
                                         VALUE 'TOP_OF_PAGE'.
    DATA : G_TABNAME_HEADER TYPE SLIS_TABNAME,
           G_TABNAME_ITEM   TYPE SLIS_TABNAME.
    DATA:  FELD_CAT TYPE SLIS_T_FIELDCAT_ALV," WITH HEADER LINE ,
           ALV_LAYOUT   TYPE SLIS_LAYOUT_ALV,
           T_EVENTS           TYPE SLIS_T_EVENT,
           G_SAVE(1) TYPE C,
           G_VARIANT LIKE DISVARIANT,
           GX_VARIANT LIKE DISVARIANT,
           EVENTS   TYPE SLIS_T_EVENT,
           G_EXIT(1) TYPE C,
           LAYOUT   TYPE SLIS_LAYOUT_ALV,
           ALV_PRINT        TYPE SLIS_PRINT_ALV,
           ALV_DETAIL_FUNC(30),
          EVENTS   TYPE SLIS_T_EVENT,
           T_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    RANGES : R_PARVW FOR VBPA-PARVW.
    *=================End of Virable  tables Declaration====================
    *==================Start of Selection Screen Declaration================
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN BEGIN OF BLOCK VAR WITH FRAME TITLE VARIANT.
    PARAMETERS     : P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK VAR.
    SELECTION-SCREEN :BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS : S_VKORG FOR VBAK-VKORG OBLIGATORY, " Sales Org.
                     S_VKBUR FOR VBAK-VKBUR, " Sales Office
                     S_VKGRP FOR VBAK-VKGRP, " Sales Group
                     S_VTWEG FOR VBAK-VTWEG. " Distribution Channel
    SELECTION-SCREEN :END OF BLOCK B2.
    SELECTION-SCREEN :BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    SELECT-OPTIONS : S_KUNNR FOR VBAK-KUNNR, "Customer Number
                     S_VBELN FOR VBAK-VBELN, "Sales Order Number
                     S_ERDAT FOR VBAK-ERDAT, "OBLIGATORY, "Sales Order Date
                     S_AUGRU FOR VBAK-AUGRU, "Order Reason
                     S_BSTNK FOR VBAK-BSTNK, "PO Number
                     S_AUART FOR VBAK-AUART. "Sales order type
    SELECTION-SCREEN :END OF BLOCK B3.
    SELECTION-SCREEN :BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-004.
    SELECT-OPTIONS : S_WERKS FOR VBAP-WERKS,  "plant,
                     S_MATNR FOR VBAP-MATNR, " Matrial Code
                     S_PSTYV FOR VBAP-PSTYV, "Sales Order Item cat.
                     S_EDATU FOR VBEP-EDATU,  "Conformatin Date
                     S_REQDAT FOR VBAP-ZZCUST_REQDAT. "Req.Del Date
    SELECTION-SCREEN :END OF BLOCK B4.
    SELECTION-SCREEN :BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT-005.
    SELECT-OPTIONS : S_ZE FOR  VBPA-KUNNR NO INTERVALS NO-EXTENSION , "Partner Function
                     S_ZS FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
                     S_ZA FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
                     S_ZR FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
                     S_ZI FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION. "Partner Function
    *FOR VBPA-KUNNR MATCHCODE OBJECT ZSMR ,
    ***SELECT-OPTIONS : S_ZE FOR  VBPA-PARVW NO INTERVALS NO-EXTENSION , "Partner Function
                    S_ZS FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
                    S_ZA FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
                    S_ZR FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
                    S_ZI FOR VBPA-PARVW NO INTERVALS NO-EXTENSION. "Partner Function
    SELECTION-SCREEN :END OF BLOCK B5.
    SELECTION-SCREEN : BEGIN OF BLOCK B6 WITH FRAME TITLE TEXT-006.
    PARAMETER :  P_SCREEN RADIOBUTTON GROUP RTYP DEFAULT 'X' USER-COMMAND
                                                     UCOMM ,
                 P_FILE  RADIOBUTTON GROUP RTYP,
                 P_MAIL  RADIOBUTTON GROUP RTYP.
    SELECTION-SCREEN :END OF BLOCK B6.
    SELECTION-SCREEN : BEGIN OF BLOCK B7 WITH FRAME TITLE TEXT-007.
    PARAMETER :  P_PEN RADIOBUTTON GROUP RE1 DEFAULT 'X' USER-COMMAND
                                                     UCOMM , " Pending Sales order
                 P_ALL  RADIOBUTTON GROUP RE1,  " ALL Sales order
                 P_BLOCK  RADIOBUTTON GROUP RE1.  " Blocked Sales order
                P_DELE   RADIOBUTTON GROUP RE1.  " Delevered Sales order
    SELECTION-SCREEN :END OF BLOCK B7.
    SELECTION-SCREEN : END OF BLOCK B1.
    *=================End of Selection Screen Declaration===================
    *==================Start of Internal table Declaration==================
    Internal table for vbak
    DATA : BEGIN OF GT_VBAK OCCURS 0 ,
                VBELN             LIKE VBAK-VBELN , " Sales Document Number
                ERDAT             LIKE VBAK-ERDAT , " Order Date
                AUART             LIKE VBAK-AUART,  "Sales Document Type
                VTWEG             LIKE VBAK-VTWEG,  "Distribution Channel
                SPART             LIKE VBAK-SPART,  "Division
                KNUMV             LIKE VBAK-KNUMV ,  "Number of the document condition
                BSTNK             LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
                BSTDK             LIKE VBAK-BSTDK,  "Customer purchase order date
                KUNNR             LIKE VBAK-KUNNR,  " Customer Code
                ZOA_RECP_PLAN_DT  LIKE VBAK-ZOA_RECP_PLAN_DT, "Order receipt at plant
           END OF GT_VBAK.
    Internal table for VBAP
    DATA : BEGIN OF GT_VBAP OCCURS 0,
              VBELN LIKE VBAP-VBELN, " Sales Document Number
              POSNR LIKE VBAP-POSNR, " Sales Doc. Line item number
              MATNR LIKE VBAP-MATNR,
              ABGRU LIKE VBAP-ABGRU, "Reason for rejection
              MEINS LIKE VBAP-MEINS,  "Base Unit of Measure
              FAKSP LIKE VBAP-FAKSP,
              NETWR  LIKE VBAP-NETWR, " Net Value
              KWMENG LIKE VBAP-KWMENG, " Order Quantity
              WERKS LIKE VBAP-WERKS, "PLANT
              LGORT LIKE VBAP-LGORT, "S.Loc
              ROUTE LIKE VBAP-ROUTE, " Route
              ZZWIDTH LIKE VBAP-ZZWIDTH, " widht
              ZZKDMAT LIKE VBAP-ZZKDMAT, " customer Matrial
              ZZBRAND LIKE VBAP-ZZBRAND, " bRAND
              ZZSPLDIA LIKE VBAP-ZZSPLDIA, "Spool Diameter
              ZZCUST_REQDAT LIKE VBAP-ZZCUST_REQDAT, " REquested Date
              ZZCOATING LIKE VBAP-ZZCOATING,
              ZZWEIGHT LIKE VBAP-ZZWEIGHT,
              ZZWEIGHT_UMO LIKE VBAP-ZZWEIGHT_UMO,
             END OF GT_VBAP.
    Internal table for VBEP
    DATA : BEGIN OF GT_VBEP OCCURS 0,
              VBELN LIKE VBEP-VBELN, " Sales Doc. Number
              POSNR LIKE VBEP-POSNR, " Sales Doc. Item Number
              ETENR LIKE VBEP-ETENR, "Delivery Schedule Line Number
              EDATU LIKE VBEP-EDATU, "Schedule line date
             END OF GT_VBEP.
    Internal table for VBPA
    DATA : BEGIN OF GT_VBPA OCCURS 0,
             VBELN LIKE VBAP-VBELN, "Sales Document Number
             POSNR LIKE VBAP-POSNR, "Sales Document Item Number
             PARVW LIKE VBPA-PARVW, "Partner Function
             KUNNR LIKE VBPA-KUNNR, " Customer Number
          END OF GT_VBPA.
    Internal table for VBKD
    DATA : BEGIN OF GT_VBKD OCCURS 0,
            VBELN LIKE VBKD-VBELN , " Sales Documet number
            KDGRP LIKE VBKD-KDGRP, " Custoemr Group
            INCO1 LIKE VBKD-INCO1, "Incoterms (Part 1)
            INCO2 LIKE VBKD-INCO2, "Incoterms (Part 2)
            ZTERM LIKE VBKD-ZTERM, " Payment Term
            STCUR LIKE VBKD-STCUR, " Exchang Rate
         END OF GT_VBKD.
    Internal table VBFA
    DATA : BEGIN OF GT_VBFA OCCURS 0 ,
             VBELV   LIKE VBFA-VBELV, " Preceding sales and distribution document
             POSNV   LIKE VBFA-POSNV, "Preceding item of an SD document
             VBELN   LIKE VBFA-VBELN, "Subsequent sales and distribution document
             POSNN   LIKE VBFA-POSNN, "Subsequent item of an SD document
             VBTYP_N LIKE VBFA-VBTYP_N, "Document category of subsequent document
             RFMNG   LIKE VBFA-RFMNG,    "Referenced quantity in base unit of measure
           END OF GT_VBFA.
    Internal table for KONV
    DATA :  BEGIN OF GT_KONV OCCURS 0,
                  KNUMV LIKE KONV-KNUMV, "Number of the document condition
                  KPOSN LIKE KONV-KPOSN, "Condition item number
                  KSCHL LIKE KONV-KSCHL , "Cond Type.
                  KBETR LIKE KONV-KBETR, " Rate per KG
                  WAERS LIKE KONV-WAERS, "currency
                  KWERT LIKE KONV-KWERT, "Condition value
              END OF GT_KONV.
    Internal table for MSKA,
    DATA  : BEGIN OF GT_MSKA OCCURS 0,
               MATNR LIKE MSKA-MATNR, "Matrial
               WERKS LIKE MSKA-WERKS, "PLANT
               LGORT LIKE MSKA-LGORT, "S. Loc
               CHARG  LIKE MSKA-CHARG,"Batch Number
               SOBKZ LIKE MSKA-SOBKZ, "Special Stock Indicator
               VBELN LIKE MSKA-VBELN , "Sales Doc Number
               POSNR LIKE MSKA-POSNR, "Sales Doc Item Number
               KALAB LIKE MSKA-KALAB, "Unrestricted-Use Stock
               KAINS LIKE MSKA-KAINS, " Stock in Quality Inspection
            END OF GT_MSKA.
    Internal table for MARD
    DATA : BEGIN OF GT_MARD OCCURS 0 ,
              MATNR LIKE MARD-MATNR, "Matrial
              WERKS LIKE MARD-WERKS, "PLANT
              LGORT LIKE MARD-LGORT, "S. Loc
              LABST LIKE MARD-LABST, "Valuated Unrestricted-Use Stock
           END OF GT_MARD.
    Internal table for KNA1
    DATA : BEGIN OF GT_KNA1 OCCURS 0,
               KUNNR LIKE KNA1-KUNNR , " Customer Number
               NAME1 LIKE KNA1-NAME1,  "Customer Name
               NAME2 LIKE KNA1-NAME2,  " Customer Name
               ORT01 LIKE KNA1-ORT01, "City
            END OF GT_KNA1.
    DATA: BEGIN OF GT_KNA1_1 OCCURS 0,
              KUNNR LIKE KNA1-KUNNR , " Customer Number
              NAME1 LIKE KNA1-NAME1,  "Customer Name
             ORT01 LIKE KNA1-ORT01,
           END OF GT_KNA1_1.
    Internal table for KNVV
    DATA : BEGIN OF GT_KNVV OCCURS 0,
                KUNNR LIKE KNVV-KUNNR , " Customer Number
                KLABC LIKE KNVV-KLABC, " Custoemr Class
           END OF GT_KNVV.
    Internal table for MAKT,
    DATA : BEGIN OF GT_MAKT OCCURS 0,
             MATNR LIKE MAKT-MATNR,  "Matrial
             SPRAS LIKE MAKT-SPRAS,
             MAKTX LIKE MAKT-MAKTX, "Matrial DESC
             MAKTG LIKE MAKT-MAKTG,
          END OF GT_MAKT.
    Internal table for MVKE
    DATA : BEGIN OF GT_MVKE OCCURS 0 ,
                MATNR LIKE MVKE-MATNR,  "Matrial
                MVGR1 LIKE MVKE-MVGR1, " Matrial Group
          END OF GT_MVKE.
    Internal table for TVM1T
    DATA : BEGIN OF GT_TVM1T OCCURS 0 ,
                 SPRAS LIKE TVM1T-SPRAS,
                 MVGR1 LIKE TVM1T-MVGR1, " Matrial Group
                 BEZEI LIKE TVM1T-BEZEI, "  Matrial Group DESC
          END OF GT_TVM1T.
    Internal table for TSPAT
    DATA : BEGIN OF GT_TSPAT OCCURS 0,
                SPRAS LIKE TSPAT-SPRAS,
                SPART LIKE VBAK-SPART,  "Division
                VTEXT LIKE TSPAT-VTEXT, "Division Desc
           END OF GT_TSPAT.
    Internal table for TVTWT
    DATA : BEGIN OF GT_TVTWT OCCURS 0 ,
            SPRAS LIKE TVTWT-SPRAS,
            VTWEG LIKE VBAK-VTWEG, "  Distribution Channel
            VTEXT LIKE TVTWT-VTEXT, "Distribution Channel Desc
           END OF GT_TVTWT.
    Internal table for TVAKT
    DATA : BEGIN OF GT_TVAKT OCCURS 0,
              SPRAS LIKE TVAKT-SPRAS,
              AUART LIKE VBAK-AUART,  "Sales Document Type
              BEZEI LIKE TVAKT-BEZEI, "sALES dOC TYPE Description
           END OF GT_TVAKT .
    Internal table for T151t
    DATA: BEGIN OF GT_VBUP OCCURS 0,
              VBELN LIKE VBUP-VBELN,
              POSNR LIKE VBUP-POSNR,
              GBSTA LIKE VBUP-GBSTA,
          END OF GT_VBUP.
    DATA : BEGIN OF GT_T151T OCCURS 0,
              SPRAS LIKE T151T-SPRAS,
              KDGRP LIKE VBKD-KDGRP, " Custoemr Group
              KTEXT LIKE T151T-KTEXT, " Custoemr Group Desc
          END OF GT_T151T.
    DATA : BEGIN OF GT_TVROT OCCURS 0,
              SPRAS LIKE TVROT-SPRAS,
              ROUTE LIKE TVROT-ROUTE, " Route code
              BEZEI LIKE TVROT-BEZEI , " Route Desc
           END OF GT_TVROT.
    DATA : BEGIN OF GT_T052U OCCURS 0,
              SPRAS LIKE T052U-SPRAS,
              ZTERM LIKE T052U-ZTERM, " Payment terms
              TEXT1 LIKE T052U-TEXT1, " text
           END OF GT_T052U.
    DATA: BEGIN OF GT_VBUK OCCURS 0,
             VBELN LIKE VBUK-VBELN,
             WBSTK LIKE VBUK-WBSTK,
          END OF GT_VBUK.
    *-------fINAL iNTERNAL TABLE FOR OUTPUT
    DATA : BEGIN OF GT_FINAL_DATA OCCURS 0,
                KUNNR             LIKE VBAK-KUNNR, " cUSTOMER CODE
                NAME(70)          TYPE C, " cUSTOMER NAME
                ORT01             LIKE KNA1-ORT01, "cITY
                S_KUNNR           LIKE VBAK-KUNNR, " cUSTOMER CODE
                S_NAME(70)        TYPE C, " cUSTOMER NAME
                S_ORT01           LIKE KNA1-ORT01, "cITY
                KLABC             LIKE KNVV-KLABC, " Custoemr Class
                VBELN(70)         TYPE C, "   LIKE VBAK-VBELN, "sALES oRDER nUMBER
                POSNR             LIKE VBAP-POSNR, "SALES ORDER LINE NUMBER
                INCO1             LIKE VBKD-INCO1, "Incoterms (Part 1)
                INCO2             LIKE VBKD-INCO2, "Incoterms (Part 2)
                KALAB             LIKE MSKA-KALAB, "Unrestricted-Use Stock
                KAINS             LIKE MSKA-KAINS, " Stock in Quality Inspection
                LABST             LIKE MARD-LABST, "Valuated Unrestricted-Use Stock
                ERDAT             LIKE VBAK-ERDAT , " Order Date
                MATNR             LIKE MAKT-MATNR,  "Matrial
                MAKTX             LIKE MAKT-MAKTX, "Matrial DESC
                MAKTG             LIKE MAKT-MAKTG, "Matrial DESC
                ZZKDMAT           LIKE VBAP-ZZKDMAT, "Customter Mat. Number
                ABGRU             LIKE VBAP-ABGRU, " Reason for rejection
                COLOR(20)         TYPE C,          "Color
                COMPLEX(20)       TYPE C,         "Complex
                WIDTH(10)         TYPE C,          "Width
                KBETR             LIKE KONV-KBETR, " Rate per KG
                WAERS             LIKE KONV-WAERS, "currency
                STCUR             LIKE VBKD-STCUR, " Exchang Rate
                MEINS             LIKE VBAP-MEINS,  "Base Unit of Measure
                KWMENG            LIKE VBAP-KWMENG, " Order Quantity
                RFMNG             LIKE VBFA-RFMNG,    "Referenced quantity in base unit of measure
                BAL_QTY           LIKE VBFA-RFMNG, " Balance QTY
                EDATU             LIKE VBEP-EDATU, "Schedule line date
                DAYS(5)          TYPE C, " Sch.Delay
                BSTNK             LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
                BSTDK             LIKE VBAK-BSTDK,  "Customer purchase order date
                VTWEG             LIKE VBAK-VTWEG,  "Distribution Channel
                SPART             LIKE VBAK-SPART,  "Division
                DIST_NAME         LIKE TVTWT-VTEXT, "Distribution Channels NAME
                DIV_NAME          LIKE TSPAT-VTEXT, "Sales Divisions NAME
                ZA_KUNNR          LIKE KNA1-KUNNR,
                ZA_NAME               LIKE KNA1-NAME1,
                ZE_KUNNR          LIKE KNA1-KUNNR,
                ZE_NAME               LIKE KNA1-NAME1,
                ZI_KUNNR          LIKE KNA1-KUNNR,
                ZI_NAME               LIKE KNA1-NAME1,
                ZR_KUNNR          LIKE KNA1-KUNNR,
                ZR_NAME               LIKE KNA1-NAME1,
                ZS_KUNNR          LIKE KNA1-KUNNR,
                ZS_NAME               LIKE KNA1-NAME1,
                MVGR1(20)         TYPE C          , " Matrial Group
                B_VALUE           LIKE KONV-KWERT, "bASIC value
                EX_VALUE          LIKE KONV-KWERT, "eXCISE value
                EC_VALUE          LIKE KONV-KWERT, "ecess value
                HE_VALUE          LIKE  KONV-KWERT, "hcess value
                VAT_VALUE         LIKE KONV-KWERT, "VAT value
                CST_VALUE         LIKE KONV-KWERT, "CST
                F_VALUE           LIKE KONV-KWERT, "fREIGJT
                C_VALUE           LIKE KONV-KWERT, "cOMISSION
                KDGRP(70)         TYPE C, " Custoemr Group
                NETWR             LIKE VBAP-NETWR, " Net Value
                INR               LIKE VBAP-NETWR, " inr Net Value
                AUART             LIKE VBAK-AUART,  "Sales Document Type
                BEZEI             LIKE TVAKT-BEZEI, "SALES DOC TYPE DESC
                ZOA_RECP_PLAN_DT  LIKE VBAK-ZOA_RECP_PLAN_DT, "Order receipt at plant
                ZZCUST_REQDAT     LIKE VBAP-ZZCUST_REQDAT, " REquested Date
                ROUTE             LIKE VBAP-ROUTE, " Route
                ROUTE_NAME        LIKE  TVROT-BEZEI , "Route name
                ZZBRAND           LIKE VBAP-ZZBRAND, " bRAND
                ZZSPLDIA          LIKE VBAP-ZZSPLDIA, "Spool Diameter
                ZTERM             LIKE VBKD-ZTERM, " Payment Term
                Z_TERM_TEXT(50)   TYPE C, "Payment Terms Text
                Z001(50)          TYPE C, "text
                Z002(50)          TYPE C, "text
                Z003(50)          TYPE C, "text
                Z004(50)          TYPE C, "text
                ZI_001(50)        TYPE C, "text
                ZI_002(50)        TYPE C, "text
                ZZCOATING(20)     TYPE C,
                ZZWEIGHT          LIKE VBAP-ZZWEIGHT,
                ZZWEIGHT_UMO      LIKE VBAP-ZZWEIGHT_UMO,
                WBSTK             LIKE VBUK-WBSTK,
                T_NETWR           LIKE VBAP-NETWR, " Net Value
                FAKSP             LIKE VBAP-FAKSP,
           END OF GT_FINAL_DATA.
    *****Mail Data Decleration.
    DATA : BEGIN OF MAIL_TAB OCCURS 0 ,
                ZE_NAME               LIKE KNA1-NAME1,
                ZS_NAME               LIKE KNA1-NAME1,
                NAME              LIKE KNA1-NAME1,
                ORT01             LIKE KNA1-ORT01, "cITY
                S_NAME            LIKE KNA1-NAME1,
                S_ORT01           LIKE KNA1-ORT01, "cITY
                KLABC             LIKE KNVV-KLABC, " Custoemr Class
                VBELN             LIKE VBAK-VBELN, "sALES oRDER nUMBER
                POSNR             LIKE VBAP-POSNR, "SALES ORDER LINE NUMBER
                ERDAT             LIKE VBAK-ERDAT , " Order Date
                MATNR             LIKE MAKT-MATNR,  "Matrial
                MAKTX             LIKE MAKT-MAKTX, "Matrial DESC
                ZZKDMAT           LIKE VBAP-ZZKDMAT, "Customter Mat. Number
                COLOR(20)         TYPE C,          "Color
                COMPLEX(20)       TYPE C,         "Complex
                WIDTH(10)         TYPE C,          "Width
                KBETR             LIKE KONV-KBETR, " Rate per KG
                WAERS             LIKE KONV-WAERS, "currency
                MEINS             LIKE VBAP-MEINS,  "Base Unit of Measure
                KWMENG            LIKE VBAP-KWMENG, " Order Quantity
                BAL_QTY           LIKE VBFA-RFMNG, " Balance QTY
                EDATU             LIKE VBEP-EDATU, "Schedule line date
                DAYS(5)          TYPE C, " Sch.Delay
                BSTNK             LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
                BSTDK             LIKE VBAK-BSTDK,  "Customer purchase order date
                ZA_NAME               LIKE KNA1-NAME1,
                ZI_NAME               LIKE KNA1-NAME1,
                ZR_NAME               LIKE KNA1-NAME1,
                MVGR1(20)         TYPE C          , " Matrial Group
                ZZCUST_REQDAT     LIKE VBAP-ZZCUST_REQDAT, " REquested Date
                ZZBRAND           LIKE VBAP-ZZBRAND, " bRAND
           END OF MAIL_TAB.
    DATA : IT_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
    DATA : SM_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
    DATA : SP_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
    DATA:   IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
            T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
            T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            W_CNT TYPE I,
            W_SENT_ALL(1) TYPE C,
            W_DOC_DATA LIKE SODOCCHGI1,
            GD_ERROR    TYPE SY-SUBRC,
            GD_RECIEVER TYPE SY-SUBRC.
    DATA STR_VAL TYPE STRING.
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    CONSTANTS:
        CON_TAB  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
        CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
    DATA: GT_VBAK_KNA1 LIKE GT_VBAK OCCURS 0 WITH HEADER LINE,
          GT_VBAP_VBPA LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
          GT_VBAP_MAKT LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
          GT_MVKE_TVM1T LIKE GT_MVKE OCCURS 0 WITH HEADER LINE,
          GT_VBAP_MSKA LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
          GT_VBPA_KNA1 LIKE GT_VBPA OCCURS 0 WITH HEADER LINE,
          GT_VBFA_VBUK LIKE GT_VBFA OCCURS 0 WITH HEADER LINE,
          GT_VBAP_INOB LIKE GT_VBAP OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF GT_INOB  OCCURS 0.
              INCLUDE STRUCTURE INOB.
    DATA : END OF GT_INOB.
    DATA: BEGIN OF GT_YCAT_PARAMS OCCURS 0,
           KEY01 TYPE YYKEY01_C10,
           KEY02 TYPE YYKEY02_C16,
           KEY03 TYPE YYKEY03_C20,
           SRNO TYPE YYSRNO_N4,
           VALUE TYPE YYVALUE_C25,
          END OF GT_YCAT_PARAMS.
    DATA: BEGIN OF GT_CABN OCCURS 0,
           ATINN LIKE CABN-ATINN,
           ATNAM LIKE CABN-ATNAM,
          END OF GT_CABN.
    DATA: BEGIN OF GT_AUSP OCCURS 0,
           OBJEK LIKE AUSP-OBJEK,
           ATINN LIKE AUSP-ATINN,
           ATWRT LIKE AUSP-ATWRT,
          END OF GT_AUSP.
    DATA: BEGIN OF GT_CUOBJ OCCURS 0,
          CUOBJ(18) TYPE C,
            CUOBJ TYPE OBJNUM,
          END OF GT_CUOBJ.
    DATA: BEGIN OF GT_CAWN OCCURS 0,
            ATINN LIKE CAWN-ATINN,
            ATZHL LIKE CAWN-ATZHL,
            ATWRT LIKE CAWN-ATWRT,
         END OF GT_CAWN.
    DATA: BEGIN OF GT_CAWNT OCCURS 0,
            ATINN LIKE CAWNT-ATINN,
            ATZHL LIKE CAWNT-ATZHL,
            SPRAS LIKE CAWNT-SPRAS,
            ATWTB LIKE CAWNT-ATWTB,
         END OF GT_CAWNT.
                          START-OF-SELECTION                             *
    INITIALIZATION.
      VARIANT = 'Display Options'.
    RB1 = 'X'.
    REPNAME = SY-REPID.
      PERFORM BUILD_EVENTTAB USING EVENTS[].
      PERFORM BUILD_LAYOUT .
      PERFORM INITIALIZE_VARIANT.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
      PERFORM F4_FOR_VARIANT.
    AT SELECTION-SCREEN.
      PERFORM PAI_OF_SELECTION_SCREEN.
    END-OF-SELECTION.
      PERFORM SELECT_DATA.
      PERFORM PROCESS_DATA.
      PERFORM FILTER_PATNER_DATA.
      IF P_FILE = 'X'.
        PERFORM OUT_PUT_FILE.
      ELSEIF P_SCREEN = 'X'.
        PERFORM FILED_CAT_LOG.
        PERFORM CREATE_ALV_LAYOUT.
    PERFORM fill_events.
        PERFORM OUT_PUT_DATA.
      ELSEIF P_MAIL = 'X'.
        PERFORM MAIL_RPT.
      ENDIF.
    *=================Start of Internal table Declaration===================
    *===========
    *&      Form  SELECT_DATA
          sELECTING DATA FROM dATA bASE
    FORM SELECT_DATA .
      REFRESH R_PARVW.
      R_PARVW-SIGN = 'I'.
      R_PARVW-OPTION = 'EQ'.
      IF  NOT  S_ZE[] IS INITIAL.
        R_PARVW-LOW = S_ZE-LOW.
        APPEND R_PARVW.
      ENDIF.
      IF  NOT  S_ZS[] IS INITIAL.
        R_PARVW-LOW = S_ZS-LOW.
        APPEND R_PARVW.
      ENDIF.
      IF  NOT  S_ZA[] IS INITIAL.
        R_PARVW-LOW = S_ZA-LOW.
        APPEND R_PARVW.
      ENDIF.
      IF  NOT  S_ZR[] IS INITIAL.
        R_PARVW-LOW = S_ZR-LOW.
        APPEND R_PARVW.
      ENDIF.
      IF  NOT  S_ZI[] IS INITIAL.
        R_PARVW-LOW = S_ZI-LOW.
        APPEND R_PARVW.
      ENDIF.
    R_PARVW-LOW = 'SH'.
    APPEND R_PARVW.
    sELECTING DATA FROM VBAK TABLE INTO INTERNAL TABLE GT_VBAK
      SELECT  VBELN ERDAT AUART
              VTWEG SPART KNUMV
              BSTNK BSTDK KUNNR
               ZOA_RECP_PLAN_DT
        INTO TABLE GT_VBAK
        FROM VBAK
              WHERE VBELN IN S_VBELN
              AND ERDAT IN S_ERDAT
              AND VBTYP = 'C'
              AND AUART IN S_AUART
              AND AUGRU IN S_AUGRU
              AND VKORG IN S_VKORG
              AND VTWEG IN S_VTWEG
              AND VKGRP IN S_VKGRP
              AND VKBUR IN S_VKBUR
              AND BSTNK  IN S_BSTNK
              AND KUNNR IN S_KUNNR.
      SORT GT_VBAK[] BY VBELN.
      IF NOT GT_VBAK[] IS INITIAL.
    Selecting data from VBAP into Internal tabl gt_vbap
        IF P_BLOCK = 'X' .
          SELECT  VBELN   POSNR
                  MATNR  ABGRU
                  MEINS   FAKSP
                  NETWR KWMENG
                  WERKS   LGORT
                  ROUTE ZZWIDTH
                  ZZKDMAT ZZBRAND
                  ZZSPLDIA ZZCUST_REQDAT
                  ZZCOATING ZZWEIGHT
                  ZZWEIGHT_UMO
            INTO TABLE GT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN GT_VBAK
            WHERE VBELN = GT_VBAK-VBELN
            AND MATNR IN S_MATNR
            AND ABGRU <> ''
            AND WERKS IN S_WERKS
        ELSEIF P_PEN = 'X'.
          SELECT  VBELN   POSNR
                  MATNR  ABGRU
                  MEINS   FAKSP
                  NETWR KWMENG
                  WERKS   LGORT
                  ROUTE ZZWIDTH
                  ZZKDMAT ZZBRAND
                  ZZSPLDIA ZZCUST_REQDAT
                  ZZCOATING ZZWEIGHT
                  ZZWEIGHT_UMO
            INTO TABLE GT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN GT_VBAK
            WHERE VBELN = GT_VBAK-VBELN
            AND MATNR IN S_MATNR
            AND FAKSP <> '10'
            AND WERKS IN S_WERKS.
        ELSE.
             SELECT  VBELN   POSNR
                  MATNR  ABGRU
                  MEINS   FAKSP
                  NETWR KWMENG
                  WERKS   LGORT
                  ROUTE ZZWIDTH
                  ZZKDMAT ZZBRAND
                  ZZSPLDIA ZZCUST_REQDAT
                  ZZCOATING ZZWEIGHT
                  ZZWEIGHT_UMO
            INTO TABLE GT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN GT_VBAK
            WHERE VBELN = GT_VBAK-VBELN
            AND MATNR IN S_MATNR
            AND WERKS IN S_WERKS.
        ENDIF.
      ENDIF.
    IF P_PEN = 'X'.
       SELECT VBELN POSNR GBSTA FROM VBUP INTO TABLE GT_VBUP
              FOR ALL ENTRIES IN GT_VBAP
              WHERE VBELN = GT_VBAP-VBELN AND  POSNR = GT_VBAP-POSNR AND
              GBSTA <> 'C'.
       SORT GT_VBUP[] BY VBELN.
       LOOP AT GT_VBAP.
         READ TABLE GT_VBUP WITH KEY VBELN = GT_VBAP-VBELN
                                     POSNR = GT_VBAP-POSNR.
         IF SY-SUBRC <> 0.
           DELETE GT_VBAP.
         ENDIF.
         CLEAR GT_VBUP.
       ENDLOOP.
        LOOP AT GT_VBAK.
          READ TABLE GT_VBAP WITH KEY VBELN = GT_VBAK-VBELN.
          IF SY-SUBRC <> 0.
            DELETE GT_VBAK.
          ENDIF.
          CLEAR GT_VBAP.
        ENDLOOP.
    ENDIF.
      IF NOT GT_VBAP[] IS INITIAL.
        GT_VBAP_INOB[] = GT_VBAP[].
    SORT GT_VBAP_INOB[] BY MATNR.
    DELETE ADJACENT DUPLICATES FROM GT_VBAP_INOB COMPARING MATNR.
    SELECT * FROM INOB INTO TABLE GT_INOB
         WHERE KLART = '023'
             AND  OBTAB = 'MARA'.
    IF SY-SUBRC = 0.
       SELECT  KEY01 KEY02 KEY03 SRNO VALUE
                     INTO TABLE Gt_YCAT_PARAMS
                     FROM  YCAT_PARAMS
                                 WHERE KEY01 = 'CHAR_NAME'
                                 AND   KEY02 = 'ATNAM'
                                 AND  ( KEY03 = 'COLOR' OR  KEY03 = 'COMPLEX' )
                                 AND   SRNO  = '0001'.
    SELECT ATINN ATNAM INTO TABLE GT_CABN FROM CABN
                              WHERE ( ATNAM = 'COLOUR' OR ATNAM = 'COMPLEX' ).
    LOOP AT GT_INOB.
    GT_CUOBJ-CUOBJ = GT_INOB-CUOBJ.
    APPEND GT_CUOBJ.
    ENDLOOP.
    SELECT OBJEK ATINN ATWRT
          INTO TABLE GT_AUSP FROM AUSP
             FOR ALL ENTRIES IN GT_CUOBJ
              WHERE OBJEK = GT_CUOBJ-CUOBJ.
             AND   ATINN = L_ATINN.
    SELECT ATINN ATZHL ATWRT INTO TABLE GT_CAWN
            FROM CAWN FOR ALL ENTRIES IN GT_AUSP
              WHERE ATWRT = GT_AUSP-ATWRT.
    SELECT ATINN ATZHL SPRAS ATWTB INTO TABLE GT_CAWNT
           FROM CAWNT FOR ALL ENTRIES IN GT_CAWN
              WHERE ATINN = GT_CAWN-ATINN
              AND   ATZHL = GT_CAWN-ATZHL
              AND SPRAS = 'EN'.
    ENDIF.
    Selecting data from VBeP into Internal tabl gt_vbep
        SORT GT_VBAP[] BY VBELN POSNR.
        SELECT  VBELN POSNR
                ETENR EDATU
          INTO TABLE GT_VBEP
          FROM VBEP
          FOR ALL ENTRIES IN GT_VBAP
          WHERE VBELN = GT_VBAP-VBELN
          AND POSNR = GT_VBAP-POSNR
          AND EDATU IN S_EDATU
               AND BMENG <> 0.
        SELECT SPRAS ROUTE BEZEI
              INTO TABLE GT_TVROT
              FROM TVROT
             WHERE SPRAS = 'EN'.
      ENDIF.
      IF NOT GT_VBAP[] IS INITIAL.
        GT_VBAP_VBPA[] = GT_VBAP[].
        SORT GT_VBAP_VBPA[] BY VBELN.
        DELETE ADJACENT DUPLICATES FROM GT_VBAP_VBPA COMPARING VBELN.
    Selecting data from  VBPA into Internal tabl GT_VBPA
        IF NOT R_PARVW[] IS INITIAL.
          SELECT VBELN POSNR
                 PARVW KUNNR
            INTO TABLE GT_VBPA
            FROM VBPA
            FOR ALL ENTRIES IN  GT_VBAP_VBPA
            WHERE VBELN = GT_VBAP_VBPA-VBELN
            AND (  PARVW  IN R_PARVW
            OR PARVW = 'WE' ).
        ELSE.
          SELECT VBELN POSNR
                 PARVW KUNNR
            INTO TABLE GT_VBPA
            FROM VBPA
            FOR ALL ENTRIES IN  GT_VBAP_VBPA
            WHERE VBELN = GT_VBAP_VBPA-VBELN
            AND  ( PARVW  = 'ZE'
            OR  PARVW = 'ZS'
            OR PARVW = 'ZA'
            OR  PARVW = 'ZR'
            OR  PARVW = 'ZI' OR PARVW = 'WE' ).
        ENDIF.
      ENDIF.
      SORT GT_VBPA[].
      GT_VBPA_KNA1[] = GT_VBPA[].
      SORT GT_VBPA_KNA1[] BY KUNNR.
      DELETE ADJACENT DUPLICATES FROM GT_VBPA_KNA1 COMPARING KUNNR.
      IF NOT GT_VBPA_KNA1[] IS INITIAL.
        SELECT KUNNR NAME1 ORT01 FROM KNA1 INTO TABLE
               GT_KNA1_1 FOR ALL ENTRIES IN GT_VBPA_KNA1
                WHERE KUNNR = GT_VBPA_KNA1-KUNNR.
      ENDIF.
    Selecting data from  VBKD into Internal tabl GT_VBKD
      IF NOT GT_VBAK[] IS INITIAL.
        SELECT VBELN  KDGRP
               INCO1 INCO2
               ZTERM  STCUR
          INTO TABLE GT_VBKD
          FROM VBKD
          FOR ALL ENTRIES IN GT_VBAK
          WHERE VBELN = GT_VBAK-VBELN
          AND PRSDT <> ''.
    Selecting data from VBFA into Internal table gt_vbfa
        IF P_PEN = 'X'.
            SELECT VBFAVBELV   VBFAPOSNV
                    VBFAVBELN   VBFAPOSNN
                    VBFAVBTYP_N VBFARFMNG
               INTO TABLE GT_VBFA
               FROM VBFA INNER JOIN
               VBAK ON VBFAVBELV = VBAKVBELN
               WHERE
               ( VBFA~VBTYP_N = 'J' OR
                     VBFA~VBTYP_N = 'R').
    LOOP AT GT_VBFA.
         READ TABLE GT_VBAK WITH KEY VBELN = Gt_VBFA-VBELV.
           IF SY-SUBRC <> 0.
             DELETE GT_VBFA.
           ENDIF.
    CLEAR GT_VBFA.
    ENDLOOP.
         SELECT VBELV   POSNV
                   VBELN   POSNN
                   VBTYP_N RFMNG
              INTO TABLE GT_VBFA
              FROM VBFA
              FOR ALL ENTRIES IN GT_VBAK
              WHERE VBELV = GT_VBAK-VBELN
              AND ( VBTYP_N = 'J' OR
                    VBTYP_N = 'R').
        ELSE.
          SELECT VBELV   POSNV
                 VBELN   POSNN
                 VBTYP_N RFMNG
            INTO TABLE GT_VBFA
            FROM VBFA
            FOR ALL ENTRIES IN GT_VBAK
            WHERE VBELV = GT_VBAK-VBELN
            AND VBTYP_N = 'J'.
        ENDIF.
        SORT GT_VBFA[].
        IF GT_VBFA[] IS NOT INITIAL.
          GT_VBFA_VBUK[] = GT_VBFA[].
          SORT GT_VBFA_VBUK[] BY VBELN.
          DELETE ADJACENT DUPLICATES FROM GT_VBFA_VBUK COMPARING VBELN.
          SELECT VBELN WBSTK FROM VBUK INTO TABLE GT_VBUK
               FOR ALL ENTRIES IN GT_VBFA_VBUK
                  WHERE VBELN = GT_VBFA_VBUK-VBELN.
        ENDIF.
             -----------Selection data from KONv into Internal table gt_konv
        SORT GT_VBAK[] BY KNUMV.
        SELECT KNUMV KPOSN KSCHL
               KBETR WAERS KWERT
             INTO TABLE GT_KONV
             FROM KONV
             FOR ALL ENTRIES IN GT_VBAK
             WHERE KNUMV = GT_VBAK-KNUMV
             AND ( KSCHL = 'ZBAP'
                  OR   KSCHL = 'JEXP'
                  OR   KSCHL = 'JEDC'
                  OR   KSCHL = 'JEDH'
                  OR   KSCHL = 'ZJIP'
                  OR   KSCHL = 'ZCOM'
                  OR   KSCHL = 'JIVC'
                  OR   KSCHL   = 'JFRE' ).
      ENDIF.
      IF NOT GT_VBAP[] IS INITIAL.
    sELECING dATA FROM MSKA INTO INTERNAL TABLE GT_MSKA
        GT_VBAP_MSKA[] = GT_VBAP[].
        SORT GT_VBAP_MSKA[] BY MATNR WERKS VBELN POSNR.
        DELETE ADJACENT DUPLICATES FROM GT_VBAP_MSKA COMPARING MATNR WERKS VBELN POSNR.
        SELECT  MATNR  WERKS
                LGORT  CHARG
                SOBKZ  VBELN
                POSNR
                KALAB  KAINS
          INTO TABLE GT_MSKA
          FROM MSKA
          FOR ALL ENTRIES IN GT_VBAP_MSKA
          WHERE MATNR = GT_VBAP_MSKA-MATNR
          AND WERKS = GT_VBAP_MSKA-WERKS
       AND LGORT = GT_VBAP-LGORT
          AND VBELN = GT_VBAP_MSKA-VBELN
          AND POSNR = GT_VBAP_MSKA-POSNR.
        SORT GT_MSKA[].
        DATA :BEGIN OF TMP_MATNR OCCURS 0,
               MATNR LIKE MARA-MATNR,
              END OF TMP_MATNR.
        LOOP AT GT_VBAP.
          TMP_MATNR-MATNR = GT_VBAP-MATNR.
          TMP_MATNR-MATNR+0(1) ='S'.
          APPEND TMP_MATNR.
        ENDLOOP.
        SORT TMP_MATNR[].
        DELETE ADJACENT DUPLICATES FROM TMP_MATNR COMPARING MATNR.
        SELECT MATNR
               WERKS
               LGORT
               LABST
          FROM MARD
          INTO TABLE GT_MARD
          FOR ALL ENTRIES IN TMP_MATNR
          WHERE MATNR = TMP_MATNR-MATNR."'SDX25000B040GC01'."GT_VBAP-MATNR.
      ENDIF.
      SORT GT_MARD[].
      IF NOT GT_VBAK[] IS INITIAL.
        GT_VBAK_KNA1[] = GT_VBAK[].
        SORT GT_VBAK_KNA1[] BY KUNNR.
        DELETE ADJACENT DUPLICATES FROM GT_VBAK_KNA1 COMPARING KUNNR.
        SELECT  KUNNR
                     NAME1
                     NAME2
                     ORT01
             FROM KNA1
             INTO TABLE GT_KNA1
             FOR ALL ENTRIES IN GT_VBAK_KNA1
             WHERE KUNNR = GT_VBAK_KNA1-KUNNR.
        SELECT KUNNR  KLABC
          FROM KNVV
         INTO TABLE GT_KNVV
         FOR ALL ENTRIES IN GT_VBAK_KNA1
         WHERE KUNNR = GT_VBAK_KNA1-KUNNR.
      ENDIF.
      IF NOT GT_VBAP[] IS INITIAL.
        GT_VBAP_MAKT[] = GT_VBAP[].
        SORT GT_VBAP_MAKT[] BY MATNR.
        DELETE ADJACENT DUPLICATES FROM GT_VBAP_MAKT COMPARING MATNR.
        SELECT   MATNR
                 SPRAS
                 MAKTX
             FROM MAKT
             INTO TABLE GT_MAKT
             FOR ALL ENTRIES IN GT_VBAP_MAKT
             WHERE MATNR = GT_VBAP_MAKT-MATNR AND
                   SPRAS = 'EN'.
        SELECT MATNR
               MVGR1
          FROM MVKE
          INTO TABLE GT_MVKE
          FOR ALL ENTRIES IN GT_VBAP_MAKT
          WHERE MATNR = GT_VBAP_MAKT-MATNR
          AND MVGR1 <> ''.
      ENDIF.
      IF NOT GT_MVKE[] IS INITIAL.
        GT_MVKE_TVM1T[] = GT_MVKE[].
        SORT GT_MVKE_TVM1T[] BY MVGR1.
        DELETE ADJACENT DUPLICATES FROM GT_MVKE_TVM1T COMPARING MVGR1.
        SELECT SPRAS MVGR1 BEZEI
            FROM TVM1T
            INTO TABLE GT_TVM1T
            FOR ALL ENTRIES IN GT_MVKE_TVM1T
            WHERE SPRAS = 'EN' AND
              MVGR1 = GT_MVKE_TVM1T-MVGR1.
      ENDIF.
      IF NOT GT_VBAK[] IS INITIAL.
        SELECT SPRAS
               SPART
               VTEXT
          FROM TSPAT
          INTO TABLE GT_TSPAT
          WHERE SPRAS = 'EN'.
        SELECT  SPRAS
                VTWEG
                VTEXT
              FROM TVTWT
              INTO TABLE GT_TVTWT
              WHERE SPRAS = 'EN'.
        SELECT SPRAS AUART BEZEI
              FROM TVAKT
              INTO TABLE GT_TVAKT
              WHERE
               SPRAS = 'EN'.
      ENDIF.
      IF NOT GT_VBKD[] IS INITIAL.
        SELECT SPRAS KDGRP
               KTEXT
               FROM T151T
          INTO TABLE GT_T151T
        FOR ALL ENTRIES IN GT_VBKD
         WHERE SPRAS = 'EN' .
         AND
             KDGRP = GT_VBKD-KDGRP.
      ENDIF.
      IF NOT GT_VBKD[] IS INITIAL.
        SELECT SPRAS ZTERM TEXT1
          FROM T052U
          INTO TABLE GT_T052U
        FOR ALL ENTRIES IN GT_VBKD
          WHERE SPRAS = 'EN'.
          AND ZTERM = GT_VBKD-ZTERM.
      ENDIF.
    ENDFORM.                    " SELECT_DATA
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA .
      DATA : T_FLAG(2) TYPE C,
             J_AMT LIKE VBFA-RFMNG,
             M_AMT LIKE VBFA-RFMNG,
             R_AMT LIKE VBFA-RFMNG,
             N_AMT LIKE VBFA-RFMNG,
             JR_AMT LIKE VBFA-RFMNG,
             MN_AMT LIKE VBFA-RFMNG,
             TMP_WBSTK LIKE VBUK-WBSTK,
             SFG_MATNR LIKE MARD-MATNR.
      LOOP AT GT_VBAP.
        CLEAR : GT_FINAL_DATA,
              J_AMT ,
             M_AMT ,
             R_AMT,
             N_AMT ,
             JR_AMT ,
             SFG_MATNR,
             MN_AMT .
        READ TABLE GT_VBAK WITH KEY VBELN = GT_VBAP-VBELN.
        IF SY-SUBRC = 0.
          GT_FINAL_DATA-KUNNR    = GT_VBAK-KUNNR.
          GT_FINAL_DATA-VBELN  = GT_VBAK-VBELN.
          GT_FINAL_DATA-POSNR = GT_VBAP-POSNR.
          GT_FINAL_DATA-ABGRU = GT_VBAP-ABGRU.
        ENDIF.
        READ TABLE GT_KNA1 WITH KEY KUNNR = GT_VBAK-KUNNR.
        IF SY-SUBRC = 0.
          GT_FINAL_DATA-NAME = GT_KNA1-NAME1.
          GT_FINAL_DATA-ORT01 = GT_KNA1-ORT01.
        ENDIF.
        READ TABLE GT_KNVV WITH KEY KUNNR = GT_VBAK-KUNNR.
        IF SY-SUBRC = 0.
          GT_FINAL_DATA-KLABC = GT_KNVV-KLABC.
        ENDIF.
        IF SY-SUBRC = 0.
          READ TABLE GT_VBKD WITH KEY VBELN = GT_VBAK-VBELN.
          GT_FINAL_DATA-INCO1 = GT_VBKD-INCO1. "Incoterms (Part 1)
          GT_FINAL_DATA-INCO2 = GT_VBKD-INCO2. "Incoterms (Part 2)
          GT_FINAL_DATA-ZTERM = GT_VBKD-ZTERM. " Payment Term
        ENDIF.
        LOOP AT  GT_MSKA WHERE  MATNR = GT_VBAP-MATNR
                         AND    WERKS = GT_VBAP-WERKS
                         AND    LGORT = GT_VBAP-LGORT
                         AND    VBELN = GT_VBAP-VBELN
                         AND    POSNR = GT_VBAP-POSNR.
          GT_FINAL_DATA-KALAB = GT_FINAL_DATA-KALAB  + GT_MSKA-KALAB. "Unrestricted-Use Stock
          GT_FINAL_DATA-KAINS = GT_FINAL_DATA-KAINS + GT_MSKA-KAINS. " Stock in Quality Inspection
        ENDLOOP.
        SFG_MATNR = GT_VBAP-MATNR.
        SFG_MATNR+0(1) ='S'.
        READ TABLE  GT_MARD WITH KEY  MATNR = SFG_MATNR
                               WERKS = GT_VBAP-WERKS
                           LGORT = 'SF01'.
       loop at gt_mard where MATNR = SFG_MATNR
                       and  WERKS = GT_VBAP-WERKS.
        IF SY-SUBRC = 0.
          GT_FINAL_DATA-LABST =   GT_FINAL_DATA-LABST + GT_MARD-LABST . "Valuated Unrestricted-Use Stock
        ENDIF.
       endloop.
        GT_FINAL_DATA-MATNR = GT_VBAP-MATNR.  "Matrial
        GT_FINAL_DATA-ZZKDMAT = GT_VBAP-ZZKDMAT. " Customer Mat. N

    Hi Rajan,
    There is a lot of scope for performance tuning the code:
    1. Read statement should be with BINARY SEARCH
    2. Select statement should have FIELDS in the same order as they exist in the table
    3. Select statement where clause should have fields in same order as they exist in the table.
    4. Internal tables seem to be having a huge number of fields. If possible, please limit the fields to only required fields in the internal table.
    Best regards,
    Prashant

  • Process SERVER0 its taking High CPU Time in XI

    Hi,
    We installed XI 3.0 develpoment server ,Process <b>SERVER0</b> its taking more CPU time.
    We are using AS/400 OS & DB2 datbase.Can any one tell me the reason & Solution for this.
    Thanks & Regards,
    Gopinath.

    hi,
    Actually the user XIRWBUSER its an RFC user but its running on many dialog process.I think high CPU time due to this user only.
    using 5 work processes and 3/4 of the available CPU for an extended amount of time.
    Total Total DB
    Job or CPU Sync Async CPU
    Task User Number Thread Pty Util I/O I/O Util
    WP11 D6464 485368 00000010 20 54.0 25 37 27.8
    WP05 X4242 498642 00000098 20 49.6 5 0 36.7
    WP04 X4242 498641 00000014 20 48.8 1 0 39.1
    WP02 X4242 498639 0000025A 20 47.1 2 0 37.8
    WP06 X4242 498643 000001E6 20 43.7 0 0 38.3
    WP00 X4242 498637 00000014 20 11.1 502 194 2.9
    pls can any one help me
    Regards,
    Gopinath.

  • Oracle taking more memory ?

    hi
    i have oracle running on solaris, sga set to 3 gb but below command showing multiple process for PRDLIVE
    and taking more memory than 3GB in total, .... occasionally i see oracle shutting down due to out of memory issue ...
    ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 | head
    18688 11.4 3381200 1859272 oraclePRDLIVE
    18649 11.4 3377664 1847864 oraclePRDLIVE
    18557 9.6 3377392 1553744 ora_w000_PRDLIVE
    18555 9.6 3377272 1550384 ora_smco_PRDLIVE
    18703 9.2 2058304 1489584 oracleTEST
    14420 9.2 2065448 1494536 oracleTEST
    14414 9.2 2061368 1485776 oracleTEST
    18690 9.1 2052264 1483248 oracleTEST
    18584 9.1 2050200 1480608 ora_w000_TEST
    18515 8.1 3387888 1310160 oraclePRDLIVE
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    cat /etc/release
    Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
    Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
    Assembled 23 August 2011
    PMON (ospid: 19876): terminating the instance due to error 490
    ORA-04030: out of process memory when trying to allocate 4088 bytes (PLS CGA hp,pdz2M87_Allocate_Permanent)

    user9182826 wrote:
    hi
    i have oracle running on solaris, sga set to 3 gb but below command showing multiple process for PRDLIVE
    and taking more memory than 3GB in total, .... occasionally i see oracle shutting down due to out of memory issue ...
    ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 | head
    18688 11.4 3381200 1859272 oraclePRDLIVE
    18649 11.4 3377664 1847864 oraclePRDLIVE
    18557 9.6 3377392 1553744 ora_w000_PRDLIVE
    18555 9.6 3377272 1550384 ora_smco_PRDLIVE
    18703 9.2 2058304 1489584 oracleTEST
    14420 9.2 2065448 1494536 oracleTEST
    14414 9.2 2061368 1485776 oracleTEST
    18690 9.1 2052264 1483248 oracleTEST
    18584 9.1 2050200 1480608 ora_w000_TEST
    18515 8.1 3387888 1310160 oraclePRDLIVE
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    cat /etc/release
    Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
    Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
    Assembled 23 August 2011
    PMON (ospid: 19876): terminating the instance due to error 490
    ORA-04030: out of process memory when trying to allocate 4088 bytes (PLS CGA hp,pdz2M87_Allocate_Permanent)04030, 00000, "out of process memory when trying to allocate %s bytes (%s,%s)"
    // *Cause:  Operating system process private memory was exhausted.
    Oracle is victim; not the culprit.
    Problem is at OS level & fix must be done at OS level.

  • Syslogd Consuming more CPU utilization in Solaris 10

    Hi All,
    The Syslogd process consuming more CPU utilization in Solaris 10. Kindly help how to reduce this cpu utilization.
    Regards
    Siva

    Hi Robert,
    Both are same architecture. x86
    The following is the prstat o/p from the affected server. Pls note that one of the mount point in this server is in ZFS.
    prstat -l
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
    26092 root 3933M 3930M cpu1 60 0 29:00:43 22% syslogd/56
    26092 root 3933M 3930M run 30 0 289:47:33 12% syslogd/18
    26092 root 3933M 3930M run 40 0 272:31:05 11% syslogd/22
    26092 root 3933M 3930M run 22 0 14:47:16 9.7% syslogd/65
    26092 root 3933M 3930M run 42 0 14:43:46 9.7% syslogd/63
    26092 root 3933M 3930M run 31 0 14:40:42 9.6% syslogd/66
    26092 root 3933M 3930M sleep 40 0 152:45:42 5.9% syslogd/21
    26092 root 3933M 3930M cpu0 53 0 6:41:58 4.1% syslogd/58
    26092 root 3933M 3930M run 52 0 6:23:13 4.0% syslogd/57
    26092 root 3933M 3930M sleep 43 0 6:29:21 3.9% syslogd/59
    26092 root 3933M 3930M sleep 52 0 5:55:14 3.6% syslogd/71
    More over we are continuously receiving the below error message in the /var/adm/messages, we don't know, from where the error arises from the syslog server.
    syslogd: malloc failed: dropping message from remote: Not enough space
    PRIVILEGE :[4] 'NONE'
    Edited by: Siva_Systems on Mar 29, 2010 5:06 AM
    Edited by: Siva_Systems on Mar 29, 2010 8:18 AM

  • Java threads and WinLogon processes taking CPU!

    We are seeing a strange problem. We have a multi-threaded java application
    that is deployed on a Microsoft Windows 2000 server (SP4) with Citrix
    Metaframe XP (Feature release 2). When this application starts, we start to see
    multiple WINLOGON.EXE processes (20 plus) each taking up 1-2% of CPU -
    this raises the CPU usage on the server significantly, impacting performance.
    We have tested with JDK 1.3, 1.4, and 1.5 and see the same issues. If we
    run the java application in a single thread, we dont see the same issue.
    Has any one seen this problem before? Any suggestion on how this can be resolved?
    Thanks in advance!

    Thanks for your replies. This is a Citrix environment where there are 50 plus
    users logged in and there are 50 plus instances of Winlogon.exe always
    running. Most of the time the cpu usage of these processes is 0.
    We tried a multi-threaded program that lists files in a directory every few
    seconds. There are 40 plus servers in the farm that we are deploying this
    application on. We are seeing this problem on only some of the servers.
    If we run a single thread from main(), we dont see the issue. But if we spawn
    10 threads doing the scans periodically, we notice that as soon as all the threads
    start, the WinLogons appear to start to take up CPU. When we stop the java
    program, the WinLogon processes drop in CPU usage.
    Is it possible that Java and WinLogon share some dlls that could be triggering
    the WinLogon processes off?
    We have tried running the single thread and multi-threaded programs around
    same time and the correlation with the winlogons is clearly visible. If we add
    sleep() soon after we start a thread, the winlogons seem to kick in later.

  • HT201274 My iphone4 is taking more than 5 hours to erase all the data still it is under process , still how much more time i have to wait for my mobile to ON

    My iphone4 is taking more than 5 hours to erase all the data still it is under process , still how much more time i have to wait for my mobile to ON ?

    I'm having this EXACT same problem with my iPhone 4, and I have the same computer stats (I have a Samsung Series 7)

  • Since I upgraded to Adobe Created Cloud, my photo editing processes are taking more than 10 times longer than they used to.  Why would this be?

    Since I upgraded to Adobe Created Cloud, my photo editing processes are taking more than 10 times longer than they used to.  Why would this be?

    You will likely get better program help in a program forum
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

Maybe you are looking for

  • Third-party plug-in Digieffects

    For the third-party partner Digieffects (mentioned under In Depth on the Adobe website) what happens to the purchased plug-in (such as Phenomena) once the Adobe apllication plan is canceled?

  • Startup problem with Adaptec FireWire/USB drive enclosure?

    I recently acquired a Core Duo 1.66GHz mini. Soon after buying it I noticed that on startup, I get to the gray screen with Apple logo, and it freezes there for about 3-4 minutes before the spinning wheel appears briefly and then OS X starts normally.

  • Using the JVC HD7 with a MAC

    I have purchased the HD7 and cannot get it to work with either iMovie 06 or iMovie 08. I even took the camera to my local Apple store and none of the people were able to get it working. Any ideas? The camera is recognized as the program tells me when

  • Deductable and Non deductable Control function for CVD A/C during Import Procurement.....

    Hi Expert, I have a requirement like my client needs to take credit availed on CVD (JCV1), ECess on CVD (JECV) and H&SECess on CVD (J1CV) in Import procurement for one Company code. for 1000, however client doesn't want to take credit availed for ano

  • VAT Amount inventoried through MM pricing not TAXINN

    Hi All, My requirement is VAT amount should add into material during GRN through MM pricing only,no TAXINN e.g Material Net price= 100 VAT=10 So during GRN BSX should debit at 110 and WRX should credit as 110. Possibility that i have tried. 1. Create