Grand Total Title
Hi Experts,
In answers in table view , i've grand total that displays sum for one columns and average for another column. My problem is in the Grand total label,
Is it possible to have more then one label ?
thx
hi,
you got it ready...
you tick
Horizontal axis---> dimension
Vertical axis-------> measure
Legend axis -----> max(rsum(amount))
you click above the previous in Additional Charting Options-->Legend--->Location = top
and you are ok.
read from the blog i send you ...there are many interesting things there!(min,max values...and others...)
hope i helped....
http://greekoraclebi.blogspot.com/
///////////////////////////////////////
Similar Messages
-
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 -
Grand Total Text is not printing in ALV
Hi all,
I am not able to print Grand Total text in my report
I am not doing subtotal, i am using only grand totals.
So i have used in the following way
WA_FIELDCAT-DO_SUM = GC_X.
GS_LAYOUT-TOTALS_ONLY = GC_X.
GS_LAYOUT-TOTALS_TEXT = 'Totals'(049).
i am using using ALV GRID DISPLAY FM...its displaying the total amount, buts text is missing...
Can any one tell me what else i have to pass in the layout or fieldcatlog or FMHi AMR,
If you use REUSE_ALV_GRID_DISPLAY function module, i think Total text does not come .but if u use REUSE_ALV_LIST_DISPLAY function module Total text comes .
Check this sample program it let u know ..
"Types
TYPES:
BEGIN OF t_pa0008,
pernr TYPE pa0008-pernr,
lga01 TYPE pa0008-lga01,
bet01 TYPE pa0008-bet01,
END OF t_pa0008.
"Work areas
DATA:
w_pa0008 TYPE t_pa0008.
"Internal tables
DATA:
i_pa0008 TYPE STANDARD TABLE OF t_pa0008.
PARAMETERS:
list TYPE c RADIOBUTTON GROUP gr1,
grid TYPE c RADIOBUTTON GROUP gr1.
" ALV Declarations
" Types Pools
TYPE-POOLS:
slis.
" Types
TYPES:
t_fieldcat TYPE slis_fieldcat_alv,
t_events TYPE slis_alv_event,
t_layout TYPE slis_layout_alv,
t_sort TYPE slis_sortinfo_alv,
t_keyinfo TYPE slis_keyinfo_alv.
" Workareas
DATA:
w_fieldcat TYPE t_fieldcat,
w_events TYPE t_events,
w_sort TYPE t_sort,
w_layout TYPE t_layout,
w_keyinfo TYPE t_keyinfo.
" Internal Tables
DATA:
i_fieldcat TYPE STANDARD TABLE OF t_fieldcat,
i_events TYPE STANDARD TABLE OF t_events,
i_sort TYPE STANDARD TABLE OF t_sort.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
PERFORM build_fieldcatalog. "Fieldcatalog
PERFORM build_events. "Events table
PERFORM buid_layout. "Layout structure.
PERFORM build_sort_tab. "To sort table and get subtotal
PERFORM display_data.
*& Form get_data
FORM get_data.
DATA:l_0008 TYPE pa0008 OCCURS 0 WITH HEADER LINE.
SELECT pernr lga01 bet01
FROM pa0008
INTO CORRESPONDING FIELDS OF l_0008
WHERE begda LE sy-datum
AND endda GE sy-datum.
w_pa0008-pernr = l_0008-pernr.
w_pa0008-lga01 = l_0008-lga01.
w_pa0008-bet01 = l_0008-bet01.
APPEND w_pa0008 TO i_pa0008.
CLEAR w_pa0008.
w_pa0008-pernr = l_0008-pernr.
w_pa0008-lga01 = l_0008-lga02.
w_pa0008-bet01 = l_0008-bet02.
APPEND w_pa0008 TO i_pa0008.
CLEAR w_pa0008.
w_pa0008-pernr = l_0008-pernr.
w_pa0008-lga01 = l_0008-lga03.
w_pa0008-bet01 = l_0008-bet03.
APPEND w_pa0008 TO i_pa0008.
CLEAR w_pa0008.
w_pa0008-pernr = l_0008-pernr.
w_pa0008-lga01 = l_0008-lga04.
w_pa0008-bet01 = l_0008-bet04.
APPEND w_pa0008 TO i_pa0008.
CLEAR w_pa0008.
ENDSELECT.
ENDFORM. "get_data
*& Form build_fieldcatalog
FORM build_fieldcatalog.
PERFORM build_fcat USING:
"Field Int.Table Text
'PERNR' 'I_PA0008' 'PERNR', "Remove this if u dont want in the item table as well as it is there in the header table
'LGA01' 'I_PA0008' 'LGA01',
'BET01' 'I_PA0008' 'BET01'.
ENDFORM. "build_fieldcatalog
*& Form build_events
* text
FORM build_events.
CLEAR:
w_events, i_events[].
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
APPEND w_events TO i_events.
CLEAR w_events.
ENDFORM. "build_events
*& Form display_data
* text
FORM display_data.
DATA:
l_program TYPE sy-repid VALUE sy-repid,
l_fm TYPE RS38L_FNAM.
IF list = 'X'.
l_fm = 'REUSE_ALV_LIST_DISPLAY'.
ELSEIF grid ='X'.
l_fm = 'REUSE_ALV_GRID_DISPLAY'.
ENDIF.
CALL FUNCTION l_fm
EXPORTING
i_callback_program = l_program
is_layout = w_layout
it_fieldcat = i_fieldcat
it_events = i_events
it_sort = i_sort
TABLES
t_outtab = i_pa0008.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "display_data
*& Form build_fcat
FORM build_fcat USING l_field l_tab l_text.
w_fieldcat-fieldname = l_field.
w_fieldcat-tabname = l_tab.
w_fieldcat-seltext_m = l_text.
IF l_field = 'BET01'.
w_fieldcat-do_sum = 'X'.
ENDIF.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " build_fcat
*& Form top_of_page
* text
FORM top_of_page.
DATA :
i_header TYPE slis_t_listheader,
w_header LIKE LINE OF i_header.
DATA:l_date1 TYPE datum,
l_date2 TYPE datum.
w_header-typ = 'S'.
w_header-info = sy-title.
APPEND w_header TO i_header.
CLEAR w_header.
w_header-typ = 'H'.
w_header-info = sy-repid.
APPEND w_header TO i_header.
CLEAR w_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_header
i_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page
*& Form BUILD_sort_tab
FORM build_sort_tab .
CLEAR :i_sort[],w_sort.
w_sort-spos = 1.
w_sort-fieldname = 'PERNR'.
w_sort-tabname = 'I_PA0008'. "header table
w_sort-up = 'X'.
w_sort-subtot = 'X'.
APPEND w_sort TO i_sort.
CLEAR w_sort.
ENDFORM. " BUILD_sort_tab
*& Form buid_layout
FORM buid_layout .
w_layout-totals_text = 'Total'.
w_layout-subtotals_text = 'S.Total'.
ENDFORM. " buid_layout
Regards,
Venkat.O -
ALV GRID - Text for Grand Total
Hi guys,
In ALV Grid, i need to display the Text 'GRAND TOTAL' at the left side of the row(Yellow line).
I have tried searching in the forum but didn't get the answer.
Please advice.
Thanks
ChintuHi
<br><br>
IF you copy and past this might not work but this is the sample code<br><br>
<pre>
REPORT Y_DOWN_TIME_ENTRYSRA.
TABLES : YDOWNTIME1.
TYPE-POOLS : SLIS.
*INTERNAL TABLE DECLARTION
data : l_layout type slis_layout_alv,
x_events type slis_alv_event,
it_events type slis_t_event.
DATA :ITAB LIKE YDOWNTIME1 OCCURS 0 WITH HEADER LINE .
data : GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
wa_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
**********************SELECTION PARAMETERS ************************
PARAMETERS: CB1 RADIOBUTTON GROUP G1 ,
CB2 RADIOBUTTON GROUP G1 ,
cb3 RADIOBUTTON GROUP G1 ,
CB4 RADIOBUTTON GROUP G1 ,
CB5 RADIOBUTTON GROUP G1 ,
CB6 RADIOBUTTON GROUP G1 ,
CB7 RADIOBUTTON GROUP G1 ,
CB8 RADIOBUTTON GROUP G1 ,
CB9 RADIOBUTTON GROUP G1 .
CB10 RADIOBUTTON GROUP G1,
CB11 RADIOBUTTON GROUP G1.
DATA : A TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS :S_EQUNR FOR YDOWNTIME1-EQUNR ,
S_ERDop FOR YDOWNTIME1-ERDAT,
S_MFSTT FOR YDOWNTIME1-MFSTART.
PARAMETERS : P_SHIFT TYPE YDOWNTIME1-SHIFT,
P_CHARG TYPE YDOWNTIME1-CHARG,
p_COGRU TYPE YDOWNTIME1-QMGRP,
P_CODE TYPE YDOWNTIME1-COde,
p_name type ydowntime1-OPNAME,
p_sup TYPE YDOWNTIME1-SUPERVISOR,
P_MANG TYPE YDOWNTIME1-MANG.
SELECTION-SCREEN END OF BLOCK BK1 .
AT SELECTION-SCREEN.
IF CB1 EQ 'X'.
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop .
ELSEIF CB2 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and charg eq p_charg .
ELSEIF CB3 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and charg eq p_charg and shift eq P_SHIFT .
ELSEIF CB4 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where code eq p_code and erdat in S_ERDop.
ELSEIF CB5 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and EQUNR in S_EQUNR and QMGRP eq p_COGRU.
ELSEIF CB6 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where OPNAME eq p_name and erdat in S_ERDop.
ELSEIF CB7 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where SUPERVISOR eq p_sup and erdat in S_ERDop.
ELSEIF CB8 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where MANG eq p_MANG and erdat in S_ERDop.
ELSEIF CB9 EQ 'X'.
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and EQUNR in S_EQUNR.
endif.
loop at itab.
if itab-schno > 1.
A = ' '.
move A to itab-DCOR .
move A to itab-DCCR .
move A to itab-DCNR .
modify itab.
endif.
endloop.
perform create_fieldcat.
data: sort type slis_sortinfo_alv,
it_sort type SLIS_T_SORTINFO_ALV.
sort-fieldname = 'EQUNR'.
sort-up = 'X'.
sort-subtot = 'X'.
APPEND sort to it_sort.
sort-fieldname = 'SHIFT'.
sort-up = 'X'.
*sort-subtot = 'X'.
APPEND sort to it_sort.
l_layout-TOTALS_TEXT = 'TOTAL'.
l_layout-SUBTOTALS_TEXT = 'SUBTOTAL'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = gt_fieldcat
it_events = it_events
it_sort = it_sort
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form CREATE_FIELDCAT
text
--> p1 text
<-- p2 text
FORM CREATE_FIELDCAT .
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '1'.
LS_FIELDCAT-FIELDNAME = 'ERDAT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Date'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'UZEIT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '8'.
LS_FIELDCAT-SELTEXT_L = 'Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'EQUNR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '8'.
LS_FIELDCAT-SELTEXT_L = 'Equipment'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'CODE'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
LS_FIELDCAT-SELTEXT_L = 'CODE'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '3'.
LS_FIELDCAT-FIELDNAME = 'QMGRP'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Code Group'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '3'.
LS_FIELDCAT-FIELDNAME = 'KURZTEXT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '40'.
LS_FIELDCAT-SELTEXT_L = 'Code Text'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '7'.
LS_FIELDCAT-FIELDNAME = 'DCOR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '14'.
LS_FIELDCAT-SELTEXT_L = 'Opening Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '8'.
LS_FIELDCAT-FIELDNAME = 'DCCR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '14'.
LS_FIELDCAT-SELTEXT_L = 'Closing Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'DCNR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Net Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'PRO'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'PROD IN LAC'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '4'.
LS_FIELDCAT-FIELDNAME = 'CHARG'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Batch Number'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'OPNAME'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Operators Name'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'SUPERVISOR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Supervisor Name'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'MANG'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Manager'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'SHIFT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Shift'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'MFSTART'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'Start Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'MFEND'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'End Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'DURATION'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'DURATION'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'ZUNIT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'UNIT'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
ENDFORM. " CREATE_FIELDCAT
</pre>
Edited by: Matt on Sep 3, 2009 12:06 PM -
hi gurus pls help me on this issue....... i want grand total on each column of this report.
for example field 'metric-safety'. if possbile try to edit this and send me.
TYPE-POOLS : slis.
Tables : Marc, " Plant Data for Material
Mbew, " Material Valuation
Ekpo, " Purchasing Document Item
Eord, " Purchasing Source List
Zpmt. " Purchasing Metric Table
Internal Tables Declaration----
Data : Begin of metric occurs 0,
matnr like marc-matnr, " Material number
werks like marc-werks, " Plant
minbe like marc-minbe, " Recoder Point
eisbe like marc-eisbe, " Safety Stock
stprs like mbew-stprs, " Standard Price
lifnr like eord-lifnr, " Vendor
menge like ekpo-menge, " PO Quantity
scalc type p decimals 2,
safety(20) type c,
tcalc type p decimals 2,
Target(20) type c,
acalc type p decimals 2,
actual(20) type c,
ecalc type p decimals 2,
excess(20) type c,
ucalc type p decimals 2,
usafety(20) type c,
*******Custom table
inscr like zpmt-inscr, " Inventory Score
stkot like zpmt-stkot, " Stock Out
impct like zpmt-impct, " Impact
nafta like zpmt-nafta, " %nafta
stscr like zpmt-stscr, " Stock Out Score
end of metric.
Data : final like metric occurs 0 with header line.
DATA: fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
**Data : Begin of output occurs 0,
lifnr like eord-lifnr, " Vendor
eisbe like marc-eisbe, " Safety Stock
minbe like marc-minbe, " Re-order Point
stprs like mbew-stprs, " Standard Price
sstock(13) type c, " Value of Safety Stock
Actual(13) type c, " Actual
Excess(13) type c, " Excess Inv
underSs(13) type c, " Under Safety Stock
end of output.
Data type Declaration----
Data : a type c value '$'.
Data : safety(20) type c,
target(20) type c,
actual(20) type c,
excess(20) type c,
usafety(20) type c,
repid like sy-repid.
data : i_pos type i.
Selection Screen----
selection-screen : begin of block b1 with frame Title tname.
Select-options: Mat for marc-matnr, " Material Number Selection
Plt for marc-werks, " Plant Selection
Vdr for eord-lifnr. " Vendor Selection
selection-screen : end of block b1.
Initialization----
initialization.
tname = 'Purchasing Metric Report'.
At Selection-Screen----
At selection-screen.
IF mat = ' ' and Plt = ' ' and Vdr = ' '.
message e000.
*elseif mat metric-matnr.
*message e001.
*elseif plt metric-werks.
*message e002.
*elseif vdr metric-lifnr.
*message e003.
endif.
Start-of-Selection----
Start-of-selection.
*******For Data Retrival
Perform Data_retrival.
*******For Calculation
Perform Calculation.
*******For Building Fieldcatalog
Perform Build_fieldcatalog.
*******Alv Display
Perform Alv_display.
*& Form Get_Data
text
FORM Data_retrival .
SELECT a~matnr
a~werks
a~eisbe
a~minbe
b~matnr
b~stprs
c~matnr
c~lifnr
d~matnr
d~menge
into corresponding fields of table metric from
( ( ( marc as a inner join mbew as b on bmatnr = amatnr )
inner join eord as c on cmatnr = amatnr )
inner join ekpo as d on dmatnr = amatnr )
where amatnr in mat and awerks in plt and c~lifnr in vdr.
if sy-subrc = 0.
sort metric by matnr.
endif.
ENDFORM. " Get_Data
*& Form Calculation
text
FORM Calculation .
loop at metric.
******calculation for safety stock ( safety stock * standard price )
metric-scalc = metric-eisbe * metric-stprs.
move metric-scalc to safety.
condense safety.
concatenate a safety into metric-safety.
******calculation for target ( safety stock + standard price )
metric-tcalc = ( metric-eisbe * metric-stprs ) + metric-stprs.
move metric-tcalc to target.
condense target.
concatenate a target into metric-target.
******calculation for Actual ( Po quantity * standard price )
metric-acalc = metric-menge * metric-stprs.
move metric-acalc to actual.
condense actual.
concatenate a actual into metric-actual.
******calculation for Excess Inv ( Actual - Target )
metric-ecalc = ( metric-menge * metric-stprs ) - ( ( metric-eisbe * metric-stprs ) + metric-stprs ).
move metric-ecalc to excess.
condense excess.
concatenate a excess into metric-excess.
******calculation for Under Safety Stock ( actual < safety stock. then actual + safety stock (Else) zero )
if actual < safety.
metric-menge * metric-stprs < metric-eisbe * metric-stprs.
metric-ucalc = ( metric-menge * metric-stprs ) + ( metric-eisbe * metric-stprs ).
else.
metric-ucalc = 0.
endif.
move metric-ucalc to usafety.
condense usafety.
concatenate a usafety into metric-usafety.
collect metric into final.
endloop.
ENDFORM. " Calculation
*--End-for-Selection--
*end-of-selection.
*loop at final.
*write : / final-lifnr, final-safety, final-target, final-actual, final-excess, final-usafety.
*endloop.
*& Form Build_fieldcatalog
text
--> p1 text
<-- p2 text
FORM Build_fieldcatalog .
fcat-fieldname = 'LIFNR'.
fcat-seltext_m = 'Vendor'.
fcat-col_pos = i_pos.
fcat-outputlen = 10.
fcat-emphasize = 'X'.
fcat-key = 'X'.
fcat-do_sum = 'X'.
fcat-edit = 'X'.
append fcat to fcat.
clear fcat.
i_pos = i_pos + 1.
fcat-fieldname = 'SAFETY'.
fcat-seltext_m = 'Safety Stock'.
fcat-col_pos = 2.
fcat-outputlen = 10.
fcat-emphasize = 'X'.
fcat-do_sum = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'ACTUAL'.
fcat-seltext_m = 'Actual'.
fcat-col_pos = 3.
fcat-outputlen = 10.
fcat-emphasize = 'X'.
fcat-do_sum = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'TARGET'.
fcat-seltext_m = 'Target'.
fcat-col_pos = 4.
fcat-outputlen = 10.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'EXCESS'.
fcat-seltext_m = 'Excess Inv'.
fcat-col_pos = 5.
fcat-outputlen = 10.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'USAFETY'.
fcat-seltext_m = 'Under Safety Stock'.
fcat-col_pos = 6.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'INSCR'.
fcat-seltext_m = 'Iventory Score'.
fcat-col_pos = 7.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'STKOT'.
fcat-seltext_m = 'Stock Out'.
fcat-col_pos = 6.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'IMPCT'.
fcat-seltext_m = 'Impact'.
fcat-col_pos = 6.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'NAFTA'.
fcat-seltext_m = '%Nafta'.
fcat-col_pos = 6.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
fcat-fieldname = 'STSCR'.
fcat-seltext_m = 'Safety Out Score'.
fcat-col_pos = 6.
fcat-outputlen = 20.
fcat-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fcat to fcat.
clear fcat.
ENDFORM. " Build_fieldcatalog
*& Form Alv_display
text
--> p1 text
<-- p2 text
FORM Alv_display .
repid = sy-repid.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = final
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
*IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fcat[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = final
exceptions
program_error = 1
others = 2.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
thx in advancehi,
for subtotal and grand total do the same thing like following,
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
if uesful rewars points -
Problem with Grand total in Crystal report xi
Post Author: eshwar_polawar
CA Forum: Crystal Reports
Dear all,
I am facing the problem with Grand total field in Report footer.Please advise me how should we resolve it.
My report design as follows
Report Title
Page Header section:
charged date fee_ description charge_ amount currency_code
Group Header #1(Group by bank_ref)
Group Header #2(Group by Currency code)
Details
charged date fee_ description charge_ amount currency_code
Group Footer#2
(Sub Total )
Running Total field(Fields to Summarize on Charge_amount, Evaluate on "Group2# change of currency code) ,Sum of Charge_amount,Currency_ code
Report footer:
Sum of (charge_amount) currecy code
Example of data:
charged date fee desc chrage amount currencycode
0000000060129
CAD
10-Oct-2007 Transfer 200 Cad
11-Oct-2007 comm 150 cad
Sub total 350 Cad
0000000060129
CAD
10-Oct-2007 Transfer 100 USD
11-Oct-2007 comm 150 USD
Sub total 250 USD
Grand total should 350 CAD but it is showing all total amoun 1000 CAD ,Group by Curreny code in the table
250 USD but it is showing all total amount 1200 USD
Please provide the solutions like:
1).About Running total in Report footer section
2).Formula on While printing records for grand total
3).How will send links with subreports
Thanks and Regards
EshwarPost Author: eshwar_polawar
CA Forum: Crystal Reports
eshwar_polawar:
Dear all,
I am facing the problem with Grand total field in Report footer.Please advise me how should we resolve it.
My report design as follows
Report Title
Page Header section:
charged date fee_ description charge_ amount currency_code
Group Header #1(Group by bank_ref)
Group Header #2(Group by Currency code)
Details
charged date fee_ description charge_ amount currency_code
Group Footer#2
(Sub Total )
Running Total field(Fields to Summarize on Charge_amount, Evaluate on "Group2# change of currency code) ,Sum of Charge_amount,Currency_ code
Report footer:
Sum of (charge_amount) currecy code
Example of data:
charged date fee desc chrage amount currencycode
0000000060129
CAD
10-Oct-2007 Transfer 200 Cad
11-Oct-2007 comm 150 cad
Sub total 350 Cad
0000000060129
CAD
10-Oct-2007 Transfer 100 USD
11-Oct-2007 comm 150 USD
Sub total 250 USD
Grand total should 350 CAD but it is showing all total amoun 1000 CAD ,Group by Curreny code in the table
250 USD but it is showing all total amount 1200 USD
Please provide the solutions like:
1).About Running total in Report footer section
2).Formula on While printing records for grand total
3).How will send links with subreports
Thanks and Regards
Eshwar -
Post Author: eshwar_polawar
CA Forum: Formula
Dear all,
I am facing the problem with Grand total field in Report footer.Please advise me how should we resolve it.
My report design as follows
Report Title
Page Header section:
charged date fee_ description charge_ amount currency_code
Group Header #1(Group by bank_ref)
Group Header #2(Group by Currency code)
Details
charged date fee_ description charge_ amount currency_code
Group Footer#2
(Sub Total )
Running Total field(Fields to Summarize on Charge_amount, Evaluate on "Group2# change of currency code) ,Sum of Charge_amount,Currency_ code
Report footer:
Sum of (charge_amount) currecy code
Example of data:
charged date fee desc chrage amount currencycode
0000000060129
CAD
10-Oct-2007 Transfer 200 Cad
11-Oct-2007 comm 150 cad
Sub total 350 Cad
0000000060129
CAD
10-Oct-2007 Transfer 100 USD
11-Oct-2007 comm 150 USD
Sub total 250 USD
Grand total should 350 CAD but it is showing all total amoun 1000 CAD ,Group by Curreny code in the table
250 USD but it is showing all total amount 1200 USD
Thanks and Regards
EshwarPost Author: eshwar_polawar
CA Forum: Crystal Reports
eshwar_polawar:
Dear all,
I am facing the problem with Grand total field in Report footer.Please advise me how should we resolve it.
My report design as follows
Report Title
Page Header section:
charged date fee_ description charge_ amount currency_code
Group Header #1(Group by bank_ref)
Group Header #2(Group by Currency code)
Details
charged date fee_ description charge_ amount currency_code
Group Footer#2
(Sub Total )
Running Total field(Fields to Summarize on Charge_amount, Evaluate on "Group2# change of currency code) ,Sum of Charge_amount,Currency_ code
Report footer:
Sum of (charge_amount) currecy code
Example of data:
charged date fee desc chrage amount currencycode
0000000060129
CAD
10-Oct-2007 Transfer 200 Cad
11-Oct-2007 comm 150 cad
Sub total 350 Cad
0000000060129
CAD
10-Oct-2007 Transfer 100 USD
11-Oct-2007 comm 150 USD
Sub total 250 USD
Grand total should 350 CAD but it is showing all total amoun 1000 CAD ,Group by Curreny code in the table
250 USD but it is showing all total amount 1200 USD
Please provide the solutions like:
1).About Running total in Report footer section
2).Formula on While printing records for grand total
3).How will send links with subreports
Thanks and Regards
Eshwar -
About Grand Total in Tabular view report
Hi All,
I am working on a tabular report view. While working grand total on few columns, the title "Grand Total" is appearing below the very first column of report. Is any way to set the location of this title below any other column?
One more thing on which i need guidance, I have a calculated column(simply sum of two fact values) and i want to keep away this column from my grand total listed columns. For this i tried to set aggregation rule NULL but it did not work(In such case report column showing nothing. may be null values are coming in this case). I have also tried to CAST the fact numeric columns to CHAR. But it also did not work.
Could you please suggest me a way to do this. I am using OBIEE 11.1.1.3.0 version.
Thanks,
Archie.I am working on a tabular report view. While working grand total on few columns, the title "Grand Total" is appearing below the very first column of report. Is any way to set the location of this title below any other column?You can simply try to format the heading here..by using some left padding and marking the horizontal alignement as centre or something. Play with formatting here..
One more thing on which i need guidance, I have a calculated column(simply sum of two fact values) and i want to keep away this column from my grand total listed columns. For this i tried to set aggregation rule NULL but it did not work(In such case report column showing nothing. may be null values are coming in this case). I have also tried to CAST the fact numeric columns to CHAR. But it also did not work.Only possible if you can push the calculation to RPD and then set aggr rule to NULL in answers ..else no possibility.
Hope answered -
OBIEE Avg Issue on Grand Total
Hello Experts,
I'm having an issue while calculating the grand total for the AVG measure.This is the scenario
1)I have the show count for the top three tiles for the rolling 13 weeks and only for the weekends and for a particular group of theaters.I have a 13 week indicator and weekend indicator in the filter.
2) I have the show count to which is using ((showcount/3(top 3 titles))/ 3(3 days in the week)) = ShowCount/9
3) now when i'm doing the grand total in the pivot rules summation after ,then it is showing sum of all the averages......but this is not my case...my case should be it has to show the avg of all the theaters that are in group of theaters.
how can i resolve this issue?
Any help is greatly appreciated.Hi User,
This report is corrupted. You can rebuild or re copy the xml from 10g to 11g and see if it works.
Thanks,
Amol
(Please mark this answer, if you find helpful) -
Issue in ALV Grid Grand Totals
Hi Friends,
Hwo can i display grand total text in ALV Grid? Eventhough i am using Totals_text parameter in layout i am unable to display. any one vcan help me out in this refgard.
if pos send the code
Regards,
Vijay<REMOVED BY MODERATOR>
SAMPLE PROGRAM:
REPORT ysalesorder_alv_subtotals.
* Type Pools
TYPE-POOLS:slis.
* Tables
TABLES: vbak, "Sales Document: Header Data
vbap. "Sales Document: Item Data
* Global Structures
DATA:gt_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
gt_sortcat TYPE slis_t_sortinfo_alv,
wa_sortcat LIKE LINE OF gt_sortcat.
* Internal Table
DATA: BEGIN OF gt_salesorder OCCURS 0,
vbeln LIKE vbak-vbeln, " Sales Document Number
posnr LIKE vbap-posnr, " Sales Doc Item
netwr LIKE vbap-netwr, " Net Value
END OF gt_salesorder.
* SELECT OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME
TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. " Sales Document
Number.
SELECTION-SCREEN END OF BLOCK b1.
* Initialization
INITIALIZATION.
PERFORM initialization.
* Start Of Selection
START-OF-SELECTION.
PERFORM field_catalog. "For Structure Creation
PERFORM fetch_data. "Get the Data From DB Table
PERFORM sorting USING gt_sortcat.
* End Of Selection
END-OF-SELECTION.
PERFORM display_data.
*& Form initialization
* text
* --> p1 text
* <-- p2 text
FORM initialization .
s_vbeln-sign = 'I'.
s_vbeln-option = 'BT'.
s_vbeln-low = '4969'.
s_vbeln-high = '5000'.
APPEND s_vbeln.
ENDFORM. " initialization
*& Form field_catalog
* text
* --> p1 text
* <-- p2 text
FORM field_catalog .
REFRESH : gt_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-col_pos = '1'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'VBELN'. "Field Name
wa_fieldcat-key = 'X'. "Blue Color
wa_fieldcat-seltext_m = 'Sales Doc No'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '2'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table Name
wa_fieldcat-fieldname = 'POSNR'. "Field Name
wa_fieldcat-seltext_m = 'Sales Doc Item'."Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
*SubTotal on the Field NETWR
wa_fieldcat-col_pos = '3'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'NETWR'. "Field Name
wa_fieldcat-do_sum = 'X'. "Sum
wa_fieldcat-seltext_m = 'Net Value'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " field_catalog
*& Form sorting
* text
* -->P_IT_SORTCAT text
FORM sorting USING p_it_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortcat.
wa_sortcat-fieldname = 'VBELN'.
wa_sortcat-up ='X'.
wa_sortcat-subtot = 'X'.
APPEND wa_sortcat TO p_it_sortcat.
ENDFORM. " sorting
*& Form display_data
* text
* --> p1 text
* <-- p2 text
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
it_fieldcat = gt_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = gt_sortcat
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_salesorder
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER
SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_data
*& Form fetch_data
* text
* --> p1 text
* <-- p2 text
FORM fetch_data .
REFRESH : gt_salesorder.
CLEAR : gt_salesorder.
SELECT a~vbeln
posnr
b~netwr
FROM vbak AS a
INNER JOIN vbap AS b ON a~vbeln = b~vbeln
INTO TABLE gt_salesorder
WHERE a~vbeln IN s_vbeln.
ENDFORM. " fetch_data
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 12:24 PM -
Hi experts,
I have one internal table containing 2 fields quantity and amount.In the output i want to show total quantity and total amount. How can i achive it..?
something like this
qty amt
1 10
2 20
3 30
6 60
reward guaranteed
thanks
Kakihi asit
iam not able to get the totals correctly....can u see this code....every thing is correct except grand totals..
REPORT YVFJAUD_BILLDET no standard page heading
line-size 200
line-count 65
message-id Z1.
*-- Table Declaration
TABLES: ZFJAUD_BILL,RLGRAP.
DATA: BEGIN OF T_BILL OCCURS 0,
VBELN LIKE ZFJAUD_BILL-VBELN, " Billin Doc number
POSNR like ZFJAUD_BILL-POSNR, " Billing item
CHARG like ZFJAUD_BILL-CHARG, " Batch Number
FKDAT like ZFJAUD_BILL-FKDAT, " Posting date
FKART like ZFJAUD_BILL-FKART, " Billing type
KUNAG like ZFJAUD_BILL-KUNAG, " Customer(Sold-to-party)
MATNR like ZFJAUD_BILL-matnr, " Material number
FKIMG like ZFJAUD_BILL-FKIMG, " Batch Quantity
NETWR like ZFJAUD_BILL-NETWR, " Amount
WAERK like ZFJAUD_BILL-WAERK, " Currency
VERPR like ZFJAUD_BILL-VERPR, " TP
BNAME like ZFJAUD_BILL-BNAME, " End customer
AUGRU_AUFT like ZFJAUD_BILL-AUGRU_AUFT, "Order reason
END OF T_BILL.
select-options : s_vtweg for ZFJAUD_BILL-vtweg obligatory,
s_vkbur for ZFJAUD_BILL-vkbur,
s_kunag for ZFJAUD_BILL-kunag,
s_matnr for ZFJAUD_BILL-matnr,
s_prodh for ZFJAUD_BILL-prodh,
s_erdat for ZFJAUD_BILL-erdat obligatory,
s_werks for ZFJAUD_BILL-werks,
s_lgort for ZFJAUD_BILL-lgort.
selection-screen begin of block blk1 with frame title text-002.
parameters : p_file like rlgrap-filename
default 'C:\yvfjaud_billdet.xls'.
SELECTION-SCREEN SKIP 1.
PARAMETERS : p_flag AS CHECKBOX DEFAULT ' '.
selection-screen end of block blk1.
START-OF-SELECTION.
perform collect_data.
perform display_data.
if p_flag = 'X'.
perform download_to_localpc.
endif.
TOP-OF-PAGE.
perform set_page_header.
*& Form collect_data
text
FORM collect_data .
SELECT VBELN POSNR CHARG FKART KUNAG MATNR FKDAT
FKIMG NETWR WAERK NETPR VERPR BNAME AUGRU_AUFT BNAME
FROM ZFJAUD_BILL
INTO CORRESPONDING FIELDS OF TABLE T_BILL
WHERE
vtweg IN s_vtweg AND
vkbur IN s_vkbur AND
kunag IN s_kunag AND
matnr IN s_matnr AND
prodh IN s_prodh AND
erdat IN s_erdat AND
werks IN s_werks AND
lgort IN s_lgort.
ENDFORM. "collect_data
FORM download_to_localpc .
call function 'WS_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = t_bill.
if sy-subrc <> 0.
message E000 with 'Download not successful'.
endif.
ENDFORM. " download_to_localpc
FORM display_data .
sort t_bill by vbeln.
loop at t_bill.
if t_bill-AUGRU_AUFT = '100' OR
t_bill-AUGRU_AUFT = '101' OR
t_bill-AUGRU_AUFT = '102'.
t_bill-FKIMG = '0.00'.
endif.
write :/1 t_bill-VBELN ,
15 t_bill-POSNR,
25 t_bill-CHARG,
40 t_bill-FKDAT,
55 t_bill-FKART,
70 t_bill-KUNAG,
85 t_bill-matnr,
100 t_bill-FKIMG,
115 t_bill-NETWR,
140 t_bill-WAERK,
145 t_bill-VERPR,
165 t_bill-BNAME.
endloop.
data: line line like t_bill occurs 0 with header line.
loop at t_bill into line.
write:/ line-FKIMG,line-netwr.
AT END OF FKIMG.
SUM.
ULINE.
WRITE: / line-FKIMG, line-netwr.
SKIP.
ENDAT.
AT LAST.
SUM.
ULINE.
WRITE: / line-FKIMG, line-netwr.
ENDAT.
endloop.
ENDFORM. " display_data
FORM set_page_header .
call function 'Z_REPORT_TITLE'
EXPORTING
line_size = sy-linsz
sy_title = 'Billing Details with Cost'
uline = 'X'
first_page_only = ' '.
write :1(15) 'Billing Doc' color col_heading,
15(15) 'Item' color col_heading,
25(15) 'Batch' color col_heading,
40(15) 'Posting Date' color col_heading,
55(15) 'Billing Type' color col_heading,
70(15) 'Sold-to-party' color col_heading,
85(30) 'Material' color col_heading,
110(15) 'Qty' color col_heading,
125(15) 'Amount' color col_heading,
140(15) 'Currency' color col_heading,
155(15) 'TP' color col_heading,
165(15) 'End Customer' color col_heading.
ENDFORM. " set_page_header -
OBIEE 10g - Unable to see data in the report view with grand total applied
Hi,
We're facing with a strange issue.
We're working on a report view.
We're able to see data when Grand total is not applied on the report. The moment Grand Total is applied, it's showing either an empty table with NULL values or "No Results" page.
Please help.
Thanks in advance.
-RamaHi Dpk,
Thanks for your reply.
I included it in the instanceconfig.xml, but the issue still exists.
Couple of Observations
#1 - We noticed this issue when we drill down to the level which has really sparse data.
It works fine when we look at the enterprise wide report.
#2 - Works fine with few dimensional attributes and facts on the report
When we add a fact that doesn't have any value at that level, the issue starts to appear.
Thanks in advance.
-Rama -
% is not getting correctly for the Grand Total Row in OBI10g
Hi,We have a report in table view with the following structure.
Name Target Act %Ach
ABC 100 50 50
XYZ 200 10 5
Total 300 60 27.5
The value for the %Ach Total row should be 20% but in the report it is showing as 27.5.
any one observed this ,how to correct this??
ThanksHi,
To get grand total correctly..configure instanceconfig.xml and put..
<ReportAggregateEnabled>true</ReportAggregateEnabled> between <serverinstace>..
refer..
http://obiee101.blogspot.com/2009/09/obiee-grand-totals-with-calculated.html
Hope it solves ur problem -
Urgent:Grand total in hierarchical alv
I am printing a hierarchical alv with subtotals. I want to print the grand total for the whole numeric columns ...
Can anyone explain me how i can do this.
Thanks and regards,
SubhakarHi,
In this case you not only require the totals but the subtotals also.
For achieving this output you will have to sort the alv on the first column and also give subtotals there.
use
data: SORTF TYPE SLIS_SORTINFO_ALV,
TSORT TYPE SLIS_T_SORTINFO_ALV.
in the function module reuse_alv_grid_display give
it_sort = tsort.
eg:
FORM ALV_SHOW.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT-BOX_TABNAME = 'IT_DISPLAY'.
LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
LAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = TCATALOG
IS_VARIANT = VAR1
I_SAVE = 'A'
IT_SORT = TSORT
IT_EVENTS = TEVENT[]
TABLES
T_OUTTAB = IT_DISPLAY.
ENDFORM . "ALV_SHOW
and write a subroutine for sort...
form sort.
CLEAR SORTF.
SORTF-spos = 1.
SORTF-fieldname = 'column_1'.
SORTF-tabname = 'IT_table used for display in alv'.
SORTF-up = 'X'.
SORTF-subtot = 'X'.
APPEND SORTF TO TSORT.
endform.
If this doesn't help I will send you the whole source of a sample program..
Abdullah -
Sub total wise Grand total in ALV report
Dear All,
I am displaying a list of material through material group wise so for each material i want to display sub-total for stock and grand total of stock(material group wise).Here it is adding up all the stock displayed for different AUOM(alternative unit of measure ) which is for same material so i want to pick only the sub-total and sum up in my Grand total.
How to pick only the Sub-total Results and Add in ALV List for Grand total.
Thanks & Regards,
Arun.
Edited by: Arun Kumaran on Sep 24, 2008 7:46 AMHi arun,
check these links
total and subtotal in alv
ALV SUBTOTAL
Regards,
Anirban
Maybe you are looking for
-
CUCM 10.5 Local Route Group
When utilizing the local route group for a device pool, when a change is made for that device pool, does a reset of the devices have to occur for the changes to go into affect? The reason I ask is if you are simply making the change to the Route Lis
-
Keyboard canadian french bluetooth
Hi, I seach a keyboard with this SAME configuration because my macbook Air has this configuration and i don't want to change that. Help me to find an Apple keyboard with this configuration. i want the ç,à,è,«,»,ù,é,<,>,",°,............. in all other
-
Can't download version 11.1.1
After opening Itunes I get message to download latest version 11.1.1. When I click download, nothing happens. I've tried restarting my computer then opening Itunes again. No success. How can I download the latest version of Itunes?
-
How can I tell if my HD has been encrypted by a third party?
I had someone call saying they were from Yahoo, and that one of my email addresses was sending out scam messages.they also showed me where my event log was showing several errors and where a lot of Microsoft systems were Stopped.I just found out from
-
Oracle Open World 2012会发布Oracle Database 12c吗?
Oracle Open World 2012会发布Oracle Database 12c吗? 大家讨论一下!