Create Grand total in smartform
Hi,
I am using the calculation tab in table folder of my smartform. But i am not getting the result ,all blank. Plz help me to solve this issue.
Thanks in advance.
Hi Snehashis,
It will be difficult to visualize your situation .
But see the following pictures, where Grand Total was computed.
Individual totals
For Grand Total calculation, Program lines was created as under, where you want this Grand Total.
Then
Obviously SUM1 is flown from another field. (Calculation filed)
SUM1, GTOT will be Global Variables. and S_TPREV will be from interface. (s_tprev can be in the form wa_ekpo-ebeln )
This post just gives you some idea of calculating Grand Totals, to get some clues to apply to your case.
Jogeswara Rao K
Similar Messages
-
OBIEE 11g - How to display Grand Total in graphs
hi ,
I am using obiee 11.1.1.6 version . In a report I have a requirement to display the grand total (present in the table) to be shown in the graph also . Kindly help.
Regards,
NivHi Niv,
One quick question here.How are you creating Grand Total?
I have created using grand total by row summing and inserting that value in the Group By Function.
Attached the screen shot for your reference.
GT - Download - 4shared
Mark if helps
Thanks, -
Need urgent Help on Grand Totals
Hi gurus,
I have a problem with a crosstab report I'm working on. I have a calculated column based on a pre-summed column. The formula is CASE WHEN material_size_num IN ('97', '93', '92') THEN material_qty_sum*1.5)
I have created grand totals for the rows and columns. My problem is that the grand total for the column does not have total of all 'grand totals'. My report looks like the following:
Case statement col1., Case statement col2., Total col1+col2
(total) (total) (total does not appear).
I would appreciate any suggestions. I have tried using cell sum, but that has not workedHi Melanie,
When I use Sum all datapoints the sum for that column doesn't appear. I have to put Sum "adjusted qty" (my calculated column) to show any totals. I'm wondering if it's an issue with the CASE statement I'm using. This problem seems to occur whenever I use a decode or CASE statement. Have you any similar experiences?
Thanks for your help -
Line Totalling and page totalling in smartforms?
Hi,
Any ideas about displaying line totals and page/grand totals in smartform. Answers would be appreciated.
thanksHi..,
in TABLE you will have one tab called CALCULATIONS..
in that select the type as TOTAL and give the field name for which u want to find out the total. and give the resultant field into which u want the total to be stored !! and select AFTER LOOP in the next list box...
in the footer you just write this field name. u will get the cumulative total for each .. i mean for second page the total of ( the first page and second page) will get printed !!
if u want the total for each page then u need to write a program line for the table.. to clear the total field for each page !!
reward if it helps u,
sai ramesh -
(Smartform) Print grand total on the last page
Hi everyone,
I'm trying to print the Grand Totals on the last page of my Smartform. I have two pages - FIRST and SECOND.
What I did was I created a Text to display the grand total, and I specified that this text should be printed 'Only After End of Main Window'. However, the total is not being printed out.
I can't change the condition to 'Not on First Page', because my form has more than two pages, and I only want the grand totals on the last page.
Any help would be appreciated.hi,
we have a window type called final window if u define this type window in second page . create a table in the window and go to calculations tab and define an internal table. i think u can get the grand totals.
if u want maore clearly go throuh this link
https://www.sdn.sap.com/irj/sdn/forums
hope this will help you.
REWARD ME IF USEFUL.
thanks,
gupta
Edited by: gupta pullipudi on Apr 9, 2008 9:23 PM -
How to create a Grand Total on a Multiple Page Document
I have created a form that is 4 pages long. I created the form in WordPerfect and then converted it to pdf. Then I opened it into Adobe Professional 8. I had it automatically converted into LiveCyle. I would like to just add the total of the four pages to a grand total on page one but whenever I use FormCalc is says it doesn't recognized page 2. Have I done something wrong or am I missing a step somewhere. In the Hierarachy area it sees the form and the four pages. For some reason it doesn't seem to recognize it as one whole form. I'm not sure what the deal is. I have now created a subtotal for each individual page and each page will total separetly. But I can not get a grand total.
I just purchased Adobe LiveCycle Designer book by J.P. Terry. It doesn't say anything about this. AHHHH! I need some help.Hi Carolin,
You can check Purchase Order. It is a sample that Adobe delivers with LiveCycle Designer. It has a script that takes care about a calculation trough a multiple pages form.
You should find the sample under :\Program Files\Adobe\......\Designer ES\8.2\EN\Samples\Forms\Purchase Order\Dynamic Interactive\Forms -
How to create a sub total and grand total using my query.
How can I create a sub total for each section and grand total for using my query like this. your help is appreciated. I am working with 9g
WITH BidItemsInformation AS
( SELECT DISTINCT q.iplineno "Line Number", q.section "Section Number",
i.item "Item Number",
initcap(i.idescr) "Description" ,
i.iunits "Unit",
q.qty "Quantity" ,q.price "Engineers Unit Price",
(q.price * q.qty) "Engineers Estimate"
FROM letprop l,
proposal p,
propitem q,
bidlet b,
bidtabs c,
itemlist i,
vendor v,
bidders d
WHERE(l.letting = b.letting
And b.letting = c.letting
And p.cspecyr = i.ispecyr)
AND q.prpitem = i.item
AND p.contid = l.lcontid
AND q.contid = p.contid
AND c.vendor = l.avendor
AND l.CALL = c.CALL
AND q.lineflag = c.lineflag
AND q.iplineno = c.iplineno
AND l.letting = d.letting
AND c.letting = l.letting
AND c.CALL = d.CALL
AND v.vendor = d.vendor
-- AND AND l.letstat = 'A'
AND c.lineflag = 'L'
AND l.letting ='&letting'
AND l.CALL = '&call'
), BiddersInformation AS
-- This is where you make your changes for vendor name and vendor number Do not touch the above code
-- It is always the same for any call number and letting date
( SELECT IPLINENO "BLine Number",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) "K020:: Unit Price",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) K,
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) "H438:: Unit Price",
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) H,
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) "U010:: Unit Price",
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) U,
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) "G110:: Unit Price",
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) G,
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) "H530:: Unit Price",
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) H1
FROM BIDTABS
WHERE LETTING='&letting'
AND CALL='&call'
AND BIDPRICE <> 0
GROUP BY IPLINENO
SELECT BidItemsInformation."Line Number",
BidItemsInformation."Section Number",
BidItemsInformation."Item Number",
BidItemsInformation."Description",
BidItemsInformation."Unit",
BidItemsInformation."Quantity",
BidItemsInformation."Engineers Unit Price",
BidItemsInformation."Engineers Estimate",
BiddersInformation."K020:: Unit Price",
(BidItemsInformation."Quantity" * K) "KGM CONTRACTORS INC",
BiddersInformation."H438:: Unit Price",
(BidItemsInformation."Quantity" * H) "HOFFMAN CONSTRUCTION COMPAN",
BiddersInformation."U010:: Unit Price",
(BidItemsInformation."Quantity" * U) "ULLAND BROTHERS INC",
BiddersInformation."G110:: Unit Price",
(BidItemsInformation."Quantity" * G) "GLADEN CONSTRUCTION INC",
BiddersInformation."H530:: Unit Price",
(BidItemsInformation."Quantity" * H1) "HOOVER CONSTRUCTION CO"
FROM BidItemsInformation,BiddersInformation
WHERE BidItemsInformation."Line Number" = BiddersInformation."BLine Number";
Line Number Section Number Item Number Description Unit Quantity Engineers Unit Price Engineers Estimate K020:: Unit Price
0010 0001 2011601/00003 Construction Surveying LS 1 143,000 143,000 75,000 75,000 67,080 67,080
0013 0001 2013601/00010 Survey Equipment LS 1 25,000 25,000 25,000 25,000 30,000 30,000
0020 0001 2015601/00030 Blast Monitor/Survey LS 1 50,000 50,000 30,000 30,000 35,000 35,000
0030 0001 2021501/00010 Mobilization LS 1 382,250 382,250 809,000 809,000 704,000 704,000
0040 0001 2021602/00010 Well Survey EACH 60 500 30,000 2,150 129,000 1,600 96,000
0050 0001 2031501/00040 Field Office Type D EACH 1 6,367 6,367 4,000 4,000 25,000 25,000
sub total:
1610 0002 2401501/01143 Structural Concrete (1a43) C Y 46 350 16,100 408 18,768 400 18,400
1620 0002 2401501/01362 Structural Concrete (1c62) C Y 68 200 13,600 204 13,872 200 13,600
1630 0002 2401501/03643 Structural Concrete (3y43) C Y 60 600 36,000 592 35,520 580 34,800
1640 0002 2401512/03633 Bridge Slab Concrete (3y33) S F 1,876 24 45,024 28 51,778 27 50,652
1650 0002 2401521/00030 Structure Excavation Class R C Y 17 125 2,125 1,000 17,000 500 8,500
1660 0002 2401541/00010 Reinforcement Bars LB 2,490 2 3,735 1 3,312 1 3,237
1670 0002 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 12,380 2 18,570 1 17,703 1 17,332
1680 0002 2401601/00010 Structure Excavation LS 1 2,500 2,500 2,000 2,000 5,000 5,000
1690 0002 2402583/00020 Ornamental Metal Railing Type Special L F 284 150 42,600 194 55,096 190 53,960
sub total
1820 0003 2401513/00346 Type Curb Railing Concrete (3y46) L F 135 25 3,375 16 2,093 15 2,025
1830 0003 2401513/07447 Type Mod P-4 (Tl-4) Railing Conc (3y46) L F 302 85 25,670 72 21,593 70 21,140
1840 0003 2401541/00010 Reinforcement Bars LB 14,780 1 18,475 1 13,598 1 13,302
1850 0003 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 76,720 1 103,572 1 85,926 1 84,392
1860 0003 2401601/00010 Structure Excavation LS 1 10,000 10,000 116,000 116,000 115,000 115,000
1870 0003 2402583/00020 Ornamental Metal Railing Type Special L F 132 150 19,800 184 24,288 180 23,760
sub total
totalYou can accomplish that using decode with the grouping function. It returns 1 when that column passed as argument was grouped (or is in some total) and 0 otherwise.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> with t as
2 (select 'New York' city, 'US' country, 1 num from dual
3 union all select 'Los Angeles' city, 'US' country, 2 num from dual
4 union all select 'London' city, 'GB' country, 2 num from dual
5 union all select 'London' city, 'GB' country, 2 num from dual
6 union all select 'London' city, 'GB' country, 7 num from dual)
7 select decode(grouping(country), 0, country, 'GRAND TOTAL') country,
8 decode(grouping(city), 0, city, decode(grouping(country), 0, 'SUBTOTAL')) city,
9 sum(num) num_total
10 from t
11 group by rollup(country, city)
12 /
COUNTRY CITY NUM_TOTAL
GB London 11
GB SUBTOTAL 11
US New York 1
US Los Angeles 2
US SUBTOTAL 3
GRAND TOTAL 14
6 linhas selecionadas.
SQL> -
What's the best way to create sub-totals & grand-total in SQL2008 R2 (and beyond)?
What is the easiest way to get sub totals and a grand total on data that is being grouped? It looks like RollUp might work, but it's being depreciated.
My query is:
SELECT
COMPANY
,INVSTR_CD
,STATE_C
,SUM(CO_SHARE_TOTBAL) as CO_SHARE_TOTBAL
FROM #ASSET AS A
WHERE A.D_GETIT = 'Y'
GROUP BY COMPANY, STATE_C, INVSTR_CD
ORDER BY COMPANY, INVSTR_CD, STATE_C
I need to provide a sub-total of the SUM'd field (SUM(CO_SHARE_TOTBAL) as CO_SHARE_TOTBAL), at the change of the COMPANY field.
Then a Grand Total of all the SUM'd fields (SUM(CO_SHARE_TOTBAL).
Thanks in advance!!
-Al HIf you post DDL of your table (only relevant columns) and some data and desired output, I may try to reproduce it. Did you check Jacob's blog post and the very last query? It does take a few trials before getting this correct.
Naomi,
I did try the last query on Jacob's post. I couldn't get the first column to populate.
Thanks for the offer of help.
DML is:
Create Table #ASSET2 (
[COMPANY] [varchar] (5) NULL
,[INVSTR_CD] [varchar](5) NULL
,[STATE_C] [char](2) NULL
,[SHARE_TOTBAL] [decimal] (15,2) NULL)
Data is:
Insert into #ASSET2 VALUES ('00000','099 ','FL','115226.77')
Insert into #ASSET2 VALUES ('22222','030 ','CA','309899.43')
Insert into #ASSET2 VALUES ('00000','010 ','CA','524296.89')
Insert into #ASSET2 VALUES ('00000','099 ','IL','51699.70')
Insert into #ASSET2 VALUES ('00000','789 ','PA','90856.04')
Insert into #ASSET2 VALUES ('22222','010 ','CA','66951.33')
Insert into #ASSET2 VALUES ('00000','099 ','CA','310046.03')
Insert into #ASSET2 VALUES ('00000','010 ','AZ','178062.08')
Insert into #ASSET2 VALUES ('00000','099 ','NY','278489.10')
Desired results would be the following:
COMPANY INVSTR_CD STATE_C SHARE_TOTBAL
00000 010 AZ 178062.08
00000 010 CA 524296.89
00000 099 CA 310046.03
00000 099 FL 115226.77
00000 099 IL 51699.70
00000 099 NY 278489.10
00000 789 PA 90856.04
TOTAL COMPANY 00000 1548676.61
22222 010 CA 66951.33
22222 030 CA 309899.43
TOTAL COMPANY 22222 376850.76
GRAND TOTAL 1925527.37
-Al H -
My query works fine. I am just wondering if I could add another row to create a grand total for all rows returned running this query. please help
SELECT DISTINCT 'Q'||(TRUNC (TO_CHAR (B.DATELET, 'Q')))||' - ' || :year QuarterYear ,TRUNC (TO_CHAR (B.DATELET, 'Q')) Quarter,
to_char (sum(l.contamt) OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))) , '$999,999,999.99') AwardedDollarAmount ,
count(P.CPROJNUM) OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))) ProjectAwarded,
--- to_char( SUM (MIN (c.calcbtot)) OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))), '$999,999,999.99') AwardedDollarAmount,
SUM (COUNT (C.VENDOR))OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))) NumberOfBidders,
to_char(SUM (COUNT (C.VENDOR))OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))) / count(P.CPROJNUM) OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))), '999.99') AverageNumberOfBidder
FROM BIDDERS C,
BIDLET B,
LETPROP L,
PROPOSAL P
WHERE C.LETTING = B.LETTING
AND P.CONTID = L.LCONTID
AND C.LETTING = L.LETTING
AND C.CALL = L.CALL
AND l.lcontid IN
(SELECT lcontid
FROM letprop c, PROPOSAL d
WHERE datestat IS NOT NULL
AND UPPER (letstat) <> 'R'
AND UPPER (letstat) <> 'B'
AND TRIM (UPPER (TIMELET)) = TRIM ('9:30 A.M.')
AND c.LCONTID = d.CONTID)
AND B.DATELET >=
ADD_MONTHS (TRUNC (TO_DATE (:year, 'YYYY'), 'YYYY'),
(:from_quarter - 1) * 3)
AND B.DATELET <
ADD_MONTHS (TRUNC (TO_DATE (:year, 'YYYY'), 'YYYY'),
:to_quarter * 3)
GROUP BY TRUNC (TO_CHAR (B.DATELET, 'Q')), P.CPROJNUM, l.contamt
order by TRUNC (TO_CHAR (B.DATELET, 'Q'));
Q1 - 2011 1 $174,950,864.40 71 278 3.92
Q2 - 2011 2 $196,470,118.71 96 329 3.43
Q3 - 2011 3 $56,552,583.92 30 116 3.87
Q4 - 2011 4 $25,497,261.10 17 84 4.94
Total Amount: 35000047800.00 214 807******************************Here is what I would like to create a new row to show grand total.Edited by: 893601 on Dec 30, 2011 12:07 PMHi,
Can you please try this.. check this before you execute.. may be u need to change the datatype of the second half of union all statement
WITH tmp AS
(SELECT DISTINCT 'Q'
|| (TRUNC (TO_CHAR (b.datelet, 'Q')))
|| ' - '
|| &year quarteryear,
TRUNC (TO_CHAR (b.datelet, 'Q')) quarter,
TO_CHAR
(SUM (l.contamt) OVER (PARTITION BY (TRUNC
(TO_CHAR
(b.datelet,
'Q'
'$999,999,999.99'
) awardeddollaramount,
COUNT (p.cprojnum) OVER (PARTITION BY (TRUNC
(TO_CHAR
(b.datelet,
'Q'
)) projectawarded,
--- to_char( SUM (MIN (c.calcbtot)) OVER (PARTITION BY (TRUNC (TO_CHAR (B.DATELET, 'Q')))), '$999,999,999.99') AwardedDollarAmount,
SUM (COUNT (c.vendor)) OVER (PARTITION BY (TRUNC
(TO_CHAR
(b.datelet,
'Q'
numberofbidders,
TO_CHAR
( SUM (COUNT (c.vendor)) OVER (PARTITION BY (TRUNC
(TO_CHAR
(b.datelet,
'Q'
/ COUNT (p.cprojnum) OVER (PARTITION BY (TRUNC
(TO_CHAR
(b.datelet,
'Q'
'999.99'
) averagenumberofbidder
FROM bidders c, bidlet b, letprop l, proposal p
WHERE c.letting = b.letting
AND p.contid = l.lcontid
AND c.letting = l.letting
AND c.CALL = l.CALL
AND l.lcontid IN (
SELECT lcontid
FROM letprop c, proposal d
WHERE datestat IS NOT NULL
AND UPPER (letstat) = 'R'
AND UPPER (letstat) = 'B'
AND TRIM (UPPER (timelet)) = TRIM ('9&30 A.M.')
AND c.lcontid = d.contid)
AND b.datelet >=
ADD_MONTHS (TRUNC (TO_DATE (&year, 'YYYY'), 'YYYY'),
(&from_quarter - 1
) * 3
AND b.datelet <
ADD_MONTHS (TRUNC (TO_DATE (&year, 'YYYY'), 'YYYY'),
&to_quarter * 3
GROUP BY TRUNC (TO_CHAR (b.datelet, 'Q')), p.cprojnum, l.contamt
ORDER BY TRUNC (TO_CHAR (b.datelet, 'Q')))
SELECT *
FROM tmp
UNION ALL
SELECT 'Total Amount: '
|| SUM (awardeddollaramount)
|| ' '
|| SUM (projectawarded)
|| ' '
|| SUM (numberofbidders)
|| ' '
|| SUM (averagenumberofbidder)
FROM tmp;
-------------------------------------------------- -
I need to create a total per line and then a grand total
I have a report where I am getting counts. I have created totals per column by using a summary column.
Now how do I get totals per line and then a grand total.
I am not sure how to total the summary columns. I thought I could create a paramerter
and in a formula column sum up the summary columns but I am getting errors.
Is this correct for this.
:P_parm := :cs_1 + :cs_2 + :cs_3; I am getting errors on this.
I tried to total up the information in my sql to get totals per line but am having problems.
Need help getting totals. does nvl(' ',0) return a numeric 0 ?
Any example of what I can do through oracle reports to get these totals.
howardRather than do that, which means starting over from scratch, losing all your edits, organisation and so on, why not simply use iPhoto Library Manager to revert the Library to the older version? Easier, less destructive.
The instructions on that are here
If you really want to start over: you can access the Originals folder simply by going to your Pictures Folder and finding the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed. -
How to display subtotals in every page and the grand total in the last page
Hello Abapers,
I am working with Smartforms. I am not able to print the subtotal in every page ie the Price for that particular page alone should be summed and in the final page I want the grand total also to be displayed. I tried the Total option in the Calculations tab but the value is just getting incremented on every page..How can I achieve this..
With Regards,
Bennet.Hi,
Declare two different variables for subtotal and total
Use them in the calculation tab of the table node.
After displaying the subtotal create a program lines node to clear the value of the subtotal. And dont forget to mention the condition in the condition tab of the text node of your subtotal as only before end of main window.
display the grand total in the text another text node with condition... only after end of main window.
regards
padma -
Using Rollup to get subtotals and grand total - missing right pren error
Hello,
I am trying to create sub totals by person_id and a grand total row in my APEX report but I get a "missing right pren error." I finally figure out that I need to eliminate column alias names to fix this problem, however, I now get an ambigous column reference. I am making this change in my main SQL report statement, however, I was wondering if I should be using the "group by Rollup" somewhere else while using "Break Formatting."
I would appreciate any help.
Thanks
lehCan you post the Query please?
-
Obiee 11G - Show grand total in chart
I have three measures in my table.
Measure 1 - Rolling balance from the current and previous month.
Measure 2 - PeriodRolling revenue for the last three months including current month
Measure 3 - Calculation using measure 1 and measure 2 and the number of days.
I have created all three measures in the RPD.
The table is by state. So it could be Texas, New York, Illinois and so on.
Month
State
Measure 1
Measure 2
Measure 3
1
Texas
17565
9898989
45
1
New York
97848
8748575
43
2
Texas
85768
8734874
33
2
New york
94855
3234442
23
The chart shows the trend of Measure 3 by time for each state. I need a line on the chart to show the total by month. Do I have to create a sum() formula in the RPD? Appreciate any ideas that you can throw at me.I created a new group in the selection step and included all the states in it. That seemed to work. The Graph shows a line for grand total. Thank you for your help.
The requirement is to create a line chart. I don't think a bar would work as well here. -
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. -
How to set Grand Total of a Measure when its aggregation rule is Max in Logical Layer
Hi
I have a Measure Column (Budget) and in Logical layer the aggregation rule is set as (Max) which looks like Max(Budget). But now it is included in the report and when my client is trying to see its grand total, it is giving the Max Budget figure of the report rather than giving the total sum(grand total).
Kindly share some ideas in achieving the grand total without disturbing the actual aggregation of the measure.Thank You for your reply.
In my case i don't have a problem with aggregation for Budget Measure(max(Fact_XXKC_SHIP_TO_BUDGET_CAT_F.SALESREP_BUDGET_YTD)). This is the aggregation rule applied on the Salesrep Budget YTD.
Now i created a report with columns
Salesrepresntative(Dimension),, Sales Invoices(Measure1),, SALESREP_BUDGET_YTD(Measure 2).
In the above report the values are perfect, but when we used Grand total option at ROW level in table view, the grand total of Measure1 is cumulative of all the rows, but the Grand total of SALESREP_BUDGET_YTD (measure2) is the max of all the columns.
What i require is the Grand total of SALESREP_BUDGET_YTD (measure 2) should be cumulative of all the columns.
I have shared my SQL query, kindly verify it and share any idea.
select sum(case when T97600.W_XACT_TYPE_CODE = 'Chargeback' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c1,
sum(case when T97600.W_XACT_TYPE_CODE = 'Credit Memo' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c2,
sum(case when T97600.W_XACT_TYPE_CODE = 'Debit Memo' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c3,
sum(case when T97600.W_XACT_TYPE_CODE = 'Standard Invoice' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE when T97600.W_XACT_TYPE_CODE = 'Invoice Cancellation' then T93664.NET_AMT * -1 * T93664.GLOBAL1_EXCHANGE_RATE end ) as c4,
T315597.XXKC_RESOURCE_NAME as c5
from
W_CUSTOMER_LOC_USE_D T315597 /* Dim_W_CUSTOMER_LOC_USE_D_Status */ ,
W_SALES_INVOICE_LINE_F T93664 /* Fact_W_SALES_INVOICE_LINE_F */ ,
W_XACT_TYPE_D T97600 /* Dim_W_XACT_TYPE_D_Sales_Ivclns */
where ( T93664.XACT_TYPE_WID = T97600.ROW_WID and T93664.DELETE_FLG = 'N' and T93664.XX_SHIP_TO_LOC_USE_WID = T315597.ROW_WID )
group by T315597.XXKC_RESOURCE_NAME
) D1 full outer join (select max(T313184.SALESREP_BUDGET_YTD) as c1,
T315597.XXKC_RESOURCE_NAME as c2
from
W_CUSTOMER_LOC_USE_D T315597 /* Dim_W_CUSTOMER_LOC_USE_D_Status */ ,
XXKC_SHIP_TO_BUDGET_CAT_F T313184 /* Fact_XXKC_SHIP_TO_BUDGET_CAT_F */
where ( T313184.SITE_USE_WID = T315597.ROW_WID )
group by T315597.XXKC_RESOURCE_NAME
Maybe you are looking for
-
Library - Documents displayed in wrong folder
Hi all Another strange case: In a document libarary I have 50 folders. Each of them contain 2-3 documents. My view shows 30 elements per page. When I go to the next page to view the folders 31-50 everything seems to be OK. But when I go back to the f
-
Dreamweaver CS3 hangs on "initializing files" in Windows Vista Home Premium
Hi, Anybody else encountering this issue? I noticed this7 error in Windows Vista Home Premium. When you launch Dreamweaver CS3, it opens the splash screen, displays "initializing files" and thats it. Necessary Troubleshooting steps we're already done
-
A lot of burning problems with ITunes 6.. Where Can I Get ITunes 4 back?
Hello! Few weeks ago I've installed ITunes 6 on my new pc. At this point of time I could burn CDs, but the soundcheck didn't work. I've inserted a blanc disc and selected the playlist. But then the Burn- Button didn't get yellow. So I clicked on it a
-
Settings SLD and JCO connection for Java Web Dynpro
Hi BI Gurus, I'm a Business Intelligence newbye and I'm a bit confused about Web Dynpro configurations. I try to execute, through Netweaver Developer Studio 7, a simple java Web Dynpro who call the standard Flight List BAPI. My configuration is: NW 2
-
How come I-Tunes won't let me subscribe to my IWeb podcast?
This is what I have been trying to do. My website is hosted on a Linex server running Apache. I created a podcast using Garageband 3, then tried to figure a workaround because I have no .mac account. Tried RSS Buddy, but couldn't get the podcast to w