Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I created a report from a table named "Product_Order" with the following fields

VB
secret_code
mem_name
mem_code
mem_chapter
trn_date
ar_no
or_no
pro_category
pro_sub_category
pro_code
pro_name
pro_qty
pro_cost
pro_price
total_cost
total_price
pay_mode
pay_terms
process_by
deliver_by




Now i needed to show report based on a group

NOTE: RC = REPORT COLUMN

Group 1 - Pro_Category: Has field "Pro_Category"
Group 2 - Pro_Name: Has the following fields below

RC 1 - Field: pro_sub_category
RC 2 - Field: pro_code
RC 3 - Field: pro_name
RC 4 - Formula Field: sum({product_order.pro_qty},{product_order.pro_name})
RC 5 - Field: pro_cost
RC 6 - Field: pro_price
RC 7 - Formula Field: {product_order.pro_price}-{product_order.pro_cost}
RC 8 - Formula Field: {product_order.pro_cost} * Sum ({product_order.pro_qty}, {product_order.pro_name})
RC 9 - Formula Field: {product_order.pro_price}*Sum ({product_order.pro_qty}, {product_order.pro_name})
RC 10 - Formula Field: RC9 - RC8

Task i can't do:
Summarize RC8, RC9 & RC10 based on Group 1 - Pro_Category.
Summarize ALL RC8, RC9 & RC10 - "Like a GRAND TOTAL SUMMARY"

In short i needed to summarize a summarized field.


You may see and download database file and screen shot at:
<ahref>https://dl.dropbox.com/u/65392916/SAMPLE.zip[^]

Hope this is clear enough to understand.
Posted
Updated 24-Nov-12 6:00am
v2
Comments
Nelek 24-Nov-12 12:06pm    
I won't download any file sorry. You can try to find out the portion of code involve and post the relevant snippet here.

After many attempts i managed to find an article that answers my question.

@reset
whileprintingrecords;

global numbervar GTotal:=0;
//place this in report header, or higher grou header as appropriate

@Eval

whileprintingrecords;

global numbervar GTotal:=GTotal + Sum( valuefield, groupfield);
// place this in group footer where your sum shows

@display
whileprintingrecords;

global numbervar GTotal;
//Place this in report or higher group footer
 
Share this answer
 
Comments
Abhishek Pant 24-Nov-12 15:51pm    
can you share that link of that article here so that it can be useful for others.
JMAM 24-Nov-12 23:16pm    
http://scn.sap.com/thread/1938836

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900