How to get total at each hierarchy

Hello Gurus,
Does anybody know how to get total at each  level.
I mean, if I have the following structure...
Level 1
Level 2
Level 3
Level 4
Level 5
At level 5 we have the following calculation
Volume      Price    Amount(From Formula Volume * price)
5                 2           10,00
6                 3           12,00
7                 4            28,00
My question is how to get  a sum of (10,00 + 12,00 +28,00 = 50,00) at level 4?
Thanks in advance.
With regards,
Anand

Does anybody know how to get total at each level.
I mean, if I have the following structure...
Level 1
Level 2
Level 3
Level 4
Level 5
At level 5 we have the following calculation
Volume       Price       Amount(From Formula Volume * price)
5                     2                 10,00
6                     3                 12,00
7                     4                  28,00
I am getting following results : It is adding volume and price then multiplying volume * price and giving results.
18                  9                18 * 9 = 162,00
But I have to get sum of  ( 10,00 + 12,00 +28,00 = 50,00) at level 4.
My question is how to get a sum of (10,00 + 12,00 +28,00 = 50,00) at level 4?
Thanks.
With regards,
Anand

Similar Messages

  • How to get total in ALV report in same Internal table?

    Data : Begin of it_data,
            kunnr type kunnr,
            name1 type name1,
            amt1  type btrt01, " CURR 15,2
           end of it_data.
    loop at it_data into wa_data
    endloop.      
    Hello friends,
    I am developing one ALV report with 20 rows.
    I have filled one internal table with some fileds like amount.
    I want to get total of all amount1 in AMT1 field.
    So, How to get total of amount in same internal table in ALV report ?
    It is ok if i get duplicate rows in internal table.
    Points 'll be awarded soon.
    Regards,
    NVM

    Hi Ronny,
    the alv output will display the sum at the last row.
    for this functionality u have do this logic.
    data: lw_fcat type slis_fieldcat_alv.
    data: lt_fcat type slis_t_fieldcat_alv/
    wa_fcat-fieldname = 'AMT1'.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-do_sum = 'X'.
    append wa_fcat to lt_fcat.
    and then pass it to reuse_alv_grid_display function,
    regards,
    Santosh Thorat

  • How to get total number of days

    Hi All,
    how to get total number of days , for example if month eq 05 then need to get total number of days until MAY 31.
    and how to get total number of days in a month.
    Thank You,,
    Sriii..

    Hi Sridhar,
    Pls Try to search before posting general questions.
    Try this,
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis                   = p_lv_date1
          i_datum_von                   = p_lv_date2
       IMPORTING
         e_tage                        = p_e_date_difference
       EXCEPTIONS
         days_method_not_defined       = 1
         OTHERS                        = 2
      IF sy-subrc  0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Regards,
    Sunil kairam.

  • How to get LASTDAY for each and every month between given dates..

    Hi Friend,
    I have a doubt,How to get LASTDAY for each and every month between given dates..
    for ex:
    My Input will be look like this
    from date = 12-01-2011
    To date = 14-04-2011
    And i need an output like
    31-01-2011
    28-02-2011
    31-03-2011
    is there any way to achieve through sql query in oracle
    Advance thanks for all helping friends

    Here's a 8i solution :
    select add_months(
             trunc(
               to_date('12-01-2011','DD-MM-YYYY')
             ,'MM'
           , rownum ) - 1 as results
    from all_objects
    where rownum <= ( months_between( trunc(to_date('14-04-2011','DD-MM-YYYY'), 'MM'),
                                      trunc(to_date('12-01-2011','DD-MM-YYYY'), 'MM') ) );
    The above two query is worked in oracle 11GActually the first query I posted is not correct.
    It should work better with
    months_between(
       trunc(to_date(:dt_end,'DD-MM-YYYY'),'MM'),
       trunc(to_date(:dt_start,'DD-MM-YYYY'),'MM')
    )Edited by: odie_63 on 12 janv. 2011 13:53
    Edited by: odie_63 on 12 janv. 2011 14:11

  • How to get total of any field in sapscript?

    Hello ,
    i m making sapscript...
    How to get total of any field in sapscript?

    Hi
    Yes, you can define a variabe in your print program and pass it to the SAPScript.
    LIKE:
    Define L_SUM in the Global data.
    DATA: L_SUM TYPE BSEG-DMBTR.
    LOOP AT ITAB.
    L_SUM = L_SUM + ITAB-AMOUNT.
    ENDLOOP.
    CALL FUNCTION 'WRITE_FORM'
    WINDOW = 'MAIN'
    ELEMENT = 'TOTAL'.
    Now, in your SAPScript, create a text element in MAIN window
    /E TOTAL
    Total,, &L_SUM&.
    Go through below link
    http://sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
    Regards,
    Chandru

  • How to get control on each row in advance table

    hi, i have a advanced table with some data, in each row i have two radio buttons which i need to set depending on some column value in the row, i tried by following code
    for(SoftCompVORowImpl row2 = (SoftCompVORowImpl)svo.first();row2!=null;row2=(SoftCompVORowImpl)svo.next())
    if(row2.getAttribute("CommitEndDate")==null || row2.getAttribute("CommitEndDate").equals(""))
    onetime.setSelected(true);
    recurring.setSelected(false);
    else
    onetime.setSelected(false);
    recurring.setSelected(true);
    but this code is making set only one radio button (onetime), which ever i am making first true its getting selected, i need to know how to get control of each row....

    Babu,
    Basically you should use the decode function in your sql query itself and attach it with BC4J properties of radio buttons.In that case you don't have to worry about setting them declaratively !
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get total available RAM

    Hi
    How to get total available RAM of the system. I used Runtime.getInstance().totalMemory(), it is not giving total memory of the system. I appreciate any help on this pl.
    Thx
    PK

    If there would be any operating system command
    displaying the desired result,
    we could execute it as runtime command and parse the
    output.
    But I don't know if such a command exists.
    I tried "mem", but it does not show the value I
    expected.For windows XP the following command (either in the cmd window or executed by Runtime.exec) will provide the physical memory size.
    systeminfo | find "Total Physical Memory"I don't know if it works in other Windows versions.

  • How to get total numbers and total price in query reports

    Hi,
    how to get total numbers and total price in query reports.for example:
    particular item is issued 3 times a week...I need total quantity of item issued
    my query...
    SELECT T0.[DocNum], T1.[ItemCode], T1.[Quantity], T1.[Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'

    Hi,
    Try this:
    SELECT T1.[ItemCode], SUM (T1.[Quantity]) as [Total Quantity], SUM (T1.[Quantity] * T1.[Price]) as [Total Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'
    Group By T1.[ItemCode]
    Beni.

  • How to get total number of result count for particular key on cluster

    Hi-
    My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
    To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
    Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
    Thanks in advance.
    Prashant

    user11100190 wrote:
    Hi,
    Thanks for suggesting a soultion, it works well.
    But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
    Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
    If you want to do paging, you can use the LimitFilter class.
    If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
    What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
    This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
    We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
    You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
    Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
    No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
    The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
    At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
    On the storage node you should have a static HashMap.
    The filter should do the following two steps while being synchronized on the HashMap.
    1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
    2. Enqueue the total number count you want to pass to the aggregator into that queue.
    The parallel aggregator should do the following two steps while being synchronized on the HashMap.
    1. Dequeue a single element from the queue, and return it as a partial total count.
    2. If the queue is now empty, then remove it from the HashMap.
    The parallel aggregator should return the popped number as a partial total count as part of the partial result.
    The client side of the parallel aware aggregator should sum the total counts in the partial result.
    Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
    Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
    Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
    Best regards,
    Robert

  • MDX How to get total distict count and SUM of subgroups?

    with
    MEMBER Measures.[EmailCount] as IIF(ISEMPTY([Measures].[Tran Count]), 0 ,[Measures].[Tran Count])
    MEMBER Measures.AdvGroupTotal as
    SUM (
    FILTER( EXISTING ([Dim IFA Details].[Parent Key].[Adviser Group].Members * [Dim Date].[Fiscal].[Fiscal Year].members )
    , Measures.[Amount] > 100 )
    , Measures.[Amount])
    MEMBER Measures.[AdvGrpCount] as
    distinctCOUNT(Existing([Dim IFA Details].[Parent Key].[Adviser Group].Members * [Dim Date].[Fiscal].[Fiscal Year].members))
    member Measures.IncomePerEmail as Measures.AdvGroupTotal /Measures.[EmailCount]
    member Measures.AvgIncomePerFirm as Measures.AdvGroupTotal/ Measures.AdvGrpCount
    SELECT { [Measures].[Amount] , Measures.[EmailCount], Measures.AdvGroupTotal, Measures.[AdvGrpCount],
    Measures.IncomePerEmail, Measures.AvgIncomePerFirm }
    ON COLUMNS,
    [Dim Date].[Fiscal Year].[Fiscal Year].ALLMEMBERS * [Dim Date].[Fiscal Quarter].[Fiscal Quarter].ALLMEMBERS *
    Except( [Dim Income Range].[Hierarchy].[Range ID].Members , [Dim Income Range].[Hierarchy].[All].UNKNOWNMEMBER.UNKNOWNMEMBER )
    on rows
    FROM [Income and Emails Cube]
    where
    [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14]
    The query above returns :
    How can I get Totals for AdvGroupTotal and AdvGroupCount for the year ?
    In the above case I want to tally up 1586 + 67 + 155 + 12 + 1718 for AdvGroupCount, same applies for the corresponding
    AdvGroupTotal figures.
    Seems simple enough, but I seem unable to come up with a way around this.
    Jon

    I worked it out with the help of Simon from another forum.
    Using a filtered set will get me the result required. It is however not very quick, so I probably should look into building it into the cube.
    WITH SET [Filtered Groups] AS
    ( Filter (
    { [Dim IFA Details].[Parent Key].[Adviser Group] } *
    { [Dim Date].[Fiscal Year].CurrentMember },
    [Measures].[Amount] > 100
    MEMBER [Measures].[Annual] AS
    Sum ( [Filtered Groups], Measures.[Amount] )
    MEMBER [Measures].[Firm Count] AS
    DistinctCount ( [Filtered Groups] )
    MEMBER [Measures].[Avg Income Per Firm] AS
    [Measures].[Annual] / [Measures].[Firm Count]
    MEMBER [Measures].[Test] AS
    Sum (
    { [Dim Date].[Fiscal Quarter].[Fiscal Quarter] } * { [Dim Income Range].[Hierarchy].[Range ID] } * { [Filtered Groups] },
    [Measures].[Amount]
    MEMBER [Measures].[TotalCount] AS
    DistinctCount (
    { [Dim Income Range].[Hierarchy].[Range ID] } * { [Filtered Groups] }
    MEMBER [Measures].[TotalAvg] as [Measures].[Test]/ [Measures].[TotalCount]
    MEMBER [Measures].[Quarter] as [Measures].[Amount]
    SELECT
    { [Measures].[Quarter], [Measures].[Annual], [Measures].[Firm Count], [Measures].[Avg Income Per Firm],
    [Measures].[Test], [Measures].[TotalCount], [Measures].[TotalAvg] } ON COLUMNS,
    [Dim Date].[Fiscal Year].[Fiscal Year].AllMembers * [Dim Date].[Fiscal Quarter].[Fiscal Quarter].AllMembers *
    Except ( [Dim Income Range].[Hierarchy].[Range ID].Members, [Dim Income Range].[Hierarchy].[All].UnknownMember.UnknownMember )
    DIMENSION PROPERTIES Member_Unique_Name, MEMBER_CAPTION
    ON ROWS
    FROM [Income and Emails Cube]
    WHERE [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14]

  • How to get sum for each currency's in ALV Report

    Hi,
    A column has amounts with various currency's.
    May I know how to get sum quantity for each currency in ALV Report?
    Thanks in advance.

    Hi,
    Currency value column should have reference to currency code column.
    Regards,
    Wojciech

  • How to get total number of nodes in a JTree?

    Hi,
    I am trying to get total number of nodes in a JTree, and cannot find a way to do it.
    The current getRowCount() method returns the number of rows that are currently being displayed.
    Is there a way to do this or I am missing something?
    thanks,

    How many nodes does this tree have?
    import java.awt.EventQueue;
    import javax.swing.*;
    import javax.swing.event.TreeModelListener;
    import javax.swing.tree.*;
    public class BigTree {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    TreeModel model = new TreeModel() {
                        private String node = "Node!";
                        @Override
                        public void valueForPathChanged(TreePath path,
                                Object newValue) {
                            // not mutable
                        @Override
                        public void removeTreeModelListener(TreeModelListener l) {
                            // not mutable
                        @Override
                        public boolean isLeaf(Object node) {
                            return false;
                        @Override
                        public Object getRoot() {
                            return node;
                        @Override
                        public int getIndexOfChild(Object parent, Object child) {
                            return child == node ? 0 : -1;
                        @Override
                        public int getChildCount(Object parent) {
                            return 1;
                        @Override
                        public Object getChild(Object parent, int index) {
                            return node;
                        @Override
                        public void addTreeModelListener(TreeModelListener l) {
                            // not mutable
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(new JScrollPane(new JTree(model)));
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }But for bounded tree model using DefaultMutableTreeNode look at bread/depth/preorder enumeration methods to walk the entire tree. Or look at the source code for those and adapt them to work with the TreeModel interface.

  • How to get total number of pages from .doc file without using Office interop?

    Hi,
    Kindly help me in getting the total number of pages from a .doc file not .docx file using C#. I know how to get by using Office interop but I do not want to use Office interop.
    So, without office automation in C# let me know how to get the total number of pages from a .doc file.
    Regards,
    Ashok

    Hi Ashok,
    >> I know how to get by using Office interop but I do not want to use Office interop
    Could you tell us why you don't want to use Office interop?
    As far as I know, this is the easiest way to achieve.Hmmm,this is my answer
    http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagenumbers.startingnumber(v=office.14).aspx
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get total number of licenses

    Hi everyone,
    Who knows how to get the total number of licenses, I am using SBO 2005 PL07+VB.Net. from SDK help file I saw there is a SAP Business One License API, but I cann't find this API from object browse, who knows which file contents the license API.
    Thanks in advance!
    Kathy

    Hi Kathy,
    Since (un-?)fortunately the license server has been moved from DCOM to CORBA, this information is currently obsolete (I still hope we will get this information through the SDK some time in future...).
    As an interim solution you will have to get this information from the B1LicenseFile.txt file through some small application you write (you could have e.g. a service that writes the information you are interested in into some table in some database - and retrieve this information through a SQL statement).
    HTH,
    Frank

  • How to add totals for each page in main window

    hi
      i have problem in scripts
      how to add total in first page ending and carry it to second page , at the end of second page again adding total and so on until last page.
    very urgent
    regards
    ratna

    Hi,
    Check these
    http://help.sap.com/saphelp_40b/helpdata/en/d1/8035c3454211d189710000e8322d00/content.htm
    http://membres.lycos.fr/jolyeric/SAP/Note_de_Cours_Ben/Sapscript/SAPscript_Control_Commands.doc
    try to use the command 'summing' along with one text symbol .Keep the if condtion when page changes at that time u dispay the total as ur keeping the total in text symbol it can be dispayed in the next page
    or this is round about way
    loop at <table>.
    call write_form.
    endloop.
    here u declare a variable 'c' and increment it by 1 in each loop. Then u chgeck if the program has started printing second page then u can print the number of records before printing the next page.
    eg :
    data : c type c value '0'.
    loop at <table>.
    c = c + 1.
    call write_form.
    endloop.
    in form:
    check when the next page is being printed, then u can print the number
    of lines 'c'.
    Feel free to revert back.
    --Ragu

Maybe you are looking for