Attribute SUM

Hi <BR><BR>I Would Like to Know That How to get SUM of Attribute Members in Essbase Calc Script<BR><BR>for example<BR><BR>in entity dimension(named CostCenter), it has attribute member(member is Game)<BR><BR>then I want to know the value of sum of attribute members<BR><BR>base script is<BR><BR>CostCenter->"Input"->Sales<BR><BR>What can i Fix this script correctly?<BR><BR>Thanks <BR><BR>

<p><b>Hi Sandeepaparadh and Ragil,</b></p><p> </p><p><b>Request you for the outline ,and sandeepaparadh , SUMRANGE isused only in the case where in we need to do the summationproviding a specific range .</b></p><p><b>For example for Feb to Aug , then we use Feb:Aug.</b></p><p> </p><p><b>So, how appropriate is the SUMRANGE in this context .</b></p><p> </p><p><b>Sandeep Reddy</b></p><p><b>HCC</b></p><p> </p><p> </p><p> </p>

Similar Messages

  • Report SUM not working (PL\SQL returning SQL query) using APEX_COLLECTION

    I have a simple query
    - select ename,sal from emp
    (In the Report attribute - SUM property is checked)
    I am getting the Report total SUM correctly...
    Now I am using the apex_collection object to display the same report.
    return select c001,c002 from apex_collections where collection_name = ''EMP'';
    c001 - ename
    c002 - sal (for this column - I am using Report total - SUM field is checked)
    ---- Issue is Report total SUM - is always displayed as 0. (actual sum is not coming).
    appreciate if I can get some input on this. I have tried a lot but no success..
    thanks,
    deepak

    Hi again
    Just checked a similar report test I did a while ago, and my query is:
    SELECT c001 MyText, TO_NUMBER(c002) MyNumber
    FROM HTMLDB_COLLECTIONS
    WHERE COLLECTION_NAME = 'ATD'
    So, you should use TO_NUMBER(c002)
    Andy

  • Parsing & handling of object and param tags

    Hi all,
    I'm working on allowing people to paste certain embedded video code into a wysiwyg / html editor we've built with the help of (amongst others) javax.swing.text.html.HTMLWriter.
    I'm facing the following problem here:
    When i try to parse the <object><param></param></object> piece, it removes the <param> tags, and incorporates these in the <object> tag. For example:
    <object width="300" height="250"><param name="allowscriptaccess" value="always"></param></object>becomes:
    <object width="300" height="250" allowScriptAccess="always"></object>All param tags get converted into the object tag as String attributes. Problem with this is that the allowScriptAccess attribute is not a valid attribute of the object tag.
    Is there any way to prevent this conversion so it will retain the <param> tags?
    Thank you in advance.
    Edited by: Floxxx on Dec 28, 2009 10:16 AM

    This seems to be default behaviour in HTMLWriter, function Write().
    There it retrieves all elements with their attributes. The attributes summed up in the param tags show up as attributes for the object tag.
    Edited by: Floxxx on Dec 28, 2009 10:54 AM

  • Summary columns and report

    Hi,
    We are using Oracle PL/SQL procedure to dynamically generate SQL to generate a report using HTMLDB.
    Could any one give me an idea about how to indirectly instruct HTMLDB to display 'sum' value if some of the fields are selected to be part of report? It is not possible to use report attribute 'sum' function, as we don't know what fields are on the report.
    Thanks,
    Neelam

    Even if you dont know what specific fields are on the report, you need to know their column positions at least. This way, you can use the Generic Columns on the report definition go to Report Attributes and select the Sum checkbox for column Cnn.
    If neither column positions, nor number of columns nor column names are known, well then, you are out of luck. Dynamic SQL is one thing, reading your mind is another! :)

  • Instantiation and Encapsulation

    Hi
    Can any one explain me about instantiation and Encasulation with example, i am new to ABAP Objects.
    Please dont send any links.
    Arun Joseph

    Hi,
    First let me give small introduction to OO ABAP programing.
    Object-oriented programming is a method of implementation in which programs are organized      as cooperative collections of objects, each of which represents  an instance of some class...?
    A class is a set of objects that share a common
    structure and a common behavior
    A class will have attributes ( i.e data definition) and methods ( nothing but functions )
    We can also call  object as Instance of the class.
    Lets see a simple demo class to calcualte SUM of 2 numbers.
    define 2 variables a and b of type i. (Attributes)
    SUM is the method name. this will have the logic to do the sum.
    2 importing paramers and an exporting parameter res for the method.
    Note: you can either create a class either globally or locally..
    Goto SE24 to create Global class, this class will be avaialable for use in all the programs, this is like class library with all global classes.
    Local class is the one which you create in SE38 i.e; your own program,
    by this it is understood that it's scope is only upto that program
    SO let us discuss the example with SE24(global class)
    give a class name, description,
    In the attributes tab, define a and b of type i, level as instance attribute and
    visibility as public That means these attributes are available outside this class also. we will come to this later.
    in the methods tab give name, level as instance, visibilty as pubilc again.
    now double click on the method name, it will take to you to write the code.
    (method implementation)
    just wirte between the method ---endmethod,
    res = num1 + num2.
    come back to methods tab, click on parameters button, to define exporting, importing etc.. paramters for your method,
    define 'res' as an exporting parameter, 2 variables num1 and num2 as importing parameters.Activate the class.
    now you have defined a class.
    whenever you want the logic to sum 2 variables, in all those cases you can make use of the SUM method in this class. This is what Reusability is.A very imp. feature of OO ABAP.
    So now comes Instantiation.
    you can't directly access a class.
    You have to create a reference variable of the type of the class, then create an object with the reference variable. (memory allocation).
    This step is called Instantiation or Instantiating the class
    For this go to se38, in which ever program you want to instatantiate the above class.
    do as below.
    data: obj type ref to zsow_cl1.
    start-of-selection.
    create object obj.
    Now object of the above class is ready for you.
    Now all the contents i.e either attributes or methods etc of the class can be accessed with this object
    now you have to call the method 'sum' of the above class using the above object in your program for the sum functionalty.
    for that click on Pattern button select 'Abap Object Patterns' press enter
    select 'Call method' radio button, give your object name ('OBJ')
    class name  ( ZSOW_CL1)
    give the method name (SUM)
    class and method names can be selected from the F4
    press enter.
    you will get the below line in your program
    CALL METHOD OBJ->SUM
      EXPORTING
        NUM1   =
        NUM2   =
    *  IMPORTING
    *    RES    =
    now define 2 variables of type i to pass the inputs to the method and one more vairable to hold the output coming from the FM
    on the whole code in your se38 is as follows.
    DATA: OBJ TYPE REF TO ZSOW_CL1,
          X TYPE I,
          Y TYPE I,
          Z TYPE I.
    START-OF-SELECTION.
      CREATE OBJECT OBJ.
      X = 10.
      Y = 10.
      CALL METHOD OBJ->SUM
        EXPORTING
          NUM1 = X
          NUM2 = Y
        IMPORTING
          RES  = Z.
      WRITE: Z.
    so Z will give the output.
    Next is Encapsulation
    while defining the method i asked you to give the visibility as Public.
    Visibility can be of 3 types:
                  Public
                  Protected
                  Private
    public means as i said above the method or varaibles can be used outside the class also.as you did above outside the class you have created an object to the class and
    accessed the method.
    private means the attributes/methods that you define in the class can only be accessed in/by the method of the same class, they cannot be accessed anywhere else and outside.
    change your 'a' parameter visibilty to private and try the below code in se38.
    obj->b = 10.
    obj->a = 10.
    1st line doesn't give error, since 'b' is public attribte,
    2nd line will give error since 'a' is now private.
    you can use 'a' in the 'SUM' method if you want.
    Protected means it can't be accessed outside of the class like with the help of object, but can be accessed in  the child class if defined to the above class.
    just post if you have any other doubts after trying this example.
    Do reward points if it helps you.
    Regards,
    Sowjanya

  • Hi ppl..doubts on private class

    Final warning.  Please use a more meaningful subject in future.  And please don't use "hi ppl" in the subject.
    hi ppl,
              To access the private class one method is to declare the methods in public section and data in private section.But how can i access fi i declare the methods and data in private section itself.I think,the answer is with in that class itself.below is the code i sis so far,but iam unable to achieve the value that is in variable 'sum'.pls iam a new to oops concept..guide me
    REPORT  Y_OOPS_FOR_DEMO.
    * public section.
    data: a type i value 1,
            b type i value 2,
           C type i,
           SUM TYPE I.
    class cl definition.
      private section.
    methods: zdev importing c type i
    *                        D TYPE I
                    exporting a type i
                             b type i.
    endclass.
    class cl implementation.
      method zdev.
    sum = a + b.
    endmethod.
    endclass.
    data: m type i.
    class dev1 definition inheriting from cl.
    public section.
    data: k type i value 10.
    methods: asm.
    endclass.
    class dev1 implementation.
    method asm .
    m = sum + k.
    write:/ 'THE VALUE OF sum IS ', m.
      endmethod.
      endclass.
    DATA: OBJ TYPE REF TO dev1.
    * DATA: OBJ1 TYPE REF TO cl.
    START-OF-SELECTION.
    CREATE OBJECT: OBJ.
    CREATE OBJECT: OBJ1.
    END-OF-SELECTION.
    CALL METHOD OBJ->asm.
    Edited by: Matt on Dec 1, 2008 4:21 PM
    Edited by: Matt on Dec 1, 2008 4:37 PM

    Hello Priyank
    My first recommendation is to use the Pretty-Printer option because otherwise your report looks like classical spaghetti coding.
    Your variable SUM is always accessible because it is a global variable of the report and by no means linked to any class. Your PUBLIC SECTION must be within the class itself.
    Your class is a local public class because you can instantiate it using CREATE OBJECT statement. A private class cannot be instantiated directly but here you need to have a static (factory) method which does the instantiation for you.
    The private method ZDEV is never called and therefore useless. Since the public instance attribute SUM has no initial value and its is never changed its value is always equal 0. Therefore within method ASM the value of M is always equal to K (= 10). Thus, the output of you report will always be:
    THE VALUE OF sum IS 10
    *& Report  Y_OOPS_FOR_DEMO
    REPORT  y_oops_for_demo.
    "* public section.
    "DATA: a TYPE i VALUE 1,
    "       b TYPE i VALUE 2,
    "      c TYPE i,
    "      sum TYPE i.
    *       CLASS cl DEFINITION
    CLASS cl DEFINITION.
      PUBLIC SECTION.  " $TMP added
    DATA: a TYPE i VALUE 1,
           b TYPE i VALUE 2,
          c TYPE i,
          sum TYPE i.
      PRIVATE SECTION.
        METHODS: zdev IMPORTING c TYPE i
    *                        D TYPE I
                        EXPORTING a TYPE i
                                 b TYPE i.
    ENDCLASS.                    "cl DEFINITION
    *       CLASS cl IMPLEMENTATION
    CLASS cl IMPLEMENTATION.
      METHOD zdev.
        sum = a + b.
      ENDMETHOD.                    "zdev
    ENDCLASS.                    "cl IMPLEMENTATION
    DATA: m TYPE i.
    *       CLASS dev1 DEFINITION
    CLASS dev1 DEFINITION INHERITING FROM cl.
      PUBLIC SECTION.
        DATA: k TYPE i VALUE 10.
        METHODS: asm.
    ENDCLASS.                    "dev1 DEFINITION
    *       CLASS dev1 IMPLEMENTATION
    CLASS dev1 IMPLEMENTATION.
      METHOD asm .
        m = sum + k.
        WRITE:/ 'THE VALUE OF sum IS ', m.
      ENDMETHOD.                    "asm
    ENDCLASS.                    "dev1 IMPLEMENTATION
    DATA: obj TYPE REF TO dev1.
    * DATA: OBJ1 TYPE REF TO cl.
    START-OF-SELECTION.
      CREATE OBJECT: obj.
      CREATE OBJECT: obj1.
    END-OF-SELECTION.
      CALL METHOD obj->asm.
    Regards
      Uwe

  • How to aggregate a KF in BEX which is an attribute of a InfoObj (avoiding sum)?

    Hi all,
    i've a requirement in a report that now I'll try to explain in detail.
    We have a attribute (ZCOST) of a new infoobject (ZVEND) that i need to use in a new report using BEx analyzer (we have BI 7.3), the attribute ZCOST is a currency and an example of the report layout is the following
    Month
    ZCOST
    Ordered €
    KPI_2
    11.2014
    9500 €
    15000 €
    OK
    12.2014
    6200 €
    5000 €
    KO
    This is just an example of master data of infoobject ZVEND:
    ZVEND
    ZCOST
    1100000090
    3000 €
    1100000091
    6500 €
    1100000092
    3200 €
    The detail in the infocube for the months is this:
    0CALMONTH
    ZVEND
    11.2014
    1100000090
    11.2014
    1100000091
    12.2014
    1100000090
    12.2014
    1100000092
    So our goal is to have in the bex report under the column ZCOST the sum of the KPI for each different value of ZVEND, the problem is that of course the report is aggregate and I cannot sum the same ZVEND key more than once (this value is kind of a budget for ZVEND).
    It is clear what am i trying to do here?
    My problem is to avoid summation of all the values of ZCOST in the infocube, the drill dimension are variable so there isn't just the month usually.
    If anything is not clear feel free to ask for other details.
    Thanks
    Stefano

    Hi Nanda,
    at the moment what i've tried (and it seems to work although after not much testing) is to create a variable in Bex to use in a formula to pull data from master data of ZVEND.
    Table
    Material
    Cost
    No of PO items
    PO quantity
    Cost SUM
    F000000
    310.000,00 EUR
    0
    0 EA
    310.000,00 ERROR
    F000001
    99.000,00 EUR
    2
    20 EA
    396.000,00 ERROR
    F000002
    $ 150.000,00
    1
    10 EA
    300.000,00 ERROR
    F000003
    310.000,00 EUR
    1
    51 EA
    620.000,00 ERROR
    F000004
    $ 150.000,00
    0
    0 EA
    150.000,00 ERROR
    F000005
    $ 150.000,00
    0
    0 EA
    150.000,00 ERROR
    F000006
    $ 150.000,00
    0
    0 EA
    150.000,00 ERROR
    F000006
    310.000,00 EUR
    1
    10 EA
    620.000,00 ERROR
    F000007
    310.000,00 EUR
    2
    70 EA
    1.240.000,00 ERROR
    F000008
    310.000,00 EUR
    1
    74 EA
    620.000,00 ERROR
    This is an example of what I did, the first column is the right value, it shows the unaggregated data from master data of ZVEND even if there are several rows for eache material.
    The last column is (Cost SUM) is the aggregated data, which is wrong, because the Cost is summed for every row in the report.
    Regards
    Stefano

  • View Object transient attribute (Calculate sum) using groovy problem

    Hi
    I have a read only view object named "ConnectionVVO". And it has database field name "points"(type is number).
    Now I need to take the sum of points.
    For this I did the following.
    Self view object added to the same view object as a view accessor named "ConnectionVVO1".
    Created a transient attribute named "TotalPoints".
    Added following groovy as the value expression of the above transient attribute.
    adf.object.ConnectionVVO1.getRowSet().sum("points")after that when I run the application module and run the view object it was extremely slow. Actually nothing was appeared. There after I modified the sql statement and added a where clouse to select few rows.
    Then it was appeared without slowness.
    The table has around 11 million records.
    Could you please provide a hint or any alternate way for doing this(getting the sum of points).
    Please help.
    Edited by: deshan on Mar 9, 2011 2:56 PM

    Hi Timo,
    Thank you very much for the explanation and direction. I will do that way. I have found that implementing view object and view row class I could do the similar kind of thing for the transient attribute.
    public Number getTotalPoints() {   
    RowIterator con= getConnectionViewImpl();
       Number sum = new Number(0);
       while (con.hasNext()) {     
          sum = sum.add( (Number)con.next().getAttribute("Points"));
        }    return sum;
      } took form
    http://technology.amis.nl/blog/1295/creating-a-dynamic-ajax-column-footer-summary-in-a-table-component-using-adf-faces
    But it also slow as 1 st method
    I am wonder whether both ways behave as similarly or they are totally different implementation?

  • Sum on child nodes based on attribute value in xslt

    Hi all,
    Any one can post helpful code to calculate the sum of child nodes based on the attribute value of other child node.
    Let's say for example.
    I have one child element has attribute value let's say Tax so I have to put condition on child element having value of "Tax" I need to calcualte sum of Invoice amount that element is also child node
    After calculating sum I have to apply that sum at the header level of the Invoice. For each Invoice I have calculate sum and apply at the header level.

    It isn't working :(.Got the following error:
    An error was reported compiling the XPath expression: error: XPath expression invalid, not a selection: declare namespace ws = 'http://www.bea.com/wli/sb/transports/ws';
    declare namespace tuxedo = 'http://www.bea.com/wli/sb/transports/tuxedo';
    declare namespace wsa = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
    declare namespace http = 'http://www.bea.com/wli/sb/transports/http';
    declare namespace xsi = 'http://www.w3.org/2001/XMLSchema-instance';
    declare namespace wsp = 'http://schemas.xmlsoap.org/ws/2004/09/policy';
    declare namespace file = 'http://www.bea.com/wli/sb/transports/file';
    declare namespace xsd = 'http://www.w3.org/2001/XMLSchema';
    declare namespace soap12-env = 'http://www.w3.org/2003/05/soap-envelope';
    declare namespace flow = 'http://www.bea.com/alsb/flow/transport';
    declare namespace sftp = 'http://www.bea.com/wli/sb/transports/sftp';
    declare namespace sb = 'http://www.bea.com/wli/sb/transports/sb';
    declare namespace soap-enc = 'http://schemas.xmlsoap.org/soap/encoding/';
    declare namespace ejb = 'http://www.bea.com/wli/sb/transports/ejb';
    declare namespace soap-env = 'http://schemas.xmlsoap.org/soap/envelope/';
    declare namespace jpd = 'http://www.bea.com/wli/sb/transports/jpd';
    declare namespace email = 'http://www.bea.com/wli/sb/transports/email';
    declare namespace tp = 'http://www.bea.com/wli/sb/transports';
    declare namespace dsp = 'http://www.bea.com/dsp/transport/sb';
    declare namespace ctx = 'http://www.bea.com/wli/sb/context';
    declare namespace soap12-enc = 'http://www.w3.org/2003/05/soap-encoding';
    declare namespace wsu = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd';
    declare namespace jms = 'http://www.bea.com/wli/sb/transports/jms';
    declare namespace ftp = 'http://www.bea.com/wli/sb/transports/ftp';
    fn:string(./xml-fragment/@IntObjectName).

  • Epm11 attribute dimensions sum

    In outline, there are 13 dimensions:
    -YearTotal (Time Dimension)- Dense
    -Accounts - Dense
    -Scenario - Dense
    -Costing -Dense
    -Cumulative- Dense
    -Currency -Sparse
    -Company -Sparse
    -Doctype -Sparse
    -Years -Sparse
    -Sales Dep -Sparse
    -Geographics -Sparse
    -Customer -Sparse
    -Product -Sparse,
    and 6 attribute dimensions:
    -Standart
    -Anme
    -Hardness
    -Coat Type
    -Product Type
    -Logistics.
    Scenario dimension children : Actual and PYear (Previous Year value : Formula =@SHIFT ("Actual",-1,@LEVMBRS("Years",0)); ).
    For a material that was sold in 2009 and not sold in 2010:
    -if we dont use the Product Type attribute dimension, 2010->Pyear value is coming.
    Material Year Scenario Subtotal
    A 2010 Actual missing
    A 2010 Pyear 15000
    A 2009 Actual 15000
    -if we use the Product Type attribute dimension, 2010->Pyear is missing but it is not true.
    Material        Product Type_ Year Scenario Subtotal_
    A PT 2010 Actual missing
    A PT 2010 Pyear missing
    A PT 2009 Actual 15000
    I guess the reason is that there is no block for this material and year combination (A->2010) . What can I do ,can you give a suggesstion ?
    Thanks a lot.

    Yes they can.Basically, attributes are linked through to your base dimension anyway.You can either @withattr or @attribute in your filter.eg.WRITE/READ @attribute("bottle")where "bottle" is a member of your "pkg type" dimension say

  • How to get  all rows of an attribute data from a table?

    Hello.. I´m using Jdev 10.1.3.2
    I have a table with 5 columns and N rows.
    I need to create a backing bean method to count the value of all rows of a specifc column.
    I use
    JUCtrlValueBindingRef selectedRowData= (JUCtrlValueBindingRef)myTable().getSelectedRowData();
    to get an attribute from a selected row. but How can get from all rows?
    Thank you
    Vandré

    Hi Vandré
    I think this example of Steve Muench will help you.
    "Recalc Sum of Salary at the View Object Level
    This example illustrates a technique where a transient attribute of a view object is updated to reflect the total sum of some attribute of all the rows in the view object's default row set. The code to recalculate the sum of the salary is in the getSumOfSal() method in the EmpViewImpl.java class. The custom EmpViewRowImpl.java class for the view row implements the getter method for the SumOfSal attribute by delegating to this view object method. The EmpViewImpl class extends a base DeclarativeRecalculatingViewObjectImpl class that contains some generic code to enable declaratively indicating that one attribute's change should recalculate one or more other attributes. The EmpView defines the "Recalc_Sal" property to leverage this mechanism to recalculate the "SumOfSal" attribute. If you restrict the VO's results using the BC Tester tool, you'll see the sum of the salaries reflects the subset. If you add a new row or delete an existing row, the sum of sal is updated, too."
    http://otn.oracle.com/products/jdev/tips/muench/recalctotalvo/RecalcTotalOfRowsInVO.zip
    Good Luck

  • Concurrent Access does not modify an attribute

    Good day,
    I'm working on a multi-process environment, whose main class could be summed up as this:
    public Class ServerCluster {
         // In reality, this attribute belongs to a superior class and is protected
         private SolverCluster solverCluster;
         public void installSolver (SolverCluster newSolverCluster){
              // Tests here to check the newSolverCluster isn't null
              sychronized (this){
                   System.out.println("A new SolverCluster is given");
                   this.SolverCluster = newSolverCluster;
         public void mainProcess(){
              while (true){
                   synchronized (this){
                        if (this.solverCluster != null){
                             System.out.println("the solverCluster isn't null");
                             //That's where we want to go
                   thread.sleep(1000);
    }Basically, a process started from another class calls the method mainProcess and then stays inside.
    Then, another Java process connects to the serverCluster (by RMI) and calls the method installSolver.
    The problem is that the message "A solverCluster is given" is displayed, but when the process leaves the method, the attribute becomes null again and therefore the message "the solverCluster isn't null" in the mainProcess method is never displayed.
    (I'm using NetBeans 4.1.).
    Thank you

    Basically, a process started from another class calls
    the method mainProcess and then stays inside.Okay it loops checking then sleeping. Fine.
    Then, another Java process connects to the
    serverCluster (by RMI) and calls the method
    installSolver.Presumably this is the same serverCluster object
    The problem is that the message "A solverCluster is
    given" is displayed, but when the process leaves the
    method, the attribute becomes null again and
    therefore the message "the solverCluster isn't null"
    in the mainProcess method is never displayed.
    (I'm using NetBeans 4.1.).My best guess would be that they are different serverCluster objects.
    Does the real code use instances or statics? If statics you'd have to watch for classes being loaded in different classloaders and therefore having their own static values.

  • Summing up a Column in ALV report

    Hi All,
    I have developed an ALV Report which will display Invoices and other details.
    Now i need to display the sum of NETWR column, if user wish to select that column and click the "SUM" icon.
    As of now, if i select the NETWR column and click 'SUM" column, i am getting Runtime error.
    How to resolve this issue?
    Regards
    Pavan

    Hi Pavan,
    ALV GRID CONTROL:
    This task is performed by the SAP Control Framework.
    The R/3 System allows you to create custom controls using ABAP Objects. The application server is the Automation Client, which drives the custom controls (automation server) at the front end.
    If custom controls are to be included on the frontend, then the SAPGUI acts as a container for them.
    Custom controls can be ActiveX Controls or JavaBeans.
    The system has to use a Remote Function Call (RFC) to transfer methods for creating and using a control to the front end.
    ABAP objects are used to implement the controls in programs.
    An SAP Container can contain other controls (for example, SAP ALV Grid Control, Tree Control, SAP Picture Control, SAP Splitter Control, and so on). It administers these controls logically in one collection and provides a physical area for the display.
    Every control exists in a container. Since containers are themselves controls, they can be nested within one another. The container becomes the parent of its control. SAP containers are divided into five groups:
    SAP custom container: Displays within an area defined in Screen Painter on screens or sub screens.
    Class: CL_GUI_CUSTOM_CONTAINER
    SAP dialog box container: Displays in a modeless dialog box or as a full screen. Class:
    CL_GUI_DIALOGBOX_CONTAINER
    SAP docking container: Displays as docked, resizable sub-window with the option of displaying it as a modeless dialog box. Class: CL_GUI_DOCKING_CONTAINER
    SAP splitter container: Displays and groups several controls in one area - that is, splits the area into cells Class: CL_GUI_SPLITTER_CONTAINER
    SAP easy splitter container: Displays controls in two cells, which the user can resize using a split bar. Class: CL_GUI_EASY_SPLITTER_CONTAINER.
    In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.
    Standard functions are available in the control toolbar. The details display displays the fields in the line on which the cursor is positioned in a modal dialog box.
    The sort function in the ALV Control is available for as many columns as required. You can set complex sort criteria and sort columns in either ascending or descending order.
    You can use the 'Search' function to search for a string (generic search without *) within a selected area by line or column.
    You can use the 'Sum' function to create totals for one or more numeric columns. You can then use the "Subtotals" function to set up control level lists: You can use the 'Subtotal' function to structure control level lists: select the columns (non-numeric columns only) that you want to use and the corresponding control level totals are displayed.
    For 'Print' and 'Download' the whole list is always processed, not just the sections displayed on the screen.
    You can define display variants to meet your own specific requirements. For information on saving variants, see 'Advanced Techniques'.
    The ALV grid control is a generic tool for displaying lists in screens. The control offers standard functions such as sorting by any column, adding numeric columns, and fixed lead columns .
    Data collection is performed in the program (with SELECT statements, for example) or by using a logical database. The data records are saved in an internal table and passed on to the ALV control along with a field description.
    The field description contains information about the characteristics of each column, such as the column header and output length. This information can defined either globally in the Dictionary (structure in the Dictionary) or in the field catalog in the program itself. You can also merge both techniques.
    The ALV link is a standard function of Query and QuickViewer. If multiline queries or Quick View lists have been defined, they will automatically be compressed to a single line and output in the ALV control as a long, single line list.
    Use Screen Painter to create a sub screen container for the ALV grid control. The control requires an area where it can be displayed in the screen. You have to create a container control that determines this area.
    Use the corresponding icon in the Screen Painter layout to create the container control. The size of area "MY_CONTROL_AREA" determines the subsequent size of the ALV control.
    The valid GUI status must be set at the PBO event in the flow logic of the ALV subscreen container.
    The OK_CODE processing for the cancel functions must be programmed at the PAI event.
    The reference variables for the custom container and the ALV grid control must be declared.
    To create reference variables, use ABAP statement TYPE REF TO .
    The global classes you need to do this are called cl_gui_custom_container (for the custom container control) and cl_gui_alv_grid (for the ALV grid control).
    The global classes are defined in the Class Builder. You can use the Class Builder to display information for the methods, their parameters, exceptions, and so on.
    Use ABAP statement CREATE OBJECT to create the objects for the container and the ALV control. Objects Are instances of a class.
    When an object is created (CREATE), method CONSTRUCTOR of the corresponding class is executed. The parameters of method CONSTRUCTOR determine which parameters have to be supplied with data when the object is created. In the above example, object alv_grid is given the name of the container control (g_custom_container) in exporting parameter i_parent, which links the two controls. For information on which parameters method CONSTRUCTOR possesses and which of these parameters are required, see the Class Builder.
    Objects should only be created once during the program. To ensure that this is the case, enclose the CREATE OBJECT statement(s) in an IF IS INITIAL. ... ENDIF clause. The objects must be generated before the control is displayed for the first time - that is, during the PBO event of the ALV subscreen container.
    To display the requested dataset in the ALV control, the data must be passed on to the control as an internal table, and a field description must exist indicating the order in which the columns will be output.
    In the simplest case, the field description can use a structure from the Dictionary. The Dictionary also determines the technical field attributes like type and length, as well as the semantic attributes like short and long texts. The ALV control uses this information to determine the column widths and headers. The column sequence is determined by the field sequence in the structure.
    If no suitable structure is active in the Dictionary, or you want to output internal program fields in the control, then you will have to define information like the output length and column header in the field catalog.
    In a typical program run, the dataset is read first (SELECT ....), the internal table is filled with the data to display (... INTO TABLE ...), and ABAP statement CALL SCREEN is then used to call the ALV sub screen container.
    The data transfer to the ALV control takes place during the call of method
    set_table_for_first_display from class cl_gui_alv_grid. The method call must be programmed at the PBO event of the ALV subscreen container.
    The name of the Dictionary structure that supplies the field description is specified in exporting parameter i_structure_name. The name of the internal table that contains the data records to display is specified in changing parameter it_outtab.
    The field description for the ALV control can be ta ken from an active Dictionary structure (fully automatic), by passing a field catalog (manual), or through a mixture of the two options (merge).
    The field catalog is in internal table with type lvc_t_fcat. This type is defined globally in the Dictionary.
    Each line in the field catalog table corresponds to a column in the ALV control.
    The field characteristics (= column characteristics) are defined in the field catalog. The field catalog is in internal table with type lvc_t_fcat. Each line that is explicitly described in the ALV control corresponds to a column in the field catalog table.
    The link to the data records to output that are saved in internal table is established through field name . This name must be specified in column "fieldname" in the field catalog.
    This field can be classified through a Dictionary reference (ref_table and ref_field) or by specifying an ABAP data type (inttype).
    Column headers and field names in the detail view of an ALV control line can be determined in the field catalog in coltext and seltext, respectively.
    The position of a field during output can be determined with col_pos in the field catalog.
    If you want to hide a column, fill field no_out with an "X" in the field catalog. Hidden fields can be displayed again in a user display variant.
    Icons can be displayed in the ALV control. If you want a column to be interpreted as an icon, then the icon name must be known to the program (include .) and icon = "X" must be specified for this column in the field catalog.
    The above example shows a semi-automatic field description: Part of the field description comes from the Dictionary structure (sflight), while another part is explicitly defined in the field catalog (gt_fieldcat).
    The field catalog (internal table) is filled in the program and is passed on together with the name of the Dictionary structure during the method call. The information is merged accordingly in method set_table_for_first_display.
    For a user to save display variants, parameters is_variant and i_save must be passed on during method call set_table_for_first_screen. To assign display variants uniquely to a program, at least the program name must be supplied in the transferred structure (gs_variant).
    Program names can be up to 30 characters long.
    If you only pass on the current parameters for is_variant, then existing variants can be loaded, but no new ones can be saved. If you use parameter i_save, you must pass on a variant structure with is_variant.
    I_SAVE = SPACE No variants can be saved.
    I_SAVE = 'U' The user can only save user-specific variants.
    I_SAVE = 'X' The user can only save general (shared) variants.
    I_SAVE = 'A' The user can save both user-specific and general (shared) variants.
    You can use parameter is_layout of method set_table_for_first_display, for example, to define the header in the ALV control and the detail display.
    To do this, define a query area in the program in accordance with Dictionary structure lvc_s_layo, and pass on the text to display in field -grid_title or -detailtitl.
    If you want to create print lists with zebra stripes, set field -zebra to "X". You can display a print preview for print lists by requesting standard function "Print".
    All parameters of method SET_TABLE_FOR_FIRST_DISPLAY from global class
    CL_GUI_ALV_GRID are defined in the Class Builder.
    Events are defined in global class cl_gui_alv_grid; you can use these events to implement user interaction within the program. To respond to a double -click on a table line, you must respond to event DOUBLE_CLICK.
    You receive control in the program, allowing you to implement interactive reporting - such as a full screen details list. The events for cl_gui_alv_grid are located in the Class Builder.
    To define an implement a local class in the program, you use a handler method. In this handler method, you program the functionality to trigger by a double -click in the output table.
    To activate a handler method at runtime, a class or an object from that class registers itself with an event using command SET HANDLER. The names of the IMPORTING parameters in the handler method correspond to the names of the EXPORTING parameters of the related event.
    In the above example, the local class is LCL_ILS and the handler method is ON_DBLCLICK. An object - ALV_DBLCLICK - is created and registers itself for event DOUBLE_CLICK.
    You can query parameter e_row-index to determine which output line was requested by the double -click. This parameter corresponds to the line number of the output table (internal table with the data records to output). If you need information for the selected line, you have to read it with READ TABLE itab INDEX e_row-index.
    This subsequent read in the output table generally corresponds to the HIDE area in conventional reporting. You first have to make sure that the user has double -clicked a line in the output table (similar to the valid line selection with the HIDE technique).
    A field group can contain global data objects, but not data objects that have been defined locally in a subroutine or function module.
    You can use INSERT to specify both fields and field symbols. This makes it possible to dynamically insert a data object referred to by a field symbol into a field group at runtime. Any field symbols that have not been assigned are ignored, which means no new field is inserted into the field group.
    The EXTRACT statement writes all the fields of a field group as one record to a sequential dataset (transport takes place with similarly named fields). If a HEADER field group is defined, then its fields are placed ahead of each record as sort keys. You can then sort the dataset with SORT and process it with LOOP ...ENDLOOP. In this case, no further EXTRACT is possible.
    The INSERT statement is not a declarative statement: This means field groups can also be expanded in the program flow section.
    As soon as the first dataset of a field group has been extracted with EXTRACT, that field group can no longer be expanded with INSERT. In particular, the HEADER field group cannot be expanded after the first EXTRACT (regardless of the field group).
    When the GET events are processed, the logical database automatically writes hexadecimal zeros in all the fields of a node when it returns to an upper-level node in the hierarchy. Since the HEADER normally contains sort fields for all field groups, these hexadecimal zeros in the HEADER serve as a type of hierarchy key: The more zeros there are, the further up in the control level hierarchy you go.
    &#61550;&#61472;The SORT statement sorts the extract dataset in accordance with the defined field sequence in field group HEADER. The addition BY ... sets a new sort key.
    Each must be either a field of field group HEADER or a field group that consists only of fields of the field group HEADER. You can use the additions ASCENDING and DESCENDING to determine whether the fields are sorted in ascending (default) or descending order.
    Fields containing X'00' in the logical databases are always displayed before all other values during a SORT.
    Processing of an extract dataset always takes places within a LOOP. The contents of the extract dataset field are placed in program fields with the same names.
    The group change always involves the fields of the HEADER. Single record processing for extract datasets is performed using language element AT ( = field group).
    CNT() is not a statement, but instead a field that is automatically create d and filled when is a non-numeric field from field group HEADER and is part of the sort key. At the end of the group, CNT() contains the number of different values that the field recorded in this group level.
    SUM() is not a statement, but instead a field that is automatically created and filled when is a numeric field of an extract dataset. At the end of the group, SUM() contains the control total of field .
    *** and CNT are only available at the end of the group level or at AT LAST.
    Single record processing for extract datasets AT WITH is only performed when field group is immediately followed by field group in the temporary dataset.
    Loops over an extract dataset cannot be nested. However, several contiguous loops are permitted.
    The sequence of the control level changes within the LOOP must correspond to the sort sequence.
    Totals can only be calculated within control footer processing.
    Extracts allow only appends (EXTRACT), sorting (SORT) and sequential processing (LOOP).
    Once a SORT or LOOP has occurred, the intermediate dataset is frozen and cannot be expanded with EXTRACT. Operations that insert into or delete from EXTRACT datasets are not supported.
    Extracts allow for several record types (FIELD-GROUPS) with fields that can be set dynamically (INSERT is not a declarative statement!). Internal tables have a single, statically-defined line type.
    Internal tables use the sequence of table fields according to the declaration for the hierarchy of the control leve l. The control level structure for internal tables is therefore static, and is independent of which criteria were used to sort the internal table.
    Extracts do not depend on the field sequence for control level processing: a re-sort or a completely different control level process can take place. The control level structure for extract datasets is therefore dynamic. It corresponds exactly to the sort key of the extract dataset. The sort key is the sequence of fields from the field group HEADER, and is used to sort the extract dataset.
    Extracts rely on the compiler to determine which combinations of group levels and a cumulating field the control level totals desire. The desired control level totals are determined by the processing of LOOP ... ENDLOOP blocks. Internal tables build the control level total with the SUM statement.
    This procedure leads to high resource depletion for totaling control levels in internal tables.
    Regards,
    Chandru

  • SUM for a field in ALV

    Hello Guys,
    CAn any one tell me how to do the SUM for a particular column in ALV.It should display at the End of the records.The column field is TYPE N(4).
    My CODE is like this:
    CLEAR fc_tmp.
      fc_tmp-col_pos         =  5.
      fc_tmp-reptext_ddic    = 'POINTS'.
      fc_tmp-fieldname       = 'POINTS'.
      fc_tmp-tabname         = 'ITAB'.
      fc_tmp-outputlen       = 15.
      fc_tmp-key             = 'X'.
      fc_tmp-do_sum          = 'X'.
      APPEND fc_tmp TO fieldcat.
    This is not working.
    Thanks in Advance,
    Take care

    Hi,
    populate the IT_SORT internal table of REUSE_ALV_GRID_DISPLAY provided in the importing parameters.
    fieldname = Company Code
    append fieldname to it_sort.
    fieldname = division.
    append fieldname to it_sort.
    If you explicitly need subtotals then add the following line
    subtot = 'X'
    For obtaining sum you have an attribute "do_sum" in fieldcatalog , set it to 'X' and you should be able to do sum on that field.
    <b>Ensure that these should be numeric / currency or quantity datatypes only.</b>
    wa_fieldcat-datatype = 'CURR'.   or
    wa_fieldcat-datatype = 'QUAN'.
    Hope this solves your problem
    Cheers,
    Simha.
    PS : Please reward points if solution is helpful

  • OBIEE Report based on attribute dim or say base attribute value

    Hi,
    I have OBIEE and Essbase implementation and have set of attribute dimensions. I am trying to understand how can I create reports in OBIEE where I can use the attribute values to filter, group, sum my fact data. For example I have a hierarchy for Dimension Supplier Geography as below -
    Geography (Gen1 - Dimension)
    (Gen2, Region)
    (Gen3, Country)
    (Gen4, Supplier Parent)
    (Gen5, Supplier) (Attribute as Company Name)
    Sample :
    Supplier Geography
    -- East
    -- C1
    -- PS1
    -- S1 (Comp1)
    -- S2 (Comp2)
    -- West
    -- C2
    -- PS2
    -- S3 (Comp1)
    -- S4 (Comp2)
    -- C3
    -- PS3
    -- S5 (Comp3)
    -- S6 (Comp4)
    -- North
    -- C4
    -- PS4
    -- S7 (Comp3)
    -- S8 (Comp4)
    -- South
    -- C5
    -- PS5
    -- S9 (Comp1)
    -- S10 (Comp2)
    Now, I would like to report where I can display information based on the attribute and display across different level. This would require to create drop down for this attribute values. For example -
    A drop down showing values are Comp1, Comp2, Comp3, Comp4. When user selects Comp1 and assume that I have fact as sales amount, it should show report as below -
    Comp1
    Region Sales Amount
    East - 10,000
    West - 5,000
    South - 7,000
    I don't want to add a level as company as it would result in lot of redundant information. Also, I have got almost half million members and it would explode the size if I add more levels. Is there any better way to achieve this? Can I model this using alternate hierarchy? If so how would this exposed in OBIEE again?
    Appreciate your inputs.
    Thanks

    If you are sure of the number of attributes the user will be using as criteria is fixed and will not change, you should able to bind the literals to page items like:
    select emp.ename
    from emp
    join attribute_value a1 on a1.empno = emp.empno and a1.att_name = 'DEPT'
    join attribute_value a2 on a2.empno = emp.empno and a2.att_name = 'SALARY'
    join attribute_value a3 on a3.empno = emp.empno and a3.att_name = 'HIREDATE'
    where a1.att_numeric_value = :P1_dept_value
    and   a2.att_numeric_value = :P1_salary_value
    and   a3.att_date_value = to_date(:P1_hiredate_value,'YYYY-MM-DD');or
    select emp.ename
    from emp
    join attribute_value a1 on a1.empno = emp.empno and a1.att_name = :P1_att1_name
    join attribute_value a2 on a2.empno = emp.empno and a2.att_name = :P1_att2_name
    join attribute_value a3 on a3.empno = emp.empno and a3.att_name = :P1_att3_name
    where a1.att_numeric_value = :P1_att1_value
    and   a2.att_numeric_value = :P1_att2_value
    and   a3.att_date_value = to_date(:P1_att3_value,'DD-MM-DD');What happens when your user wants to add another attribute and use it as search criteria. You have to:
    1) add a JOIN clause to the SELECT
    2) add to the WHERE clause to the SELECT
    Warning personal opinion to follow: I would give up binding (i.e.. skipping parsing os the SELECT statement) for the flexibility of generating the SELECT at runtime. If the user adds a new attribute, then the PL/SQL code that assembles the SELECT statement would not have to be changed. All the meta data is stored in the database as to what the new column is and which column in the attributes table to use (ATT_NUMERIC_VALUE or ATT_DATE_VALUE). If your method of displaying the attributes and receiving the user's criteria is dynamic like my example, then you would not have to change the application at all for new attributes.
    Just my 2 cents worth of opinion,
    Mike

Maybe you are looking for

  • How do you change the page margins?

    Hi There, Since upgrading to Yosemite, I can't figure out how to change the page margins. If you look at the image below, I am trying to extend all of the margins so I can fit more text in. Thank you so much for your help!

  • Safari 4.1.3 Crashing

    My Safari has begun to crash on a regular basis, it began a couple of days ago. There is no specific website that I am visiting that it occurs on. Here is my latest error report. Any advise is much appreciated!!! Thanks! Date/Time:      2012-02-10 21

  • EM12c Upgrade failing at OMS  Configuration

    I'm in the process of upgrading and migrating from EM 10.2.0.5 on AIX 6.1 to EM12c on RHEL 6.2 via the 2-System Upgrade method. I've been following the steps in the MOS Note "EM 12c: Upgrading to Enterprise Manager Cloud Control 12.1.0.1 on Linux x86

  • Identification of Imported Tracks

    I have imported a large number of MDs via my wifes MP3 player which allows simple and easy sync encoding. However, the track identification is not easy. If I try using ident in iTunes it will not work as they were not loaded via iTunes, is their some

  • Email reply randomly will right justify, signature too

    This is my bosses iphone. When he replied to an email, his response and signature right-justified (So, while he was typing it is fine.) I searched all over and only found a left-right justification method relating to older iphones through adding an a