How to get grand total in query designer
Hi,
Antbody know how to get the grand total after the last row in query designer? I
Thanks
Hi,
If we select the very first Characterstic in the rows section and set the Supress result rows as "never".
That will show the overall result in the end of the report,
In the query properties tab ,check for display properties of the result.That should be set to bottom.
Hope this will work.
Thanks
Mukesh
Similar Messages
-
How to get Grand Total Text in ALV GRID
Hi Folks,
I am able to get the SUBTOTAL TEXT .....But i need...
How to get Grand Total Text in ALV GRID Display...
Can any one give a Solution for this...Hi Surendar,
Check out this code.. this is showing Total Text in Toal line in the very first column.
REPORT zsales_ord_det_1 .
TABLES: ztable_10.
TYPE-POOLS: slis.
DATA: BEGIN OF it OCCURS 0,
srno(6) type c,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it.
DATA : BEGIN OF it_temp OCCURS 0,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it_temp.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: v_repid LIKE sy-repid,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
gs_layout TYPE slis_layout_alv,
gd_layout TYPE slis_layout_alv,
i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
START-OF-SELECTION.
v_repid = sy-repid.
SELECT * FROM ztable_10 INTO TABLE it_temp.
LOOP AT it_temp .
it-srno = 'Total'.
it-name = it_temp-name.
it-age = it_temp-age.
APPEND it.
ENDLOOP.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'IT'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'SRNO'.
wa_fieldcat-tabname = it.
append wa_fieldcat to i_fieldcat.
LOOP AT i_fieldcat INTO wa_fieldcat.
IF wa_fieldcat-fieldname = 'AGE'.
wa_fieldcat-do_sum = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat.
ENDIF.
IF wa_fieldcat-fieldname = 'SRNO'.
Hide this field so that it can display it's content i.e.
Total text in Subtotal level
wa_fieldcat-tech = 'X'.
wa_fieldcat-no_out = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
ENDIF.
ENDLOOP.
wa_sort-spos = 1.
wa_sort-fieldname = 'SRNO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort.
gd_layout-no_totalline = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = '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 = gd_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = i_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
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 = it
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.
Regards,
Seema -
Hi,
Experts,
I am able to get the subtotal text but i am not able to get the grand total text please pass some code or idea on it.
ex:
2510 gopi 10
2511 gopi 20
subtotal 30
2521 anand 20
2522 anand 10
2523 anand 50
subtotal 80
2512 vikram 30
subtotal 30
(blank----) 140.
Here i want to get text as 'COMPANY TOTAL'. by using REUSE_ALV_GRID_DISPLAY FM.
Thanks,
Shabeer ahmed.Hi,
you can get the 'COMPANY TOTAL' by using the following code:
LOOP AT i_main INTO w_main.* Storing the Total text need to be displayed in
ALV
w_final-total = 'COMPANY TOTAL'.
w_final-field1 = w_main-field1.
w_final-field2 = w_main-field2.
w_final-field3 = w_main-field3 .
APPEND w_final TO i_final. ENDLOOP.
Regards,
Santosh -
Get Current year in Query Designer
Dear all
I don't know how to determine current year in Query Designer.
I have a report, i want to see some indexs in bance sheet and income statement in current year and previous year. but, I can only assign with the fixed year (ex, 2010), this is not flexible. I want to get current year on system and calculate previous year.
Please help me solve this problem
ThanksHi,
You can use the SAP Exit variable 0CALYEAR for current year. For Previous year you can offset this by -1.
You can refer this link for more Information,
http://help.sap.com/saphelp_bw33/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
Regards,
Hari.
Edited by: Hari Krishnan K on Jul 20, 2010 10:36 AM -
How to get rowcount in a query which is built on Infocube
Hi,
I would like to show rowcount for a report which is built on Infocube.
If i have a query on DSO, i would get Rowcount in the query designer but how can we get this same Rowcount if i create a query on Infocube.
Thanks in advanceIf you want to just know the number of records without the need to offer this to users in a query, then use transaction LISTCUBE.
Make you "Field Selection for Output" via the button to tick the characteristics by which you want to count the number of entries and tick the box "Output number of hits" in the settings section of the selection screen, clear the "Max number of hits" field to make sure you get all rows in your result. On the result list the field counter shows the number of entries.
Best,
Ralf -
How to get a total record count before grouping?
I need to group a report on a formula that does roughly the following:
[record count] / ( [total record count] / 20 )
What this acheives is to label each record with a number of 1 - 20 which I want to group on. Getting this figure is the easy part, what is not working is the fact that I cannot group from a formula that is calculated after grouping. I overcame a portion of this by using "Whilereadingrecords" (rather than "count", running totals, or while printing records) to acheive a record count.
I can't figure out how to get a total record count done before grouping. Is there a way to do this with "WhileReadingRecords"?? Is this even possible?
Thanks
JohnHi John,
The order of how Crystal does things dictates the order of which features you can use. Crystal has a two pass method. In the first pass it does things like passing the query, grouping, summarizing. In the second pass it does formulas, formatting, etc.
Unfortunately Crystal does the Grouping before summarizing so what you want to do can't be done in Crystal. The best way to get around this to either create a SQL Command or view/stored procedure that will do the summarizing for you. Then in the report you can use it.
Hope this helps,
Brian -
How To Get The Total Delivered Quantity of a Sales Order
Hello All,
I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quantity.
Regards,
Pavani.Hi
Check the Table:
VBEP - Sales Document: Schedule Line Data.
Inside the table check the Quantity Fields.
Regards,
Sreeram -
How to get the total number of pages printed in a report?
Hi All,
I have a requirement where I need to print a frame of fields only in the last page. Unfortunately I cannot use the 'Print Object On' property as it doesnt work in my case. So, I am planning to write a format trigger on the frame to return TRUE if the page is the last physical page. Now, I need to know how to get the total number of physical pages that will get printed in the report so that I can use this to manipulate the frame. I was planning to use the 'Total Physical Pages' built-in, but it seems like I can just use it to print in a field and I can't use this field's value anywhere in the plsql code (formula column function/format trigger) in the report. Is there anyway to get the total number of pages printed in the report which can be used in the report plsql code?
Thanks,
Srini.i found the solution, thanks
-
How to get the total pages in ALV report?
Hi guys,
Since I used page breaks can somebody please help me on how to get the total pages in ALV report?sincerely please...thanks guys.automatic display total page.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
r -
I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.
I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.
-
Hi All,
how to get key from mdx query ?
example :
SELECT [Measures].[67822GFASOU7KUT6FKHSQ34FV] ON COLUMNS NON EMPTY CROSSJOIN([ZCOMPANY].MEMBERS, [ZMILL].MEMBERS) ON ROWS FROM ZODS_GL/ZODS_GL_001
the result from this mdx query are zcompany text and zmill text, how to get company key and mill key ?
Regards
JeiMinghi Jeiming,
to get key in mdx, you can try something like
[ZCOMPANY].[LEVEL01].MEMBERS
properties [ZCOMPANY].[2ZCOMPANY]
following threads may useful
Extracting texts with MDX
MDX Statement - display only keys for characterstics and their dis. attrib.
hope this helps. -
How to get the total record count in ODI
Hi
I have the interface the are file to DB.
The format is like this..
HEADER
DETAIL
TRAILER
Now will write the contains of file to DB,
But i have to insert the total count ie numberof record written from file to DB in my Trailer record.
can you tell me how can i get the total count of records in file and write it to trailer?
Also, I want the interface to rollback the data if something fails will loading the data from file., ie. if there are 100 records in file and 50 got transfer and something fails i want to rollabck the 50 records from DB.???
Thanks :)Hi
You can design a flow for Full load flow and incremental flow from flat file to Table.
Create a table at target database like.. (create table with last_execution and palce the V_FULL_LOAD value and LAST_EXECUTION_DT columns in last_execution table)
Add faltfile as table in model, create a variable as V_FULL_LOAD and make sure that the default values is 01-01-1900
Create one more variable like V_LAST_EXECUTION_DATE (in this variable write a case statement that if V_FULL_LOAD value is 'Y" then full load should happen and same time you should check that V_FULL_LOAD column is balnk then write insert statment else write update statement to update last_execution_dt column, similar for 'N')
please provide your *personal mail ID*, i will send a doc file realted to your query.
we have to tables present in work repository (SNP_STEP and STEP_LOG tables) using tables we can get how many records are inserted/updated and we can find how many records are not transfer and gor error.
Thanks
Phani -
Using Subquery in Select with Rollup (or some way to get grand total)
I am trying to do the following (simplified the query):
SELECT s.SYSTEM,
(SELECT COUNT(cp1.cid) FROM cfrs cp1, systems sp1, subsystems ssp1 where cp1.priority = 'P1' AND cp1.subsystem = ssp1.subsystem AND sp1.system = ssp1.system AND sp1.system = s.system) AS P1
FROM cfrs c, systems s, subsystems ss
WHERE c.subsystem = ss.subsystem
AND s.system = ss.system
GROUP BY ROLLUP(s.SYSTEM)
But the result of the Rollup on the P1 column is always 0 (it is not summing it up)
How can I accomplish a Rollup (or get a grand total) of the subquery result?
Thanks,How about this then:
SQL > WITH SYSTEMS AS
2 (
3 SELECT 'A' AS SYSTEM FROM DUAL UNION ALL
4 SELECT 'B' AS SYSTEM FROM DUAL UNION ALL
5 SELECT 'C' AS SYSTEM FROM DUAL
6 ),
7 SUBSYSTEMS AS
8 (
9 SELECT 'A' AS SYSTEM, '1' AS SUBSYSTEM FROM DUAL UNION ALL
10 SELECT 'A' AS SYSTEM, '2' AS SUBSYSTEM FROM DUAL UNION ALL
11 SELECT 'A' AS SYSTEM, '3' AS SUBSYSTEM FROM DUAL UNION ALL
12 SELECT 'B' AS SYSTEM, '4' AS SUBSYSTEM FROM DUAL UNION ALL
13 SELECT 'B' AS SYSTEM, '5' AS SUBSYSTEM FROM DUAL UNION ALL
14 SELECT 'B' AS SYSTEM, '6' AS SUBSYSTEM FROM DUAL UNION ALL
15 SELECT 'C' AS SYSTEM, '7' AS SUBSYSTEM FROM DUAL UNION ALL
16 SELECT 'C' AS SYSTEM, '8' AS SUBSYSTEM FROM DUAL UNION ALL
17 SELECT 'C' AS SYSTEM, '9' AS SUBSYSTEM FROM DUAL
18 ),
19 CFRS AS
20 (
21 SELECT 10 AS CID, '1' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
22 SELECT 11 AS CID, '1' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
23 SELECT 12 AS CID, '1' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
24 SELECT 13 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
25 SELECT 14 AS CID, '2' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
26 SELECT 15 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
27 SELECT 16 AS CID, '3' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
28 SELECT 17 AS CID, '3' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
29 SELECT 18 AS CID, '4' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
30 SELECT 19 AS CID, '5' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
31 SELECT 20 AS CID, '5' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
32 SELECT 21 AS CID, '6' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
33 SELECT 31 AS CID, '7' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
34 SELECT 41 AS CID, '8' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
35 SELECT 51 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
36 SELECT 61 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL
37 )
38 SELECT DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM) AS SYSTEM
39 , MAX(DECODE(PRIORITY,'LOW',CNT,0)) AS LOW
40 , MAX(DECODE(PRIORITY,'MED',CNT,0)) AS MED
41 , MAX(DECODE(PRIORITY,'HIGH',CNT,0)) AS HIGH
42 , MAX(DECODE(PRIORITY,'ALL_PRIOR',CNT,0)) AS SYSTEM_TOTAL
43 FROM
44 (
45 SELECT DECODE(GROUPING(SYSTEMS.SYSTEM),1,'ALL_SYSTEMS',SYSTEMS.SYSTEM) AS SYSTEM
46 , DECODE(GROUPING(CFRS.PRIORITY),1,'ALL_PRIOR',CFRS.PRIORITY) AS PRIORITY
47 , COUNT(*) AS CNT
48 FROM SYSTEMS
49 JOIN SUBSYSTEMS ON SYSTEMS.SYSTEM = SUBSYSTEMS.SYSTEM
50 JOIN CFRS ON SUBSYSTEMS.SUBSYSTEM = CFRS.SUBSYSTEM
51 GROUP BY CUBE(SYSTEMS.SYSTEM,CFRS.PRIORITY)
52 ORDER BY SYSTEMS.SYSTEM, CFRS.PRIORITY
53 )
54 GROUP BY DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM)
55 ORDER BY DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM)
56 /
SYSTEM LOW MED HIGH SYSTEM_TOTAL
A 2 2 4 8
B 1 1 2 4
C 1 2 1 4
Grand Total 4 5 7 16Oh, BTW, use "code" wrapped in "{}" on either side to post nicely formatted code. -
How to get the total execution time from a tkprof file
Hi,
I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
. The sample of tkprof is given below.
SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
SELECT POSTED_FLAG
FROM
AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 442 0.08 0.13 0 0 0 0
Fetch 963 0.22 4.72 350 16955 0 521
total 1406 0.31 4.85 350 16955 0 521
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 173 (recursive depth: 1)
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
1 1 1 UNION-ALL (cr=38 pr=3 pw=0 time=139 us)
1 1 1 TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
1 1 1 INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20897 us)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
1 1 1 TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
0 0 0 INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
0 0 0 TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 350 0.15 4.33
Disk file operations I/O 3 0.00 0.00
latch: shared pool 1 0.17 0.17
********************************************************************************user13019948 wrote:
Hi,
I have a tkprof file. How can I get the total execution time.
call count cpu elapsed disk query current rows
total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above -
How To Make Infocube Visible in Query Designer?
hello,
i'm using BIW 3.10, i've just created infocube and succesfully populated it with data. I went through all the process from datasource (from R/3 masterdata), infosource, infoobjects and so on, until i get to browse the content of the infocube using the "Manage Data Targets" screen of rsa1->modeling->InfoProvider->Manage. Now my problem is how do i make the infocube visible in the Query Designer?
thanks,
sidhi sid,
you have open bex analyzer, and click 'query', in next screen 'sap bex : select query', click 'new' (icon blank page), and click 'infoarea' in left side, you will see the infocube under your infoarea. hope this helps.
for new infocube, when there is no query created from this infocube, the infocube will invisible, since the screen is to select existing queries.
Maybe you are looking for
-
Oracle Report Server Issue with Japanese Characters
We are trying to setup a Oracle Report Server to print the Japanese characters in the PDF format. We have separate Oracle Report servers for printing English, Chinese and Vietnamese characters in PDF formats using Oracle Reports in the production whi
-
How to connect to oracle jdbc?
How to connect to oracle database if jdbc thin driver is used? Any example ? I saw this in a tutorial but I can't get what are inside the parenthesis. OracleConnection connect = (OracleConnection)DriverManager.getConnection(" ", , ); Anyone can help?
-
Adobe opens up fine but when I click on "Edit" it wil not open up and dissapears
-
Bought a Creative Cloud single-app membership for Photoshop (one-year)
But when the creative cloud page is open and i try to download photoshop there is writen up to date and I can't do nothing.. Someone can help me please?
-
Logic Pro 9.1 32 bit mode
Hi everyone, I have recently updated to a new Mac OS X 10.6.2 and Logic Pro 9.1. I use M-Audio ProjectMix 1/0 Firewire Audio Interface. I have set Logic in 32 bit mode from get info. And in preferences > audio it is ticked in 24 bit for recording. Do