Sum of two columns

Hi guys
i need to insert one column in a row with forumla as col1+col2. how can i do that in simple tabular report. My two columns in XML are like this:-
<T_AMT>240.6</T_AMT>
<TAX_AMT>0</TAX_AMT>
Can i use substring function while creating template in word or i need to use substring while writing query...
thanks
Edited by: ObieeUser on 28-May-2010 03:07

Hi Vetsrini
thanks for your reply...
for showing sum of two columns:-
is it possible to do with GUI instead of writing code or doing tweaks in the sql... the main drawback of doing tweaks in sql is after i make changed in sql and then i click on sql builder it doesn't show me the changes which i have done....
Use of Substr/Decode/Case When or other oracle function
another question is like if i need to use substr function in sql can't i do it in SQL builder if yes then how as i have seen function drop down in sql builder but it doesn't show such function?
regards

Similar Messages

  • How do you get the sum of two columns multipied together?

    I can't seem to figure out how to get the sum of two columns multiplied together without having to manually type out each location (example: A1*B1+A2*B2+A3*B3, etc..).  Though the idea seems to be rather simple, everything I have tried has only given me an error.  I know there must be an easier way of doing this, but I get lost in the explanations given in 'help' area of numbers, can someone help me?

    C3=SUMPRODUCT(A3:A18, B3:B18)
    the function SUMPRODUCT() takes ranges and multiplies corresponding cells in the ranges, then adds them together.
    I the case I show SUMPRODUCT() performs:
    A3*B3 + A4*B4 + A5*B5 + A6*B6 + ... +  A18*B18
    If you want to perform the same operation on the whole column (s) you could modify the formula:
    C3=SUMPRODUCT(A, B)

  • Sum of two columns of Jtable in Jclient (summarized columns)

    I want to display the sum of two columns of Jtable in a text box, just as we use to do in Forms developer.
    How is this possible in Jclient.
    I would be glad if someone can give a detail info about it.

    Actually I wanted to sum the values of a column when a user enters a value in the Jtable when a new record is created. before it is commited
    That summarized value which I want in the textbox will then be used in the validation rule.

  • Compute sum of two columns - display result in the third column

    Hello,
    I have a report and I want to compute sum of two report columns and display the total in the third column.
    For example: Sample_My_Report
    Col1 Col2 Total (Col1+Col2)
    3 7 10
    can anyone help me out with this issue.
    thanks.

    thanks for replying. One more thing is that
    How can I compute Avg for a particular column in a Master detail report. I need the avg(sal) to be displayed at the end of the report similar to sum(reports total).
    Can you help me out with this issue.
    thanks.

  • Sum of two columns multiplied?

    hi, is there a simpler formula to achieve this?
    I want to multiply two columns and then show the total, but ideally without a column showing the multiplied sum (in column E)....
    is there a simpler way to do this without writing out a long formula as shown above? There could be as many as 40 or 50 rows to be multiplied for each total.
    cheers, ric

    Hi ric,
    Not exactly answering your question (to not use column E)
    Formula in E2 (and Fill Down)
    =C2×D2
    Formula in Footer Row D8 (or any convenient place)
    =SUM(E)
    Now hide column E
    Regards,
    Ian.

  • Subtract sum of two columns in two different tables and display balance for each row

    Hello Friends,
    I have the below 5 tables
    1. STUDENT (STUDENT_ID, NAME)
    2. DEPARTMENT (DEPT_ID, NAME, CONTACT_PERSON, PHONE)
    3. SECTION (SECTION_ID,SNAME,DEPT_ID,Acad_LEVEL,SHIFT,TIME,ROOM)
    4. TUITION_BILL (Seq_No,  STUDENT_ID,  DEPT_ID,  Acad_Level,  SECTION_ID,  SEMESTER,  Acad_Year, BILL_DATE,  GROSS_AMT_DUE)
    5. TUITION_PAYMENT (Seq_No,RECEIPT_NO,STUDENT_ID,DEPT_ID,Acad_Level,SECTION_ID,SEMESTER,Acad_Year,SCHOLARSHIP,PAYMENT_DATE,PAYMENT_AMT,REFERENCE,REMARKS)
    I wrote the following query
    SELECT T.Seq_No,T.STUDENT_ID,S.NAME As STUDENT_NAME,d.name As DEPT,T.Acad_Level,c.SNAME As SECTION,
    T.SEMESTER,T.[Acad_Year],BILL_DATE,GROSS_AMT_DUE,
    COALESCE(SUM(T.GROSS_AMT_DUE),0)-COALESCE(SUM(PAY.PAYMENT_AMT),0)- COALESCE(SUM(PAY.SCHOLARSHIP),0) As BALANCE
    FROM TUITION_BILL T JOIN STUDENT S ON S.STUDENT_ID=T.STUDENT_ID join DEPARTMENT d on d.DEPT_ID=T.DEPT_ID
    join SECTION c on c.SECTION_ID=T.SECTION_ID LEFT JOIN (SELECT DISTINCT STUDENT_ID,COALESCE(SUM(p.PAYMENT_AMT),0) As PAYMENT_AMT,
    COALESCE(SUM(P.SCHOLARSHIP),0) As SCHOLARSHIP FROM TUITION_PAYMENT p GROUP BY p.STUDENT_ID) As PAY ON PAY.STUDENT_ID=T.STUDENT_ID
    WHERE s.STUDENT_ID='138218' GROUP BY T.Seq_No,T.STUDENT_ID,S.NAME,d.NAME,T.[Acad_Level],c.SNAME,T.SEMESTER,
    T.[Acad_Year],BILL_DATE,GROSS_AMT_DUE,PAYMENT_AMT,SCHOLARSHIP
    The above query shows the below output
    Seq_No
    STUDENT_ID
    STUDENT_NAME
    DEPT
    Acad_Level
    SECTION
    SEMESTER
    Acad_Year
    BILL_DATE
    GROSS_AMT_DUE
    BALANCE
    1
    138218
    Abdirahman Dhuh Gamadid
    Agriculture and Veterinary
    Year 2
    2A
    One
    2014-2015
    1/10/2014
    200
    0
    5638
    138218
    Abdirahman Dhuh Gamadid
    Agriculture and Veterinary
    Year 2
    2A
    Two
    2014-2015
    3/20/2015
    200
    0
    There are two records in the TUITION_BILL table with different Semesters and bill dates for the specified student_id and there is only one record in the TUITION_PAYMENT table which is the semester one payment record. Semester two payment record
    is not recorded yet and I want to display the balance like the following output instead of the above output.
    Seq_No
    STUDENT_ID
    STUDENT_NAME
    DEPT
    Acad_Level
    SECTION
    SEMESTER
    Acad_Year
    BILL_DATE
    GROSS_AMT_DUE
    BALANCE
    1
    138218
    Abdirahman Dhuh Gamadid
    Agriculture and Veterinary
    Year 2
    2A
    One
    2014-2015
    1/10/2014
    200
    0
    5638
    138218
    Abdirahman Dhuh Gamadid
    Agriculture and Veterinary
    Year 2
    2A
    Two
    2014-2015
    3/20/2015
    200
    200
    The above query is working fine but I'm facing only one problem with it which its showing 0 balance for both records instead of different balances like the above desired output.
    Please help me in getting the desired result.
    Any help would be appreciated.
    Thanks in advance,
    Mohamoud 

    Thanks a lot Pituach for your reply; below I posted the script for the database and table creation and inserting sample data into the tables.
    CREATE
    DATABASE TESTdb
    GO
    USE TESTdb
    CREATE
    TABLE [dbo].[STUDENT](
          [STUDENT_ID] [int]
    NOT NULL,
          [NAME] [varchar](40)
    NULL,
    PRIMARY
    KEY CLUSTERED
          [STUDENT_ID]
    ASC
    )WITH
    (PAD_INDEX 
    = OFF,
    STATISTICS_NORECOMPUTE 
    = OFF,
    IGNORE_DUP_KEY =
    OFF, ALLOW_ROW_LOCKS 
    = ON,
    ALLOW_PAGE_LOCKS  =
    ON)
    ON [PRIMARY]
    ON [PRIMARY]
    GO
    SET
    ANSI_PADDING OFF
    GO
    CREATE
    TABLE [dbo].[DEPARTMENT](
          [DEPT_ID] [int]
    IDENTITY(1,1)
    NOT NULL,
          [NAME] [varchar](30)
    NULL,
          [CONTACT_PERSON] [varchar](40)
    NULL,
          [PHONE] [int]
    NULL,
     CONSTRAINT [PK__DEPARTME__512A59AC03317E3D]
    PRIMARY KEY
    CLUSTERED
          [DEPT_ID]
    ASC
    )WITH
    (PAD_INDEX 
    = OFF,
    STATISTICS_NORECOMPUTE 
    = OFF,
    IGNORE_DUP_KEY =
    OFF, ALLOW_ROW_LOCKS 
    = ON,
    ALLOW_PAGE_LOCKS  =
    ON)
    ON [PRIMARY]
    ON [PRIMARY]
    GO
    SET
    ANSI_PADDING OFF
    GO
    CREATE
    TABLE [dbo].[SECTION](
          [SECTION_ID] [int]
    IDENTITY(1,1)
    NOT NULL,
          [SNAME] [varchar](40)
    NOT NULL,
          [DEPT_ID] [int]
    NOT NULL,
          [Acad_Level] [varchar](30)
    NULL,
          [SHIFT] [varchar](20)
    NULL,
          [TIME] [varchar](20)
    NULL,
          [ROOM] [varchar](20)
    NULL,
     CONSTRAINT [PK__SECTION__92F8069507020F21]
    PRIMARY KEY
    CLUSTERED
          [SECTION_ID]
    ASC,
          [DEPT_ID]
    ASC
    )WITH
    (PAD_INDEX 
    = OFF,
    STATISTICS_NORECOMPUTE 
    = OFF,
    IGNORE_DUP_KEY =
    OFF, ALLOW_ROW_LOCKS 
    = ON,
    ALLOW_PAGE_LOCKS  =
    ON)
    ON [PRIMARY]
    ON [PRIMARY]
    GO
    SET
    ANSI_PADDING OFF
    GO
    CREATE
    TABLE [dbo].[TUITION_BILL](
          [Seq_No] [int]
    IDENTITY(1,1)
    NOT NULL,
          [STUDENT_ID] [int]
    NOT NULL,
          [DEPT_ID] [int]
    NOT NULL,
          [Acad_Level] [varchar](50)
    NOT NULL,
          [SECTION_ID] [int]
    NOT NULL,
          [SEMESTER] [varchar](50)
    NOT NULL,
          [Acad_Year] [varchar](50)
    NOT NULL,
          [BILL_DATE] [date]
    NULL,
          [GROSS_AMT_DUE] [decimal](18, 2)
    NULL,
     CONSTRAINT [PK_TUITION_BILL]
    PRIMARY KEY
    CLUSTERED
          [STUDENT_ID]
    ASC,
          [DEPT_ID]
    ASC,
          [Acad_Level]
    ASC,
          [SEMESTER]
    ASC,
          [Acad_Year]
    ASC
    )WITH
    (PAD_INDEX 
    = OFF,
    STATISTICS_NORECOMPUTE 
    = OFF,
    IGNORE_DUP_KEY =
    OFF, ALLOW_ROW_LOCKS 
    = ON,
    ALLOW_PAGE_LOCKS  =
    ON)
    ON [PRIMARY]
    ON [PRIMARY]
    GO
    SET
    ANSI_PADDING OFF
    GO
    CREATE
    TABLE [dbo].[TUITION_PAYMENT](
          [Seq_No] [int]
    IDENTITY(1,1)
    NOT NULL,
          [RECEIPT_NO] [int]
    NOT NULL,
          [STUDENT_ID] [int]
    NOT NULL,
          [DEPT_ID] [int]
    NOT NULL,
          [Acad_Level] [varchar](50)
    NOT NULL,
          [SECTION_ID] [int]
    NOT NULL,
          [SEMESTER] [varchar](50)
    NOT NULL,
          [Acad_Year] [varchar](50)
    NOT NULL,
          [SCHOLARSHIP] [decimal](18, 2)
    NULL,
          [PAYMENT_DATE] [date]
    NULL,
          [PAYMENT_AMT] [decimal](18, 2)
    NULL,
          [REFERENCE] [varchar](50)
    NULL,
          [REMARKS] [varchar](max)
    NULL,
     CONSTRAINT [PK_TUITION_PAYMENT]
    PRIMARY KEY
    CLUSTERED
          [Seq_No]
    ASC
    )WITH
    (PAD_INDEX 
    = OFF,
    STATISTICS_NORECOMPUTE 
    = OFF,
    IGNORE_DUP_KEY =
    OFF, ALLOW_ROW_LOCKS 
    = ON,
    ALLOW_PAGE_LOCKS  =
    ON)
    ON [PRIMARY]
    ON [PRIMARY]
    GO
    SET
    ANSI_PADDING OFF
    GO
    USE TESTdb
    INSERT
    INTO STUDENT(STUDENT_ID,NAME)VALUES(138218,'Abdirahman
    Dhuh Gamadid')
    INSERT
    INTO DEPARTMENT(NAME,CONTACT_PERSON,PHONE)VALUES('Agriculture
    and Veterinary','Mohamoud Abdilahi','065')
    INSERT
    INTO SECTION(SNAME,DEPT_ID,Acad_Level,SHIFT,[TIME],ROOM)VALUES('2A',1,'Year
    2','Morning','8:00-10:00','Room 1')
    INSERT
    INTO TUITION_BILL(STUDENT_ID,DEPT_ID,Acad_Level,SECTION_ID,SEMESTER,Acad_Year,BILL_DATE,GROSS_AMT_DUE)
    VALUES(138218,1,'Year
    2',1,'One','2014-2015','2014-09-10',200.00)
    INSERT
    INTO TUITION_BILL(STUDENT_ID,DEPT_ID,Acad_Level,SECTION_ID,SEMESTER,Acad_Year,BILL_DATE,GROSS_AMT_DUE)
    VALUES(138218,1,'Year
    2',1,'Two','2014-2015','2015-01-10',200.00)
    INSERT
    INTO TUITION_PAYMENT(RECEIPT_NO,STUDENT_ID,DEPT_ID,Acad_Level,SECTION_ID,SEMESTER,Acad_Year,SCHOLARSHIP,
    PAYMENT_DATE,PAYMENT_AMT,REFERENCE,REMARKS)VALUES(1,138218,1,'Year
    2',1,'One','2014-2015',0.00,'2014-10-10',200.00,'N','N')

  • Sum the lesser of two columns when condition is met

    Hi. I need help with creating a formula that will sum the lesser value between two columns when a condition in another column is met.
    Example: Sum the lesser value between columns B and C when column A contains "x".
    ...A...B...C
    1.....3.....2
    2.x...4....1
    3
    4.x...2....3
    A2 and A4 contain "x". The lesser value between B2 and C2 is 1. The lesser value between B4 and C4 is 2. So 1 + 2 = 3. The sum should be 3.

    add a new column (let's say columns D) that finds the min of the two columns
    =min(B, C)
    then use sumif(A, "X", D)
    like this:
    D1=MIN(B1:C1)
    this is shorthand for... select cell D1, then type (or copy and paste from here) the formula:
    =MIN(B1:C1)
    select cell D1, copy
    select column D (by clicking the "D" at the very top of the column), paste
    E1=SUMIF(A,"X",D )

  • I want a select statement to return two values, sum of one column and customer number

    I have two columns one called invoice_number and the other invoice_amount. I want a select statement to return two columns.... invoice_number and then the sum of the invoice_amount(s) for each unique invoice number.
    SELECT sum(invoice_amount) AS Totalinvoice_amount FROM InvoiceTB where invoice_number = 'INV102'
    This is where I've started, which returns:
    Totalinvoice_amount
    500.00
    Any help is appreciated.
    Please mark my post as helpful or the answer or better yet.... both! :) Thanks!

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • 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

  • How to add two columns in OBIEE report?

    Hi to All,
    Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
    Thanks in Advance,
    Thenmozhi

    Assume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
    For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
    Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
    Let me know if you are looking for something else.
    Thanks

  • How to find the sum of a column

    I need to find the sum of a column and use it in a different column. The following is the example.
    Column names: Feedback(Good, Avg, Poor), Count(no of good, no of avg, no of poor) and %age(Feedback/sum(feedback))
    I want to find the sum in Java class and also calculate the last column in java class.
    Please tell me some way to do it.

    oh.. ok ..thanks for letting me know.. i will formulate the question in a proper way:
    This is what my UI should look like:
    Rating Count Percent
    Excellent 2 20
    Good 6 60
    Poor 1 10
    Bad 1 10
    Now i have the following columns in the data base:
    Meaning and feedback_rating.
    So the following SQL Query:
    SELECT hrl.meaning rating,
    sum(decode(bcpi.feedback_rating, null, 0, 1)) counted
    from cmp_cwb_person_info bcpi ,
    hr_lookups hrl
    group by hrl.meaning
    will give me the result as
    rating counted
    Excellent 2
    Good 6
    Poor 1
    Bad 1
    Now I want a third column as percentage : Earlier we were doing this calculation in the sql query itself, so the query was like
    SELECT hrl.meaning rating,
    sum(decode(bcpi.feedback_rating, null, 0, 1)) counted,
    sum(decode(bcpi.feedback_rating, null, 0, 1))/(max (select count (*) from cmp_cwb_person_info bcpi ,
    hr_lookups hrl )) percent
    from cmp_cwb_person_info bcpi ,
    hr_lookups hrl
    group by hrl.meaning
    Hence the third column (percent) was calculated in the sql query itself.
    But now i feel that the performance of the query could be improved if we get the first two columns from the database and the calculate the third column programatically in the java code.
    So this is what I want to know. How can i do that?

  • How can I sum every other column in the same row?

    I have, for each employee, two columns: Planned and Worked.
    I would like to sum the values in each Planned column. There are 25 employees, each with their own Planned and Worked columns, on the same row.
    How can I do a SUM of every other column, starting with Planned?
    Thank you.

    Thank you, Yellowbox!
    The exact formula didn't work; however, it gave me a precise path to follow and come up with this: =SUMIF(E2:BB2,"=Planned",E3:BB3)
    Week
    Ending Date
    Planned Subtotal
    Worked Subtotal
    Employee1
    Employee2
    Employee3
    Planned
    Worked
    Planned
    Worked
    Planned
    Worked
    1
    01/04/2014
    120
    40
    38
    40
    44
    40
    50
    2
    01/11/2014
    If not for your starting point, I'd have wasted many more hours on this.
    Thanks again!
    BB

  • How to get the difference between two columns in a column group

    Hi All,
    My first time here and really new to programming. I would like to get the difference between 2 columns that are inside 
    a column group.
    Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
                                PeriodNumber          
    Account                    1                            2     
    1) Cash                10,000                15,000
    2) Receivables      12,000                11,500
    3) Equipment          5,000                  5,500
    Total Assets          27,000                32,000

    Hi yabgestopa,
    From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    Dim Shared Num1 As Integer
    Dim shared Num2 As Integer
    Public Function GetAmount(Amount as Integer, Type as String)
    If Type = "1" Then
    Num1=Amount
    Else
    Num2=Amount
    End If
    Return Amount
    End Function
    Public Function GetDif()
    Return Num1-Num2
    End function
    Right-click the second column to insert a third column with Outside Group-Right.
    Then use the expressions below in the matrix.
    =Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
    =code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
    =Code.GetDif()
    The report looks like below.
    If you have any questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Find the difference between two columns in an ssrs matrix ? MSCRM

    Hi All,
    I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
    I am trying to create report using fetch xml based. Below is the snap what we required the result.
    Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
    We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
    Revenue.
    https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
    Thanks,
    Mohammad Sharique

    Hi Bro,
    I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
    that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage. 
    Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
    Below expression using to showing Plan Revenue in Percentage for year.
    =
    Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    - Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    /IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
    (Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
    ,1)
    )*100))
    Result issue is as below in snap with highlighted in red colour.
    Kindly help me on this issue also :)

  • Qualified list item based on two columns

    - fact table inludes following columns
    key1
    key2
    measure1
    In segment designer, update counts:
    the query must counts two columns "key1 and key2" that key1 and key2 together must be distinct.

    Here you go:
    SQL> WITH bill AS
      2  (
      3          SELECT 1000 AS billno, 101 AS advertiserid, 102 AS agencyid, 5000 AS total_value FROM DUAL UNION ALL
      4          SELECT 1001, 101, 103, 5000 FROM DUAL UNION ALL
      5          SELECT 1002, 101, 102, 1000 FROM DUAL
      6  ), account AS
      7  (
      8          SELECT 101 AS account1_id, 102 AS account2_id, 'John' AS name, 50 AS empid FROM DUAL UNION ALL
      9          SELECT 101, 103, 'James', 40 FROM DUAL UNION ALL
    10          SELECT 101, 105, 'Joe', 60 FROM DUAL
    11  )
    12  /* End Sample Data */
    13  SELECT a.name
    14       , a.empid
    15       , a.account1_id
    16       , a.account2_id
    17       , SUM(b.total_value)
    18  FROM   account a
    19  JOIN   bill    b ON  a.account1_id = b.advertiserid
    20                   AND a.account2_id = b.agencyid
    21  GROUP BY a.name
    22         , a.empid
    23         , a.account1_id
    24         , a.account2_id
    25  ;
    NAME                 EMPID          ACCOUNT1_ID          ACCOUNT2_ID   SUM(B.TOTAL_VALUE)
    John                    50                  101                  102                 6000
    James                   40                  101                  103                 5000

