SAP CPS script to calculate the percentage of number of jobs completed

Hello
I have 2 client specific jobs, which I am executing on 300+ ABAP system using SAP CPS system. I would like to know..
what % of jobs completed successfully & failed.
at present, using the filter method, I get a consolidate jobs status mail. some think like this.
regards
Shridhar Gowda

Hi Shridhar,
Redwood system maintains statistics for each job Definition.
In job statistcis you can notice Execution Completed Count  and Execution Error Count .
You can use Redwood script to pull those statistics
Use following methods to extract them.
getExecutionCompletedCount()
getExecutionErrorCount()
You can write code to get the error percentage and completed percentage.
Hope this helps.

Similar Messages

  • How to calculate the percentage of free space for a table in Oracle

    okay, I am a little confused here. I have been searching the web and looking at a lot of documents. What I basically want to find out is this, how do I calculate the difference between the number of bytes a table is using and the total bytes allocated to a table space (going that way to get percent free for a particular table). So I need a byte count of a table and total table space and the percentage difference. I have been looking at the DBA_TABLES DBA_TABLESPACES and DBA_SEGMENTS views. I have tried to calculated the space as num_rows * avg_row_len (if I am wrong, let me know). I have been trying to compare that calculation to the number in DBA_TABLESPACES and DBA_SEGMENTS. I am just looking for the total space allocated to the table space that the table sits in (seem logical right now) to make the percentage value work. Thus I want to be able to track the table as it grows as compated to the table space it sits in to see a value as it changes over time (days, weeks, etc.) each time I run this script I am working on.
    Can someone get me straight and help me to find out if I am looking in the right places. Any advice would help.
    Edward

    You can use a little modified version of dbms_space from Tom, show_space. Have a look,
    SQL> create table test222 as select * from all_objects;
    Table created.
    SQL> delete from test22 where rownum<=100;
    delete from test22 where rownum<=100
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> delete from test222 where rownum<=100;
    100 rows deleted.
    SQL> analyze table test222 compute statistics;
    Table analyzed.
    SQL>  create or replace procedure show_space
      2  ( p_segname in varchar2,
      3    p_owner   in varchar2 default user,
      4    p_type    in varchar2 default 'TABLE',
      5    p_partition in varchar2 default NULL )
      6  -- this procedure uses authid current user so it can query DBA_*
      7  -- views using privileges from a ROLE and so it can be installed
      8  -- once per database, instead of once per user that wanted to use it
      9  authid current_user
    10  as
    11      l_free_blks                 number;
    12      l_total_blocks              number;
    13      l_total_bytes               number;
    14      l_unused_blocks             number;
    15      l_unused_bytes              number;
    16      l_LastUsedExtFileId         number;
    17      l_LastUsedExtBlockId        number;
    18      l_LAST_USED_BLOCK           number;
    19      l_segment_space_mgmt        varchar2(255);
    20      l_unformatted_blocks number;
    21      l_unformatted_bytes number;
    22      l_fs1_blocks number; l_fs1_bytes number;
    23      l_fs2_blocks number; l_fs2_bytes number;
    24      l_fs3_blocks number; l_fs3_bytes number;
    25      l_fs4_blocks number; l_fs4_bytes number;
    26      l_full_blocks number; l_full_bytes number;
    27
    28      -- inline procedure to print out numbers nicely formatted
    29      -- with a simple label
    30      procedure p( p_label in varchar2, p_num in number )
    31      is
    32      begin
    33          dbms_output.put_line( rpad(p_label,40,'.') ||
    34                                to_char(p_num,'999,999,999,999') );
    35      end;
    36  begin
    37     -- this query is executed dynamically in order to allow this procedure
    38     -- to be created by a user who has access to DBA_SEGMENTS/TABLESPACES
    39     -- via a role as is customary.
    40     -- NOTE: at runtime, the invoker MUST have access to these two
    41     -- views!
    42     -- this query determines if the object is a ASSM object or not
    43     begin
    44        execute immediate
    45            'select ts.segment_space_management
    46               from dba_segments seg, dba_tablespaces ts
    47              where seg.segment_name      = :p_segname
    48                and (:p_partition is null or
    49                    seg.partition_name = :p_partition)
    50                and seg.owner = :p_owner
    51                and seg.tablespace_name = ts.tablespace_name'
    52               into l_segment_space_mgmt
    53              using p_segname, p_partition, p_partition, p_owner;
    54     exception
    55         when too_many_rows then
    56            dbms_output.put_line
    57            ( 'This must be a partitioned table, use p_partition => ');
    58            return;
    59     end;
    60
    61
    62     -- if the object is in an ASSM tablespace, we must use this API
    63     -- call to get space information, else we use the FREE_BLOCKS
    64     -- API for the user managed segments
    65     if l_segment_space_mgmt = 'AUTO'
    66     then
    67       dbms_space.space_usage
    68       ( p_owner, p_segname, p_type, l_unformatted_blocks,
    69         l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes,
    70         l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes,
    71         l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes, p_partition);
    72
    73       p( 'Unformatted Blocks ', l_unformatted_blocks );
    74       p( 'FS1 Blocks (0-25)  ', l_fs1_blocks );
    75       p( 'FS2 Blocks (25-50) ', l_fs2_blocks );
    76       p( 'FS3 Blocks (50-75) ', l_fs3_blocks );
    77       p( 'FS4 Blocks (75-100)', l_fs4_blocks );
    78       p( 'Full Blocks        ', l_full_blocks );
    79    else
    80       dbms_space.free_blocks(
    81         segment_owner     => p_owner,
    82         segment_name      => p_segname,
    83         segment_type      => p_type,
    84         freelist_group_id => 0,
    85         free_blks         => l_free_blks);
    86
    87       p( 'Free Blocks', l_free_blks );
    88    end if;
    89
    90    -- and then the unused space API call to get the rest of the
    91    -- information
    92    dbms_space.unused_space
    93    ( segment_owner     => p_owner,
    94      segment_name      => p_segname,
    95      segment_type      => p_type,
    96      partition_name    => p_partition,
    97      total_blocks      => l_total_blocks,
    98      total_bytes       => l_total_bytes,
    99      unused_blocks     => l_unused_blocks,
    100      unused_bytes      => l_unused_bytes,
    101      LAST_USED_EXTENT_FILE_ID => l_LastUsedExtFileId,
    102      LAST_USED_EXTENT_BLOCK_ID => l_LastUsedExtBlockId,
    103      LAST_USED_BLOCK => l_LAST_USED_BLOCK );
    104
    105      p( 'Total Blocks', l_total_blocks );
    106      p( 'Total Bytes', l_total_bytes );
    107      p( 'Total MBytes', trunc(l_total_bytes/1024/1024) );
    108      p( 'Unused Blocks', l_unused_blocks );
    109      p( 'Unused Bytes', l_unused_bytes );
    110      p( 'Last Used Ext FileId', l_LastUsedExtFileId );
    111      p( 'Last Used Ext BlockId', l_LastUsedExtBlockId );
    112      p( 'Last Used Block', l_LAST_USED_BLOCK );
    113  end;
    114
    115  /
    Procedure created.
    SQL> desc show_space
    PROCEDURE show_space
    Argument Name                  Type                    In/Out Default?
    P_SEGNAME                      VARCHAR2                IN
    P_OWNER                        VARCHAR2                IN     DEFAULT
    P_TYPE                         VARCHAR2                IN     DEFAULT
    P_PARTITION                    VARCHAR2                IN     DEFAULT
    SQL> set serveroutput on
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "SCOTT.SHOW_SPACE", line 44
    ORA-06512: at line 1
    SQL> conn / as sysdba
    Connected.
    SQL> grant sysdba to scott;
    Grant succeeded.
    SQL> conn scott/tiger as sysdba
    Connected.
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SHOW_SPACE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL> exec scott.show_space('TEST222','SCOTT');
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec scott.show_space('TEST222','SCOTT');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................               1
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               1
    Full Blocks        .....................             807
    Total Blocks............................             896
    Total Bytes.............................       7,340,032
    Total MBytes............................               7
    Unused Blocks...........................              65
    Unused Bytes............................         532,480
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................           1,289
    Last Used Block.........................              63
    PL/SQL procedure successfully completed.
    SQL>http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5350053031470
    I use this to find the space allocations.
    Just read your post again,this is not going to show you the percentage of the free/used space. This is going to be the number of blocks which are free/used. For the growth trend, you can look at (in 10g) Oracle EM. It has added now,Segment Growth Trend report which can show you for each object,comparing to the allocated space to the object,how much space is being used by it.
    HTH
    Aman....

  • How to calculate the percentages

    Hi Gurus!!
    I am having a key figure(say suppose KF1) which had undergone currency conversions in query designer level to USD.
    Now i want one more field(KF2) in my report in which i should get the values of percentages based on KF1 and its overall result.
    Means i have 1000,2500,3400....under KF1 and the total is 25000. Finally under KF2 i should get as mentioned below
    KF1----
    >KF2
    1000----
    >(1000/25000)*100
    2500----
    >(2500/25000)*100  
    3400----
    >(3400/25000)*100
    So like wise i shold get the percentages based on KF1 and its total.
    I had tried SUMGT and %GT functions as mentioned below:
    kf1/sumgt(kf1)  and  kf1/%GT(kf1)  and for both of them the query is showing errors like you cannot use these functions in the query. correct the query.
    Pls suggest me the solution.
    Thanks in Advance
    Jiten
    Edited by: Jitendra Yuddandi on Jun 9, 2009 12:20 PM

    check these links
    http://help.sap.com/saphelp_nw04s/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/e2/16f13a2f160f28e10000000a114084/frameset.htm

  • Calculate the percentage of one number against another

    Hi,
    I am using Acrobat Standard and would like to calculate a percentage of one number to another, i.e.
    Loans
    Amount
    % Of total loan
    Bank
    100,000
    Other sources
    17,000
    Total
    117,000
    100%
    I would like to find the two unknown percentages.
    I am totally new to Adobe, so please explain in a step by step manner if this is possible.
    Thank you in advance for your help.
    Caz

    On the iPad my example looks like this:
    To fill the formula down you tap cell and then Fill:
    And drag the bottom part of the yellow rectangle down:
    Wayne's example would look similar.
    SG

  • How to calculate the Percentage differencebased on two values

    Not sure how to do this.
    Just want to calculate the % difference of two values (seem to have a problem when one value is zero)
    Here is the current output
    49 Apr 2
    64 Aug 1
    55 Feb 0
    Here is the output I would like to see
    49 Apr 2 4.08%
    64 Aug 1 1.56%
    55 Feb 0 0.00%
    Here is the current SQL
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments"
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')

    You can try something like this one:
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments",
    round(count(1)/SUM(CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) * 100,2) || '%' percent
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')
    CODE NOT TESTED !!!
    Best Regards
    Krystian Zieja / mob

  • System should calculate the UPC/EAN Number automatically

    Can we add the UPC calculator to SAP, MM01 so the system can calculate the ending checkdigit for us?  Currently when we need to calculate the ending checkdigit for upc codes we go to an online site, key the number, calculate the ending digit, copy and paste into MM01. Can this calculation be added to MM01, Basic Data 1, EAN/UPC field?
    If we key the 14 digit upc ending in 0, the system message can then tell us what the corrected digit should be or change it automatically for us. Currently the message says "the EAN xxx has an incorrect checkdigit"
    example temp upc-key 55000011564120 and the message should say "ending digit should be 6" or the system can change to 0 to a 6 for us.
    example real upc-00036000915450 and the message should say "ending digit should be 7" or the system can change to 7 for us.
    We have to key the zero on the end or the system adds a leading zero up front (to make the full 14 digits) and just accepts.
    Website we use to calculate the ending digits is http://www.gs1.org/barcodes/support/check_digit_calculator
    Please help me in solving this scenario.....
    Marc.

    Hi Mark,
                 For this scenario you will need to add custom code for automatic calculation of Check digit and thus modifying EAN/UPC no. entered by you to a correct EAN/UPC no.
    However as soon as we enter EAN/UPC( with wrong check digit) no in basic data 1 tab we get an error u201CThe EAN 36000915450 has an incorrect check digitu201D. And it seems that in between entry of EAN/UPC and error message there is no customer exit/BADI  is coming in which we could have written our custom code to generate check digit and correct EAN/UPC.
    So an option is that if you are uploading multiple materials you can use BDC to upload all such materials and there you will have the possibility to correct the EAN/UPC using ABAP custom code before submitting it to MM01 screen.
    Regards,
    Rajwin.

  • How can i calculate the percentages and update the progressBar in the splash screen form ?

    I created a splash screen form:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Threading;
    namespace GetHardwareInfo
    public partial class SplashScreen : Form
    public SplashScreen()
    InitializeComponent();
    private Mutex mutex = new Mutex();
    public void SyncedClose()
    mutex.WaitOne();
    this.Close();
    mutex.ReleaseMutex();
    public void UpdateProgressBar(int percentage)
    if (this.InvokeRequired)
    mutex.WaitOne();
    if (!IsDisposed)
    this.BeginInvoke(new Action<int>(UpdateProgresPRV), percentage);
    mutex.ReleaseMutex();
    else
    UpdateProgresPRV(percentage);
    private void UpdateProgresPRV(int per)
    if (progressBar1.IsDisposed) return;
    progressBar1.Value = per;
    private void SplashScreen_Load(object sender, EventArgs e)
    The SplashScreen form have in the designer image and on the image a progressBar1.
    Then in form1 i did in the top:
    List<string> WmiClassesKeys = new List<string>();
    IEnumerable<Control> controls;
    string comboBoxesNames;
    SplashScreen splash = new SplashScreen();
    And in the constructor:
    controls = LoopOverControls.GetAll(this, typeof(ComboBox));
    string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt");
    foreach (string line in lines)
    foreach (ComboBox comboBox in controls.OfType<ComboBox>())
    if (line.StartsWith("ComboBox"))
    comboBoxesNames = line.Substring(14);
    else
    if (line.StartsWith("Classes"))
    if (comboBox.Name == comboBoxesNames)
    comboBox.Items.Add(line.Substring(14));
    foreach (ComboBox comboBox in controls.OfType<ComboBox>())
    comboBox.SelectedIndex = 0;
    The method GetAll is to loop over specific controls:
    public static IEnumerable<Control> GetAll(Control control, Type type)
    var controls = control.Controls.Cast<Control>();
    return controls.SelectMany(ctrl => GetAll(ctrl, type))
    .Concat(controls)
    .Where(c => c.GetType() == type);
    When i'm running the program it's taking some time to make the foreach loops in this time i need to show the SplashScreen and update the progressBar untill the foreach loops over.

    Don't use Application.Doevents. It's not required and can cause problems.
    I do not really grasp the approach you are taking here. So let me make a different suggestion:
    SplashScreen:
    using System;
    using System.Windows.Forms;
    using System.Threading;
    namespace WindowsFormsApplication1
    public partial class SplashScreen : Form
    private static SplashScreen DefaultInstance;
    public SplashScreen()
    InitializeComponent();
    public static void ShowDefaultInstance()
    Thread t = new Thread(TMain);
    t.Name = "SplashUI";
    t.Start();
    public static void CloseDefaultInstance()
    DefaultInstance.Invoke(new Action(DefaultInstance.Close));
    private static void TMain()
    DefaultInstance = new SplashScreen();
    DefaultInstance.Show();
    Application.Run(DefaultInstance);
    public static void UpdateProgress(int Progress)
    if (DefaultInstance.InvokeRequired)
    DefaultInstance.Invoke(new Action<int>(UpdateProgress), Progress);
    else
    DefaultInstance.progressBar1.Value = Progress;
    Form1:
    using System.Windows.Forms;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    SplashScreen.ShowDefaultInstance();
    for (int i = 1; i<=100; i++)
    System.Threading.Thread.Sleep(20); // simulates work
    SplashScreen.UpdateProgress(i);
    SplashScreen.CloseDefaultInstance();
    EDIT: Please note that the progressbar itself is being animated by the system, so it might look slower than it really is. To workaround this, there are solutions available (you'll find them) that first set the value one higher than necessary, then
    back to the actual value.
    Edit #2: You do need a different thread, otherwise the UI is locked while the loop is running in your Form1's constructor.
    Armin

  • Including both the Jquery script to calculate the total of calculated column and freeze header row

    Hi
    I managed to get this code from here,
    http://techtrainingnotes.blogspot.in/2013/03/freezing-title-row-of-sharepoint-2010.html done on the page 
    I also managed to get this code from here, http://www.sharepointed.com/2012/11/28/jquery-total-calculated-column-in-sharpoint-2010/ done on another page.
    However, I need this to be done on the same page. When I do this, I only get the freeze header thingy to be up and not the calculated column. Could something be blocking. 

    Hi,
    You take the code below for a try in your environment after modified it a bit to suit the structure of your page:
    <script type="text/javascript" src="../../SiteAssets/js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    // update the list after the page has loaded
    _spBodyOnLoadFunctionNames.push("TTNListScroll");
    function TTNListScroll()
    // Scrolling list code from TechTrainingNotes.blogspot.com
    // Edit the next line with your list's summary name
    var SummaryName = "List28_frozenheader ";
    var TTNmyTable;
    var TTNListDiv = document.createElement('div');
    var TTNHeadingDiv = document.createElement('div');
    var tables = document.getElementsByTagName("table");
    for (var i=0;i<tables.length;i++)
    if(tables[i].summary == SummaryName)
    TTNmyTable = tables[i];
    break;
    if(TTNmyTable == undefined)
    // // Table not found!
    // you may want to comment out the next line after testing
    alert("table '" + SummaryName + "' not found");
    return;
    // make a copy of the table for the heading area
    TTNHeadingDiv.appendChild(TTNmyTable.cloneNode(true));
    TTNHeadingDiv.id="TTNheading";
    TTNListDiv.appendChild(TTNmyTable.cloneNode(true));
    TTNListDiv.id="TTNlist";
    TTNListDiv.width="100%";
    // udpate the page
    var TTNnode = TTNmyTable.parentNode;
    TTNnode.replaceChild(TTNHeadingDiv, TTNmyTable);
    TTNnode.appendChild(TTNListDiv);
    // hide the heading row of the main list
    TTNListDiv.childNodes[0].rows[0].style.visibility='hidden';
    // make the DIV for the heading the same width as the main list
    TTNHeadingDiv.childNodes[0].style.width = TTNListDiv.childNodes[0].offsetWidth;
    getSum(3);
    //pass the column number to this function
    function getSum(col)
    var m = "$"; //change to "" for non-money format
    var arrayList = $("table.ms-listviewtable:first> tbody> tr:gt(0)").find(">td:eq("+col+")");
    var x = 0;
    var p1 = "";
    var p2 = "";
    $.each(arrayList, function(){
    //console.log('$(this).text(): '+$(this).text());
    x += Number($(this).text().replace(/\$|,|\)/g, "").replace(/\(/g,"-"));
    //console.log('x: '+x);
    //format for negative numbers
    if (x < 0)
    p1 = "(";
    p2 = ")";
    x = Math.abs(x);
    $('#diidSortcal').attr('visibility','visible');
    $('#diidSortcal').text($('#diidSortcal').text()+'(sum: '+x+')');
    function addCommas(nStr)
    //formats number
    nStr += '';
    x = nStr.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1))
    x1 = x1.replace(rgx, '$1' + ',' + '$2');
    return x1 + x2;
    </script>
    <style type="text/css">
    #TTNheading
    height:28px;
    #TTNlist
    height:200px;
    overflow-y:scroll !important;
    overflow-x:auto
    </style>
    Then you might get something like this:
    Feel free to reply if there are still any questions.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How calculate the percentage of area...

    Hi,
    I have 4 tables:
    Tab AREA_TI
    LS_ID          FL     AREA
    EMS00046     P01     2.995,09
    EMS00046     P02     0,78
    EMS00046     PTE     1.435,48
    EMS00046     S01     1.684,80
    EMS00046     S02     1.694,12
    EMS00050     P01     1.111,60
    EMS00050     P02     1.054,16
    EMS00050     P03     1.117,05
    EMS00050     P04     1.087,24
    EMS00050     P05     1.117,85
    EMS00050     P06     646,99
    EMS00050     P07     249,48
    EMS00050     PTE     593,35
    EMS00050     S01     91,15
    EMS00011     P02     446,90
    EMS00021     PTE     0,71SUM AREA_TI is:
    LS_ID          SUM(AREA)
    EMS00011     446,90
    EMS00021     0,71
    EMS00046     7.810
    EMS00050     7.068Tab AREA_T0
    LS_ID          FL     AREA
    EMS00046     PTE     15,48
    EMS00050     PTE     15,33
    00001156     P01     3.379,82
    00001156     P02     3.731,25
    00001156     P03     2.686,88
    00001156     PTE     2.279,49
    00001156     S01     7.341,05SUM AREA_T0 is:
    LS_ID          SUM(AREA)
    00001156     19.418
    EMS00046     15,48
    EMS00050     15,33Tab AREA_FI
    LS_ID          FL     AREA
    04600411     P01     785,64
    04600411     P02     829,72
    04600411     P03     832,36
    04600411     PCO     11,88
    04600411     PTE     473,91
    04600411     S01     1.740,42SUM AREA_FI is:
    LS_ID          SUM(AREA)
    04600411     4.673Tab AREA_EM
    LS_ID          FL     AREA
    00307374     P01     4.269,59
    00307374     P02     8.362,79
    00307374     P03     770,96
    00307374     PTE     7.292,11
    00307374     S01     1.425,90
    00602037     P01     3.364,47
    00602037     PTE     9.764,71
    00602037     S01     75,17SUM AREA_EM is:
    LS_ID          SUM(AREA)
    00307374     22.121
    00602037     13.204I'd like to get these results:
    LS_ID      AREA_TI AREA_T0 AREA_FI AREA_EM  AREA_TOT  PERC_T0   PERC_FI  PERC_TI   PERC_EM
    EMS00011  446,90    0     0          0     446,90                          1                       
    EMS00021   0,71     0     0          0     0,71                                1
    EMS00046  7810    15,48   0          0     7825,75  0,00197            0,99803
    EMS00050  7068    15,33   0          0     7083,33  0,00216            0,99784
    00001156   0      19418   0          0     19418        1                                   
    04600411   0        0     4673       0        4673                  1
    00307374   0        0     0       22121    22121                                    1
    00602037   0        0     0       13204    13204                                    1PERC_T0=AREA_T0/AREA_TOT
    PERC_FI=AREA_FI/AREA_TOT
    PERC_TI=AREA_TI/AREA_TOT
    PERC_EM=AREA_EM/AREA_TOT
    I tried this:
    CREATE OR REPLACE VIEW PERC_AREA ( LS_ID,
    AREA_T0, AREA_FI, AREA_EM, AREA_TI,
    AREA_TOT, PERC_T0, PERC_FI, PERC_TI,
    PERC_EM ) AS
    SELECT A.LS_ID,
    SUM(nvl(A.AREA,0)),
    SUM(nvl(B.AREA,0)),
    SUM(nvl(C.AREA,0)),
    SUM(nvl(D.AREA,0)),
    SUM(NVL(A.AREA,0)+NVL(B.AREA,0)+NVL(C.AREA,0)+NVL(D.AREA,0)),
    SUM(A.AREA)/SUM(NVL(A.AREA,0)+NVL(B.AREA,0)+NVL(C.AREA,0)+NVL(D.AREA,0)),
    SUM(B.AREA)/SUM(NVL(A.AREA,0)+NVL(B.AREA,0)+NVL(C.AREA,0)+NVL(D.AREA,0)),
    SUM(C.AREA)/SUM(NVL(A.AREA,0)+NVL(B.AREA,0)+NVL(C.AREA,0)+NVL(D.AREA,0)),
    SUM(D.AREA)/SUM(NVL(A.AREA,0)+NVL(B.AREA,0)+NVL(C.AREA,0)+NVL(D.AREA,0))
    FROM AREA_T0 A, AREA_FI B,AREA_TI C, AREA_EM D
    WHERE A.LS_ID=B.LS_ID(+)
    AND a.LS_ID=C.LS_ID(+)
    AND a.LS_ID=D.LS_ID(+)
    GROUP BY A.LS_ID
    How can I create a oracle view to get percentage of area FOR ALL LS_ID present in the 4 tables??
    Thanks!!!

    Hi Barbara
    your query seem not correct
    I tried this:
    CREATE OR REPLACE VIEW X ( LS_ID,
    AREA ) AS select ls_id, sum(area_locali) area
    from area_ti
    group by ls_id
    union all
    select ls_id, sum(area) area
    from area_t0
    group by ls_id
    union all
    select ls_id, sum(area) area
    from area_fi
    group by ls_id
    union all
    select ls_id, sum(area) area
    from area_em
    group by ls_id
    create or replace view PERC_AREA
    AS
    select x.ls_id,
    area_ti.sum area_ti,
    area_t0.sum area_t0,
    area_fi.sum area_fi,
    area_em.sum area_em,
    area_tot.sum area_tot,
    area_t0.sum/area_tot.sum perc_t0,
    area_fi.sum/area_tot.sum perc_fi,
    area_ti.sum/area_tot.sum perc_ti,
    area_em.sum/area_tot.sum perc_em,
    round(area_tot.sum*100/area_gen.sum,2) perc_lsid
    from (select distinct ls_id
    from x) x,
    (select ls_id, sum(area) sum
    from area_ti
    group by ls_id) area_ti,
    (select ls_id, sum(area) sum
    from area_t0
    group by ls_id) area_t0,
    (select ls_id, sum(area) sum
    from area_fi
    group by ls_id) area_fi,
    (select ls_id, sum(area) sum
    from area_em
    group by ls_id) area_em,
    (select ls_id, sum(area) sum
    from x
    group by ls_id) area_tot,
    (select sum(area) sum
    from x) area_gen
    where x.ls_id = area_ti.ls_id(+)
    and x.ls_id = area_t0.ls_id(+)
    and x.ls_id = area_fi.ls_id(+)
    and x.ls_id = area_em.ls_id(+)
    and x.ls_id = area_tot.ls_id(+)
    What do you think about solution??

  • Script to calculate the size of table

    I am very new to scripting. My first script i need to make is for finding the total size of my oracle tables.
    I have to provide two inputs that is the database name and tabale name
    and the script should give me the size. This script will also be incorporated in crontab for checking the size of a particular table which is for txn logging and will be mailing us when the size of the table reaches 1gigs.
    what i have in mind till yet is
    #!/usr/bin/ksh
    # Script to find sze of the table
    # usage ./truncate_table.ksh ORACLE_SID TABLE_NAME
    set -x
    export ORACLE_HOME=/opt/oracle/product/9.2.0.4
    SUMMARY=/tmp/truncate_table.log
    date > $SUMMARY
    export ORACLE_SID=$1
    echo $ORACLE_SID
    export TABLE_NAME=$2
    if [ -z $ORACLE_SID ]
    then
    echo "Oracle SID not set"
    exit
    fi
    export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/openwin/bin:/usr/dt/bin:/opt/rational/clearcase/bin:/usr/local/samba/bin:/
    export/home/oracle/bin:/u01/oracle/admin/adhoc:/opt/oracle/OPatch:/usr/ccs/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    ${ORACLE_HOME}/bin/sqlplus -s '/ as sysdba'<<EOF>>$SUMMARY
    set pagesize 0 feedback on verify on heading off echo on
    select (bytes/1024/1024) as total_gigs from dba_segments where owner='SIEBEL' and segment_name='$TABLE_NAME'
    exit;
    EOF
    But this is not working...
    CAn someone help

    select (bytes/1024/1024) as total_gigs from dba_segments where owner='SIEBEL' and segment_name='$TABLE_NAME'You are missing ";" at the end of query. That's the reason why your script does not work.
    export TABLE_NAME=$2Why you did export of TABLE_NAME? This doesn't make sense. The same as ORACLE_SID export.
    Just use "TABLE_NAME=$2"

  • How to calculate the size and number of nodes in the btree?

    I need to determine the size of the btree nodes in the log file and the how many internal and leaf nodes in the btree. For example if I have 2.88M records approximately how much disk space is used up by the JE's internal structures? This info will help me determine the best size of the data records.

    Chad,
    Keys are stored in order in the btree. They are ordered by the custom comparator if one is used, otherwise by the default (unsigned byte) comparator.
    Key prefixing (when it is available -- remember that we're talking about a future feature here) reduces memory and disk space for the adjacent keys in a Btree node when the initial bytes of those keys are in common.
    If your keys that are adjacent (according to your custom comparator) don't have common bytes at the front, then key prefixing won't have any advantage.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Script to calculate space usage at the database level.

    Hi,
    Can someone provide me a script to calculate the Total space, Used space and Free space for all tablespaces within a database??
    I have been trying to use the below combinations in my queries and both provide different results..
    1) dba_data_files & dba_free_space
    select t.tablespace, t.totalspace as " Totalspace(MB)", round((t.totalspace-fs.freespace),2) as "Used Space(MB)", fs.freespace as "Freespace(MB)", round(((t.totalspace-fs.freespace)/t.totalspace)*100,2) as "% Used", round((fs.freespace/t.totalspace)*100,2) as "% Free" from (select round(sum(d.bytes)/(1024*1024)) as totalspace, d.tablespace_name tablespace from dba_data_files d group by d.tablespace_name) t, (select round(sum(f.bytes)/(1024*1024)) as freespace, f.tablespace_name tablespace from dba_free_space f group by f.tablespace_name) fs where t.tablespace=fs.tablespace order by t.tablespace;
    2) dba_extents & dba_free_space
    select t.tablespace, t.totalspace as " Totalspace(MB)", round((t.totalspace-fs.freespace),2) as "Used Space(MB)", fs.freespace as "Freespace(MB)", round(((t.totalspace-fs.freespace)/t.totalspace)*100,2) as "% Used", round((fs.freespace/t.totalspace)*100,2) as "% Free" from (select round(sum(d.bytes)/(1024*1024)) as totalspace, d.tablespace_name tablespace from dba_extents d group by d.tablespace_name) t, (select round(sum(f.bytes)/(1024*1024)) as freespace, f.tablespace_name tablespace from dba_free_space f group by f.tablespace_name) fs where t.tablespace=fs.tablespace order by t.tablespace;
    Thanks in advance,
    regards,
    Arul S

    -- check the total,used and free space in tablespaces
    select     a.TABLESPACE_NAME,
         a.BYTES MB_total,
         b.BYTES MB_free,
         b.largest,
         a.BYTES-b.BYTES MB_used,
         round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
    from
              select      TABLESPACE_NAME,
                   sum(BYTES)/1048576 BYTES
              from      dba_data_files
              group      by TABLESPACE_NAME
         a,
              select      TABLESPACE_NAME,
                   sum(BYTES)/1048576 BYTES ,
                   max(BYTES)/1048576 largest
              from      dba_free_space
              group      by TABLESPACE_NAME
         b
    where      a.TABLESPACE_NAME=b.TABLESPACE_NAME
    order      by ((a.BYTES-b.BYTES)/a.BYTES) desc;
    Regards
    Asif Kabir

  • How to  calculate the monthly percentage of the goods delivered

    hi all,
    In my requirement i have to count the number of goods delivered to the customer per year and i have the calculate the percentage of goods delivered monthly.please help me .

    Hello Duygu,
    restrict the original cost keyfigure with a variable which is based on fiscal period (this will be actual cost). And then create a new keyfigure(copy of original keyfigure) and use same variable but in detail of restriction use -1 for offset( this will be previous). And then define a new formula and subtract actual from previous or opposite)
    Sarhan.

  • How to delete a user in SAP-CPS Version 7.0

    Hello,
    I created my users via UME ( User Management Engine of Java Application server). Unfortunately I used the wrong name convention, so I had to recreate all the users in UME. Afterwards I delete all wrong users in UME.
    Than I tried to login with my new user in SAP-CPS (users are normally created in SAP-CPS during first login) but I get the error message that I reached the maximum number of 10 users allowed in the basic version. No problem I thougt, I simply delete the wrong ones in SAP-CPS. But I do not know how to delete a user! I could not find any menu item or any describtion in the manualls how to delete an user in SAP-CPS.
    I remove the users from any Isolation group, I disabled all the users but still I could not find any way to delete them.
    Has any body a hint for mor.
    Kind regards
    Frank Morleo

    Hello Anton,
    deactivating the unused users made it possible to login with the new ones. 
    Thanks for your help.
    Now I have to find out how to clear the deactivated users from the list.
    Regards
    Frank

  • How to calculate the total of absences? How to collect data from a specific line of a table?

    Hi,
    Again, I made a nice coloured picture from a screen capture which summarise the improvements that I would like to make in my form,
    Situation:
    For an educational purpose, I made this form   to simplify the way of recording the data and also to develope the independence of the students.
    ( I am doing this on a voluntary basis, working extra hours on my free time but I don't really mind because I am learning a lot of things in the same time)
    After being tested by the teacher, the student has to record the short date, the lines memorised, his grade, number of mistakes, and his attendance.
    I created everything in Word, then converted the file in PDF, then I created all the different fields with Adobe acrobat.
    There is in total 4 sheets, there are all similar except the first one in which there is a box with: date started, date finished, total time spent, absences.
    Below this box there is a table with 16 lines from (A to P) and 7 columns (Days, Date, From.. to.. , Grade, No. lines memorised, No. Errors, Attendance) ( so this table is present on all the sheets)
    Due to the fact that some students need more time than others, and also beacause some text need more time, I estimated a need of 4 sheets at the very most.
    I would like to make the following amelioration and automate the inputting of some of the data because I know that some of the students will certainly forget, so to avoid this scenario I am trying to make this form the easiest possible.
    screen capture of the form:
    screen capture of the form editing, you can see the names of the different fields:
    here is the form (only the first page) : http://cjoint.com/12fe/BBotMMgfYIy_memorisation_sheet_sample.pdf
    In  yellow 00000:
    At present, the students has to input the total of absences manually, is there a way ( script) to automate this by initialising the field next to "Absences" at  " 0 day"   and then everytime that Absent is selected from the COMBO BOX, it add 1 and it is displayed like this:  " 1 day" then " 2 days"  then " 3 days" etc … (so from what I read I have to initialise a counter a the beginning and then for (i...   ) count= count++; something like this...
    Furthermore, I need a solution to overcome the possibility that a second sheet may be needed for the same student; therefore I would need the data from the "attendance column" from the second sheet ( and perhaps the 3rd and 4th aswell) to be added on the "absences field" in the first sheet
    My idea: everytime that the short date is inputted in the first line (next to A) in the "Date" column of one of the 4 sheets then we check the 16 Combo box of the attendance column in this sheet instead to check 16*4=64 fields fot the 4 sheets in one go?
    but I don't know at all how to write it in Javascript. Or perhaps there is a way more easier than that?
    Shall I allocate a value for Absent on the “ export value”?
    In purple
    At present I wrote a simple script which matches the number of lines to the poem selected (Eg.  if I select the poem V.Hugo,  the number "36" will appear next to Number of lines).
    Again I would like the make the life of the students very easy so I would like a script which detects this number “36” on the "From .. to …" column,  as soon it is detected (on the first sheet or 2nd or 3rd or 4th)  check from the same line if "A / Pass" or "B / Pass" have been selected in the "Grade" column ,if yes the short date inputted on this line will be written on the field next to "Date finished" .
    this is a simple example with 36 lines only but somethimes, the students may have to memorise 80 lines and more, this is the reason for having 4 sheets in total.
    So basically I would like to automate the field next to" Date finished:" with a script that collect the short date from the day in which the student has finished his memorisation with "A / Pass" or "B / Pass"
    As for the "Total time spent" George Johnson helped me with a script that calculate the difference betwen date started and date finished (thank you)
    I am sollicting your help, because after trying for hours I was really confused with the different if/else needed. And in top of that, it’s my first experience with Javascript.
    I anticipate your assistance, thanking you in advance.

    I found this for counting the absences, its give you the total that's perfect, but is there a better methode which avoid me to write all the fields name, more simple????
    ( I found the idea here : Re: Total number added automatically  )
    // custom calculation script for field "Total #"
    function CountFields(aFields) {
    var nFields = 0;
    for(i = 0; i < aFields.length; i++) {
    try {
    // count null values, export value of Absence is 0;
    if(this.getField(aFields[i]).value == "0") nFields++;
    } catch(e) {
    if(e['message'] == "this.getField(aFields[i]) has no properties") app.alert("unknown field name: " + aFields[i]);
    else app.alert(e.toString());
    } // end catch
    } // end for aFields
    return nFields;
    // create array of field names to count
    var aNames = new Array("Sheet1AttendanceA","Sheet1AttendanceB","Sheet1AttendanceC","Sheet1AttendanceD","Sh eet1AttendanceE","Sheet1AttendanceF",
    "Sheet1AttendanceG","Sheet1AttendanceH","Sheet1AttendanceI","Sheet1AttendanceJ","Sheet1Att endanceK","Sheet1AttendanceL",
    "Sheet1AttendanceM","Sheet1AttendanceN","Sheet1AttendanceO","Sheet1AttendanceP" );
    // count the non-null fields;
    event.value = CountFields(aNames);
    As for the 2nd question, I've tried to do something similar to the previous script, but of course it doesn't work, but I am quite sure that the idea is similar:
    I don't know also how to add the other condition: the student should get A / Pass or B / Pass in order to consider he has finished??? and also how to check these condition from page 2, 3 and 4 and collect the date
    function Datefinished(bFields) {
    d2.value = nFields[i].value;
    for(i = 0; i < aFields.length; i++) {
    try {
    if(this.getField(aFields[i]).value == this.getField("NumberLines").value) d2.value = nFields[i].value;
    } catch(e) {
    if(e['message'] == "this.getField(aFields[i]) has no properties") app.alert("unknown field name: " + aFields[i]);
    else app.alert(e.toString());
    } // end catch
    } // end for aFields
    return nFields;
    // create array of field names to check
    var aNames = new Array("Texte00","Texte54","Texte56","Texte58","Texte60","Texte62","Texte64","Texte66","Te xte68","Texte70","Texte72","Texte74","Texte76","Texte78","Texte80","Texte82");
    var bNames = new Array("d1","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14 ","d15","d16","d17");   // d1 is included because in some cases a student can finish in 1 day (short text);

Maybe you are looking for