Grand Totals for GOURL columns
We are having an issue showing Grand Totals for GOURL enabled columns
We have enabled GOURL on the amount columns, To enable hyperlink we had to convert the the number column to character. Enabling the Grand total in the Table View is thorwing error "Function Report_Sum does not support non-numeric types".
Any input on the above would be of great help.
We are using OBIEE version 10.1.3.4
Thanks
Kranthi
You can try the following..
1) Keep the same name for all the amount fields in each column. (for example, first amount column field name is "Amount1" and second column field name is "Amount2").
2) Then write the code in the Calculate event of the Total field. (Use FormCalc)
Total1.rawValue = Sum(Table1.Row1[*].Amount1);
3) Similarly for Second column
Total2.rawValue = Sum(Table1.Row1[*].Amount2);
4) For the total of Amount1 and Amount2.
LoanTotal = Sum(Total1.rawValue + Total2.rawValue);
Hope this helps.
Thanks
Srini
Similar Messages
-
Grands totals for % Columns coming incorrect in pivot view .
Hello ,
I have the below scenario . Iam trying to get the calculated grand total for % column . I tired several ways ...like report aggregates enabled in instanceconfig,tried creating cal colum using physical columns as well as logical columns in RPD , changing the aggregation rule. The row wise values (%) are coming correct but iam unable to get correct % grand total (36.8%) instead iam just getting the sum of the % total ( 83.3%) . I have tried the above options in my previous reports and those conditions work perfectly right but for this report they are not able to . kindly please let me know if anybody has a solution for this issue .
Department ...USD CAD Variance (USD/CAD)*100
XYZ 10 20 50%
ABC 25 75 33.3%
Total 35 95 36.8% ( 35/95)
Thanks
KarthikJust to cross check
Do you have following tag in your instanceconfig file ? if its not there then you may encounter grand total incorrect calculations.
<ReportAggregateEnabled>true</ReportAggregateEnabled> -
Alv subtotals and grand total for a field
Hi friends,
I Have an internal table ITAB1
in that i have a senario as below.
In my GRID display iam getting values in the layou as follows
BUKRS = 1000
LIFNR MATNR STCST
100 abc 500,00
100 pqr 400,00
100 xyz 200,00
sub total
200 pto 700,00
200 vbr 900,00
sub total
BUKRS = 2000
LIFNR MATNR STCST
150 abc 500,00
150 pqr 400,00
150 xyz 200,00
sub total
260 pto 700,00
260 vbr 900,00
sub total
GRAND TOTAL =
Now my requirement is at the end of every vendor i need sub total for STCST field.
and at the end of every company code i need GRAND TOTAL for STCST field.
Its alv grid display.
how can i do that.
Regards,
Priyanka.Check this sample code may it will help u:
*& Report Z_ALV_SUBTOTAL
REPORT z_alv_subtotal.
*& Table declaration
TABLES: ekko.
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
*& Type declaration
* Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
ebeln TYPE char30, " Document no.
ebelp TYPE ebelp, " Item no
matnr TYPE matnr, " Material no
matnr1 TYPE matnr, " Material no
werks TYPE werks_d, " Plant
werks1 TYPE werks_d, " Plant
ntgew TYPE entge, " Net weight
gewe TYPE egewe, " Unit of weight
END OF x_data.
*& Internal table declaration
DATA:
* Internal table to store EKPO data
i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
* Internal table for storing field catalog information
i_fieldcat TYPE slis_t_fieldcat_alv,
* Internal table for Top of Page info. in ALV Display
i_alv_top_of_page TYPE slis_t_listheader,
* Internal table for ALV Display events
i_events TYPE slis_t_event,
* Internal table for storing ALV sort information
i_sort TYPE slis_t_sortinfo_alv,
i_event TYPE slis_t_event.
*& Work area declaration
DATA:
wa_ekko TYPE x_data,
wa_layout TYPE slis_layout_alv,
wa_events TYPE slis_alv_event,
wa_sort TYPE slis_sortinfo_alv.
*& Constant declaration
CONSTANTS:
c_header TYPE char1
VALUE 'H', "Header in ALV
c_item TYPE char1
VALUE 'S'.
*& Start-of-selection event
START-OF-SELECTION.
* Select data from ekpo
SELECT ebeln " Doc no
ebelp " Item
matnr " Material*
matnr " Material*
werks " Plant*
werks " Plant*
ntgew " Quantity
gewei " Unit
FROM ekpo
INTO TABLE i_ekpo
WHERE ebeln IN s_ebeln
AND ntgew NE '0.00'.
IF sy-subrc = 0.
SORT i_ekpo BY ebeln ebelp matnr .
ENDIF.
* To build the Page header
PERFORM sub_build_header.
* To prepare field catalog
PERFORM sub_field_catalog.
* Perform to populate the layout structure
PERFORM sub_populate_layout.
* Perform to populate the sort table.
PERFORM sub_populate_sort.
* Perform to populate ALV event
PERFORM sub_get_event.
END-OF-SELECTION.
* Perform to display ALV report
PERFORM sub_alv_report_display.
*& Form sub_build_header
* To build the header
* No Parameter
FORM sub_build_header .
* Local data declaration
DATA: l_system TYPE char10 , "System id
l_r_line TYPE slis_listheader, "Hold list header
l_date TYPE char10, "Date
l_time TYPE char10, "Time
l_success_records TYPE i, "No of success records
l_title(300) TYPE c. " Title
* Title Display
l_r_line-typ = c_header. " header
l_title = 'Test report'(001).
l_r_line-info = l_title.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR l_r_line.
* Run date Display
CLEAR l_date.
l_r_line-typ = c_item. " Item
WRITE: sy-datum TO l_date MM/DD/YYYY.
l_r_line-key = 'Run Date :'(002).
l_r_line-info = l_date.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR: l_r_line,
l_date.
ENDFORM. " sub_build_header
*& Form sub_field_catalog
* Build Field Catalog
* No Parameter
FORM sub_field_catalog .
* Build Field Catalog
PERFORM sub_fill_alv_field_catalog USING:
'01' '01' 'EBELN' 'I_EKPO' 'L'
'Doc No'(003) ' ' ' ' ' ' ' ',
'01' '02' 'EBELP' 'I_EKPO' 'L'
'Item No'(004) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR' 'I_EKPO' 'L'
'Material No'(005) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR1' 'I_EKPO' 'L'
'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L'
'Plant'(006) 'X' 'X' ' ' ' ',
'01' '04' 'WERKS1' 'I_EKPO' 'L'
'Plant'(006) ' ' ' ' ' ' ' ',
'01' '05' 'NTGEW' 'I_EKPO' 'R'
'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.
ENDFORM. " sub_field_catalog
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.
* Local declaration for field catalog
DATA: wa_lfl_fcat TYPE slis_fieldcat_alv.
wa_lfl_fcat-row_pos = p_rowpos. "Row
wa_lfl_fcat-col_pos = p_colpos. "Column
wa_lfl_fcat-fieldname = p_fldnam. "Field Name
wa_lfl_fcat-tabname = p_tabnam. "Internal Table Name
wa_lfl_fcat-just = p_justif. "Screen Justified
wa_lfl_fcat-seltext_l = p_seltext. "Field Text
wa_lfl_fcat-no_out = p_out. "No output
wa_lfl_fcat-tech = p_tech. "Technical field
wa_lfl_fcat-qfieldname = p_qfield. "Quantity unit
wa_lfl_fcat-qtabname = p_qtab . "Quantity table
IF p_fldnam = 'NTGEW'.
wa_lfl_fcat-do_sum = 'X'.
ENDIF.
APPEND wa_lfl_fcat TO i_fieldcat.
CLEAR wa_lfl_fcat.
ENDFORM. " sub_fill_alv_field_catalog
*& Form sub_populate_layout
* Populate ALV layout
* No Parameter
FORM sub_populate_layout .
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'." Optimization of Col width
ENDFORM. " sub_populate_layout
*& Form sub_populate_sort
* Populate ALV sort table
* No Parameter
FORM sub_populate_sort .
* Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
* Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM. " sub_populate_sort
*& Form sub_get_event
* Get ALV grid event and pass the form name to subtotal_text
* event
* No Parameter
FORM sub_get_event .
CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'.
DATA: l_s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 4
IMPORTING
et_events = i_event
EXCEPTIONS
list_type_wrong = 0
OTHERS = 0.
* Subtotal
READ TABLE i_event INTO l_s_event
WITH KEY name = slis_ev_subtotal_text.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO l_s_event-form.
MODIFY i_event FROM l_s_event INDEX sy-tabix.
ENDIF.
ENDFORM. " sub_get_event
*& Form sub_alv_report_display
* For ALV Report Display
* No Parameter
FORM sub_alv_report_display .
DATA: l_repid TYPE syrepid .
l_repid = sy-repid .
* This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.
ENDFORM. " sub_alv_report_display
* FORM sub_alv_top_of_page
* Call ALV top of page
* No parameter
FORM sub_alv_top_of_page. "#EC CALLED
* To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_alv_top_of_page.
ENDFORM. "alv_top_of_page
*& Form subtotal_text
* Build subtotal text
* P_total Total
* p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
* Material level sub total
IF p_subtot_text-criteria = 'MATNR'.
p_subtot_text-display_text_for_subtotal
= 'Material level total'(009).
ENDIF.
* Plant level sub total
IF p_subtot_text-criteria = 'WERKS'.
p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
ENDIF.
ENDFORM. "subtotal_text
Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM -
I need the grand total for particular coulumn for ALV grid report(OOPs).
Hello,
I have used the following code,
But i m not getting the grand total by default.No error but not getting the desired result.
Could you please help me in this regard.
FORM display_simple_alv.
DATA : lr_msg TYPE REF TO cx_salv_msg.
DATA : lv_header TYPE REF TO cl_salv_form_layout_grid,
lv_h_label TYPE REF TO cl_salv_form_label,
lv_h_flow TYPE REF TO cl_salv_form_layout_flow.
DATA: gr_sorts TYPE REF TO cl_salv_sorts.
DATA: gr_agg TYPE REF TO cl_salv_aggregations.
TRY .
cl_salv_table=>factory( IMPORTING r_salv_table = gr_salv_table
CHANGING t_table = gt_invdetails4 ).
CATCH cx_salv_msg INTO lr_msg.
ENDTRY .
Display Basic Toolbar
gr_functions = gr_salv_table->get_functions( ).
gr_functions->set_all( abap_true ).
TRY .
gr_columns = gr_salv_table->get_columns( ).
gr_columns->set_optimize( ).
CATCH cx_salv_not_found.
ENDTRY .
TRY .
gr_column ?= gr_columns->get_column( 'KUNNR' ).
gr_column->set_long_text( text-009 ).
gr_column->set_medium_text( text-009 ).
gr_column->set_short_text( text-009 ).
gr_column ?= gr_columns->get_column( 'NAME1' ).
gr_column->set_long_text( text-010 ).
gr_column->set_medium_text( text-010 ).
gr_column->set_short_text( text-011 ).
gr_column ?= gr_columns->get_column( 'AMOUNT' ).
gr_column->set_long_text( text-012 ).
gr_column->set_medium_text( text-012 ).
gr_column->set_short_text( text-012 ).
gr_column ?= gr_columns->get_column( 'TAX' ).
gr_column->set_long_text( text-013 ).
gr_column->set_medium_text( text-013 ).
gr_column->set_short_text( text-013 ).
gr_column ?= gr_columns->get_column( 'IVA' ).
gr_column->set_long_text( text-014 ).
gr_column->set_medium_text( text-014 ).
gr_column->set_short_text( text-015 ).
gr_column ?= gr_columns->get_column( 'TOTAL_AMOUNT' ).
gr_column->set_long_text( text-016 ).
gr_column->set_medium_text( text-016 ).
gr_column->set_short_text( text-017 ).
gr_column ?= gr_columns->get_column( 'CURRENCY' ).
gr_column->set_long_text( text-018 ).
gr_column->set_medium_text( text-018 ).
gr_column->set_short_text( text-018 ).
gr_column ?= gr_columns->get_column( 'ZINTERNAL_REFNO' ).
gr_column->set_long_text( text-019 ).
gr_column->set_medium_text( text-019 ).
gr_column->set_short_text( text-019 ).
gr_column ?= gr_columns->get_column( 'MATERIAL_AMOUNT' ).
gr_column->set_long_text( text-020 ).
gr_column->set_medium_text( text-020 ).
gr_column->set_short_text( text-021 ).
gr_column ?= gr_columns->get_column( 'LABOUR_VALUE' ).
gr_column->set_long_text( text-022 ).
gr_column->set_medium_text( text-022 ).
gr_column->set_short_text( text-023 ).
gr_column ?= gr_columns->get_column( 'FAILURE_COST' ).
gr_column->set_long_text( text-024 ).
gr_column->set_medium_text( text-024 ).
gr_column->set_short_text( text-021 ).
gr_sorts = gr_salv_table->get_sorts( ).
gr_sorts->add_sort( columnname = 'AMOUNT' subtotal = abap_true ). "for subtotal
gr_agg = gr_salv_table->get_aggregations( ).
gr_agg->add_aggregation( 'AMOUNT' ).
CATCH cx_salv_not_found cx_salv_data_error cx_salv_existing.
ENDTRY .
Set top of page
CREATE OBJECT lv_header.
lv_h_label = lv_header->create_label( row = 1 column = 1 ).
lv_h_label->set_text( text-001 ).
lv_h_label = lv_header->create_label( row = 1 column = 5 ).
lv_h_label->set_text( text-002 ).
lv_h_label = lv_header->create_label( row = 1 column = 14 ).
lv_h_label->set_text( text-003 ).
lv_h_flow = lv_header->create_flow( row = 3 column = 04 ).
lv_h_flow->create_text( text = text-004 ).
lv_h_flow = lv_header->create_flow( row = 3 column = 05 ).
lv_h_flow->create_text( text = text-005 ).
lv_h_flow = lv_header->create_flow( row = 3 column = 06 ).
lv_h_flow->create_text( text = name ).
set the top of list using the header for Online.
gr_salv_table->set_top_of_list( lv_header ).
ALV Display
gr_salv_table->display( ).
ENDFORM . " DISPLAY_SIMPLE_ALVHi Sridevi,
To get the grand total, you need to pass the SORT itab to the function module. You need to populate the internal table with the fields on which you want the total or subtotal. If you donu2019t pass this table, you wonu2019t get it.
For ex:
ls_sort_wa-spos = 1.
ls_sort_wa-fieldname = gs_plant-werks.
ls_sort_wa-up = 'X'.
ls_sort_wa-subtot = 'X'.
APPEND ls_sort_wa TO gt_sort.
So the above code, gives the sub total plant wise.
and if you want the sum(grand total) you can set the DO_SUM to u2018Xu2019 for that particular field in the field catalog.
So with this approach, you can get the sub total and grand total for a particular field.
If you donu2019t want the subtotal, just set DO_SUM, you will get the total.
Thanks,
Srini. -
Hi,
My question is: Can I exclude grand total on some measure column in pivot view?
For example I have 3 columns.On columns Account1 and Accounts, aggregation is SUM, and on column Max(something), aggregation is MAX.
I have next situation.
Account1 Account 2 Max(something)
100 200 23
200 250 13
150 300 42
450 750 42 - GRAND TOTAL
But I want grand total only on columns Account1 and Accounts. For column Max(something) I don't want total at all.
Thank you for your replies.Hi,
Thanks for your reply,
According to the link Below
http://gerardnico.com/wiki/dat/obiee/answer_xml,
We can able to change color for Grand total through XML, but the example is in 10g, there is nothing call saw:totalValues in 11g Currently, may be it is replaced with saw:displayGrandTotal, I tried that option also but it is not working.
Is there anything which we can do through xml, to achieve the above requirement?
Thanks
Anirban -
Hello,
Using obiee 11g,
I am trying to build a report where i am trying do a count(distinct un),so i created a logical column for that and using that in my answers.
The un i am showing for over months.IS works fine except that the grand total shows wrong.
Grand total just adds the months total and not just do a count distinct for un.
Aggregation rule is set as default.
Would like to know how to do this?
ThanksHello,
Its not working that way.
Let me explain my case in detail.Problem is only in case of GRAND TOTAl.
I am showing different cases,users and export for each month.
So cases and users are used everywhere so i created a logical column in the RPD.
count(distinct caseid) and count(distinct userid) as cid and uid and using that in my answers.
export count since not used everywhere initially i took that column into my answers and then did a count(xportcount) in my answers
so i have now
cid-uid-count(xportcount) as 3 columns in my answers.But here the problem is my Grand total for uid comes wrong.
Instead of doing a distinct users for all the months selected it just shows the grand total as sum for users
Like jan-16 users feb -17 users then the total is 16+17 and not the distinct users from jan and feb.
Grand total for case and exportcount is correct because i need a sum in that case so aggregation rule as deault works fine here.
Here the problem which i feel is the count distinct which i am doing for caseid and uid and not exportcount.
In my second scenario i did like created a separted column count(exportcount) in the rpd, then used that in my answers.
But still no use
In my third sceanario i created a count(distinct exportcount) in the rpd and using that in my answers
now it feels it works fine.
I wnat to know is this the way BI works.
I am bit confused now.
Is there a way other then this to do.
I wanted first,second sceanario also to work but doesnt feel like working is there a way to make it work?
Thanks -
Page Total for a Column in JSF HtmlDataTable
Hi All,
I need an example to calculate page total for price column in HtmlDataTable.
Each page displays 10 rows and there are 50 rows hence 5 pages in datatable.How to calculate page total after displaying the rows on page.
Thanks in advance.Just get the desired sublist of the datalist and sum the price? You can get the starting index and the rowcount from the HtmlDataTable by its getFirst() and getRows() methods respectively and use it in List#subList(). Then iterate over the list and add the price value of every item in a loop to the total value. You can display it in the footer of the datatable. You can define a footer with <f:facet name="footer">.
-
Calculating Totals for a column in ALV Grid Display
Hi All,
I frustrated with the problem of simple calculating total for a column. I wrote the following code:
LW_CATALOG-TABNAME = P_GV_STRUCT.
LW_CATALOG-FIELDNAME = 'ZSUMMS'.
LW_CATALOG-DO_SUM = GC_X.
APPEND LW_CATALOG TO G_FIELDCAT_TAB.
CLEAR LW_CATALOG.
It is not working. Could you please suggest the solution?
It would be great help to me.
Advanced Thanks,
Phani KumarPhani,
Did u try playing around with any of these layout fields ?
no_sumchoice(1), " no choice for summing up
no_totalline(1), " no total line
no_subchoice(1), " no choice for subtotals
no_subtotals(1), " no subtotals possible
no_unit_splitting " no sep. tot.lines by inh.units
totals_before_items, " diplay totals before the items
totals_only(1), " show only totals
totals_text(60) , " text for 1st col. in total line
subtotals_text(60) , " text for 1st col. in subtotals
b. Addtionally... not a solution.. but u know...
just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ? -
Grand total (of all columns) in ALV grid
Hi Experts,
I have developed one custom ALV report in GRID format. Now Report output is displaying like below.
COL1 | COL2 | COL3 | COL4 |
TYPE1 | 10 | 44 | 05 |
TYPE2 | 01 | 20 | 35 |
TYPE3 | 05 | 10 | 20 |
=============================
sum | 16 | 74 | 50 |
But I need Grand Total for COL2 and COL3 and COL4 (i.e 16 + 74 + 50 )
This grand total line should be at the end of the internal table -- 140 .
The report output should be like below.....
COL1 | COL2 | COL3 | COL4 |
TYPE1 | 10 | 44 | 05 |
TYPE2 | 01 | 20 | 35 |
TYPE3 | 05 | 10 | 20 |
=============================
sum | 16 | 74 | 50 | ====> this sum will displayed when user select sum button on the Grid toolbar.
=============================
Grand Total 140 |
Suppose when I press sum button on the COL2. it should not change grand total. I mean Grand total should be like footer always.
Please advise
Thanks in advance.
RaghuHi
For your requirment ,you have to fill the field catalog for each field for which
you have to create the the grand total and check the option DO_SUM.
If you neeed the sub total ,in the sort table you can check the option- fs_sort-subtot = 'X'.
Just try the belo code .
It will solve your problem.
REPORT ztest.
* INTERNAL TABLE DECLARATION.
DATA:
t_sflight TYPE TABLE OF sflight,
fs_sflight TYPE sflight.
*OBJECTS FOR CONTAINER AND GRID.
DATA:
r_container1 TYPE REF TO cl_gui_custom_container,
r_grid1 TYPE REF TO cl_gui_alv_grid.
*FIELD CATALOG
DATA:
t_fcat TYPE lvc_t_fcat,
fs_fcat TYPE lvc_s_fcat.
fs_fcat-fieldname = 'SEATSMAX'.
fs_fcat-do_sum = 'X'.
APPEND fs_fcat TO t_fcat.
CLEAR fs_fcat.
fs_fcat-fieldname = 'PRICE'.
fs_fcat-do_sum = 'X'.
APPEND fs_fcat TO t_fcat.
CLEAR fs_fcat.
* SORT TABLE
DATA:
t_sort TYPE lvc_t_sort,
fs_sort TYPE lvc_s_sort.
* LAYOUT TABLE
DATA:
fs_layo TYPE lvc_s_layo.
*FS_LAYO-SGL_CLK_HD = 'X'.
fs_layo-zebra = 'X'.
fs_sort-spos ='1'.
fs_sort-fieldname = 'CARRID'.
fs_sort-down = 'X'.
fs_sort-group = '*'.
*fs_sort-subtot = 'X'.
APPEND fs_sort TO t_sort.
SELECT * FROM sflight INTO TABLE t_sflight.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN1'.
SET TITLEBAR 'TITLE1'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. "user_command_0100 INPUT
**& Module HANDLER OUTPUT
** text
MODULE header OUTPUT.
CREATE OBJECT r_container1
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT r_grid1
EXPORTING
i_parent = r_container1.
CALL METHOD r_grid1->set_table_for_first_display
EXPORTING
is_layout = fs_layo
i_structure_name = 'SFLIGHT'
CHANGING
it_fieldcatalog = t_fcat
it_outtab = t_sflight
it_sort = t_sort.
ENDMODULE. "Header OUTPUT
Regards
Hareesh. -
Subtotal and grand total for two fields(iseg-buchm and iseg-erfmg)
hi experts,
how to do subtotal and grand total for two fields (iseg-buchm and iseg-erfmg).please help me on solving the problem.subtotal & grand total can be done in folowing way in ALV.
1.Pass it_sort parametere to REUSE_ALV_GRID_DISPLAY
2.Give the field name for sorting in it_sort-fieldname. it can be any field name u want to sort ur data with.
3.For iseg-buchm & iseg-erfmg mark do_sum = 'X'. in fieldcat
gs_sort-spos = 1.
gs_sort-fieldname = 'ANY FIELD NAME'.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO et_sort.
IF iv_fieldname = 'BUCHM'
OR iv_fieldname = 'ERFMG'.
gs_fieldcat-do_sum = 'X'.
ENDIF.
APPEND gs_fieldcat TO gt_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_variant = ev_variant
it_fieldcat = gt_fieldcat[] -
Adding a grand total to the columns
Hi
I need to add a total to one of the columns in my report. I have set Aggregation rule as "Sum" but it is not displaying Grand Total.
Am I missing any thing or setting the rule incorrectly?
Please advise.
Thanks in Advance.
JasHi Arvindh
Thanks for your response. I am not using a pivot table I just tried to add total to the table which is created by just selecting columns required in the Define Criteria section.
We can add a total w/o creating the pivot table also. By the way, I have found the solution. The key lies in the second step. If u want me to explain in detail. Just let me know.
-Jas -
Grand total of calculated column and case function in the same calcultd col
Hi Gurus,
In 9.0.4, the Grand total of the calculated column is not working as per the CASE function. It is taking the ELSE formula for all records. Is there a way to correct it.
Thanks,
PoojaHi Pooja,
In the totals ,which u mentioned try using cell sum function instead of sum function.
Manikandan
GKB Consulting Inc., -
Grand Totals on a column of a calculation
I’m trying to sum up a column that is a calculation. When the grand total appears ,it just does the calculation for the line and does not sum up the actual numbers in the column. Any way to fix this
ThanksPr. Ea Qty Value LDP Ttl LDP Landed Ttl Sell
18.45 1056 19483.2 $18.5 19536 35 36960
22.8 613 13976. $22.15 13577.95 44.75 27431.75
20.625 1669 33459.6 $20.32 33922.425 39.875 66551.375
Thanks for your quick reply
the example above shows that the lines calculate correctly , however, discoverer is taking the total line and making a calculation instead of adding the numbers up in the column.
I tried to look for Cell sum , but do not have it . I am working with Discoverer 4
thanks -
Removing Totals for Break Columns
Hi All,
If we add break on two or three columns in report, it gives totals for each group plus a report level total. Is there any way to remove any group or break's total.
For example, if we have a report on emp table and having groups on deptno and job columns, it would be giving totals like this:
JOB TOTAL: 3000
DEPTNO TOTAL: 3000
report total: 3000
How can we remove any of the above totals?
Thanks
Zahid Khan
DeptnoLooks like this is a popular request!
I have report with a break on Column 1, 2 and 3. I would like to display the Report totla but not the sub totals at each column break. Can anyone please share their experience on how to get rid of the Sub Total for a break column?
Thanks. -
Sub-total and Total for a column having checkboxes in WD ABAP ALV
Hello Experts,
I have used ALV in We bdynpro ABAP to display my output. There are 2 columns that are checkboxes in Output. I want a sub-total and total for those two columns. I know tht total and sub-total functionality is available only for numeric fields .
Is there any other indirect way by which i can achieve the same ?Hi Ragini,
Please refer this thread: [alv total and subtotal|How to display graphs;.
I hope it helps.
Regards
Arjun
Maybe you are looking for
-
Hi, Im very new to streams and having a doubt regarding ORA-01403 issue happening while replication. Need you kind help on this regard. Thanks in advance. Oracle version : 10.0.3.0 1.Suppose there are 10 LCRs in a Txn and one of the LCR caused ORA-01
-
IPhoto '09 not working at all - blank library on launch
I purchase and upgraded my iLife package to 09 on 02-04. Upon upgrading and first launch of iPhoto I was met by a complete blank library. I I have been on the phone with Apple for at least 4 hours. They had me remove all my preferences. That did solv
-
Getting Lenght of the DD structre at runtime...( dynamically )
Hello Experts, I have a structre in DD I want the lenght of the structre at runtime ie. dynamically.. how am i going to do it without using RTTS...like lenght = size of ( structre_name ) . or is there any other way...plz let me know ... Thanks in adv
-
Files moved location, playlist is confused
Hi Guys I'd really appreciate some help here, I may have ruined my friends carefully selected playlist of 1200 songs. I have MOVED the music files from there original location to an external hard disk. Note: some of the songs were in a long hierarchy
-
about a week ago my zen started acting vrey strange. i turned it off and then an hour ago i turned it back on and it was stuck on the ZEN screen. I would have to drain the battery really low before i could?get it to the actual menu. i also had to kee