Maybe you are looking for

  • Multi-line JTextPane: My SSCCE works, but not my reg. code . [LONG, sorry.]

    So, I'm trying to code this flash cards program, and it's not working. The problem is that, when I change the text of the JTextPane to have multiple lines, the text disappears, and my JTextPane acts like it's empty. I included my SSCCE as a compariso

  • Enable System Wide DEP Support via command line

    Hello all, I am trying to deploy EMET to our organization, but I notice on my test installation on a Windows 7 PC, systemwide DEP was not enabled by default. I figured I can activate this through the command line, but I seem to be running into some t

  • JMenu with AWT component

    dear friends; i have added menu bar in Jframe which is containes menues. AWT component is added the the same frame . problem is: menues are overlapping with awt component while i clicked the menu bar. dear friends help me immediately. thank u

  • Loosing TITLE info on redirect...please help.

    For some reason I'm losing the <TITLE> info on a .jsp page. I'm getting the 'Untitled Document' at the top of the browser, even though I've specified it within the abc.jsp page. Process: - url to xyz servlet (http://host/servlet/nav.abc) - the servle

  • OTA Update Not Querying Custom Update URL

    I built Firefox 2.0 for the Nexus 4 and it does not check for updates using my custom update URL. The phone just sits on "Checking for updates..." My webserver logs also show there is no request for update.xml. Is this functionality missing? Can it b