Rollup for Sub-total and add opening balance
Hi,
I have a table which contains the data for customer transaction for certen period.
Data will be queried for certain transaction period.
CUST_TRAN_DETS
A/c No - trans_nr - trans_typ - opening_bal - tran_dat_fr - trans_dat_to -- trans_amt
123 - 10001 - Op.Bal - 500000 - 01.12.06 - 30.12.06
123 - 10002 - invoice - 000000 - 01.01.07 - 31.01.07 - 20000.00
124 - 10003 - invoice - 000000 - 01.02.07 - 28.02.07 - 30000.00
124 - 10004 - invoice - 000000 - 01.03.07 - 30.03.07 - 120000.00
124 - 10005 - invoice - 000000 - 01.04.07 - 31.04.07 - 85000.00
125 - 10006 - invoice - 000000 - 01.04.07 - 31.04.07 - 30000.00
125 - 10007 - invoice - 000000 - 01.04.07 - 31.04.07 - 14000.00
125 - 10008 - invoice - 000000 - 01.04.07 - 31.04.07 - 170000.00
Now my query should return following output
A/c No. -tran_dat_fr- trans_dat_to - curr_bal- Total_bal
123 -- 01.01.07 -- 31.01.07 -- 20000.00
124 -- 01.02.07 -- 31.04.07 -- 235000.00
125 -- 01.04.07 -- 31.04.07 -- 184000.00
939000.00
Each subtotal on A/c number should sum the trans amt for each a/c no for that period. And the total_bal should display the sum of transactions for all account numbers for that period and Opening balance. In the above exmpl, Total bal would be 20000+235000+1840000+500000.
Pls help ASAP.
Regards
Ram
SQL> create table cust_tran_dets (ac_no,trans_nr,trans_type,opening_bal,tran_dat_fr,tran_dat_to,trans_amt)
2 as
3 select 123, 10001, 'Op.Bal', 500000, date '2006-12-01', date '2006-12-31', null from dual union all
4 select 123, 10002, 'invoice', 0, date '2007-01-01', date '2007-01-31', 20000 from dual union all
5 select 124, 10003, 'invoice', 0, date '2007-02-01', date '2007-02-28', 30000 from dual union all
6 select 124, 10004, 'invoice', 0, date '2007-03-01', date '2007-03-31', 120000 from dual union all
7 select 124, 10005, 'invoice', 0, date '2007-04-01', date '2007-04-30', 85000 from dual union all
8 select 125, 10006, 'invoice', 0, date '2007-04-01', date '2007-04-30', 30000 from dual union all
9 select 125, 10007, 'invoice', 0, date '2007-04-01', date '2007-04-30', 14000 from dual union all
10 select 125, 10008, 'invoice', 0, date '2007-04-01', date '2007-04-30', 170000 from dual
11 /
Tabel is aangemaakt.
SQL> select ac_no
2 , case when grouping(ac_no) = 0 then min(decode(trans_type,'invoice',tran_dat_fr)) end tran_dat_fr
3 , case when grouping(ac_no) = 0 then max(decode(trans_type,'invoice',tran_dat_to)) end tran_dat_to
4 , case when grouping(ac_no) = 0 then sum(decode(trans_type,'invoice',trans_amt)) end curr_bal
5 , case when grouping(ac_no) = 1 then sum(opening_bal + nvl(trans_amt,0)) end total_bal
6 from cust_tran_dets
7 group by rollup(ac_no)
8 /
AC_NO TRAN_DAT_FR TRAN_DAT_TO CURR_BAL TOTAL_BAL
123 01-01-2007 00:00:00 31-01-2007 00:00:00 20000
124 01-02-2007 00:00:00 30-04-2007 00:00:00 235000
125 01-04-2007 00:00:00 30-04-2007 00:00:00 214000
969000
4 rijen zijn geselecteerd.Regards,
Rob.
Similar Messages
-
I am developing a query using SQVI.
How do I insert subtotals and totals for certain fields at the end of the query report.
Thanks
SandeephI SANDEEP .....
if you go with layou mode then there will be 3 pops like delete , TOOL BAR , SORT FIELDS ....etc ..
there is TOOL BAR with the following options ...
Background
Heading
Normal
<b>Subtotals</b>
Key Columns
Positive
Negative
Control Levels
Background (intensified
Header (intensified)
Normal (intensified)
Sum totals (intensified
Keys (intensified)
Positive (intensified)
Negative (intensified)
Control lev.(intensifie
so that by selecting the fields ..... liek sub total acrros the Fiscal year can be done .... Document wise sub total ..... vendor wise , customer wise ... like based on the fields selection for sub total and total can be done ...
Girish -
Table for Customer and vendor open balance on a key date
Dear All,
Can anyone please let me know Table for Customer and vendor open balance on a key date. We are developing one customized report.
I have checked with the below table :
Customer-KNC1, KNC3,BSID, BSAD
Vendor-LFC1, LFC3, BSIK, BSAK.
But these are not working properly for all customers and vedors. Also, in open items, there are items with clearing documents.
Plesae let me know, how to go for it.
Please suggest.Hi
Use BSID and BSIK for open items
And pass company code, year and from date and to date range in Posting date selection option
Reg
Vishnu -
Sub-total and Total for a column having checkboxes in WD ABAP ALV
Hello Experts,
I have used ALV in We bdynpro ABAP to display my output. There are 2 columns that are checkboxes in Output. I want a sub-total and total for those two columns. I know tht total and sub-total functionality is available only for numeric fields .
Is there any other indirect way by which i can achieve the same ?Hi Ragini,
Please refer this thread: [alv total and subtotal|How to display graphs;.
I hope it helps.
Regards
Arjun -
Updating the GL and BP Opening Balance
Hi
Can anybody help on the logic to update the GL and BP opening balance thru SDK
Regards
SundaramHi,
U can use this Method.. CreateOpenBalance and check the following sample code provided by SAP.
Dim oAccountsService As SAPbobsCOM.AccountsService
Dim oOpenningBalanceAccount As SAPbobsCOM.OpenningBalanceAccount
Dim oGLAccounts As SAPbobsCOM.GLAccounts
Dim oGLAccountFirst As SAPbobsCOM.GLAccount
Dim oGLAccountSecond As SAPbobsCOM.GLAccount
'get company service
oCmpSrv = oCompany.GetCompanyService
'get accounts service
oAccountsService = oCmpSrv.GetBusinessService(ServiceTypes.AccountsService)
'get Accounts Service Data Interface
oOpenningBalanceAccount = oAccountsService.GetDataInterface(AccountsServiceDataInterfaces.a sdiOpenningBalanceAccount)
'set the account code(account name = Common Stock (HO, USA, GA ))
'for the openning balance account
oOpenningBalanceAccount.OpenBalanceAccount="_SYS00000000078"
'set the details
oOpenningBalanceAccount.Details = "G/L Accounts Opening Balance"
'set the date
oOpenningBalanceAccount.Date = Date.Today
'get ref to GlAccounts
oGLAccounts = oAccountsService.GetDataInterface(AccountsServiceDataInterfaces.a sdiGLAccounts)
'add accounts that will be in credit or in debit
'add first account
oGLAccountFirst = oGLAccounts.Add
'set the account code
'(account name = "Sales Revenues - Services (HO, USA, GA )"
oGLAccountFirst.Code ="_SYS00000000083"
'set credit amount
oGLAccountFirst.Credit = 300
'add second account
oGLAccountSecond = oGLAccounts.Add
'set the account code
'(account name = Sales Revenues - Foreign (HO, USA, GA ))
oGLAccountSecond.Code ="_SYS00000000082"
'set credit amount
oGLAccountSecond.Credit = 300
'create the balance for the first and second accounts from the Openning 'Balance Account
oAccountsService.CreateOpenBalance(oOpenningBalanceAccount, oGLAccounts)
Hope it helps,
Vasu Natari. -
Interactive Report Sub-total and total
Hi friends,
I have an employee interactive report with group by job name and also showing the salary sub-total for each and every job(group by).
I have an requirement like to highlight the sub-total for each and every job with a background color so that the user can identify the sub-total with the color, and also whether it is possible to display an overall total @ last in the report with a label named "Total Salary" in which it calculates the overall salary is also to be highlightened with the background color.
Also is it possible to display a text "Sub-total" besides each and every salary sub-total of job(group by). Currently if we display a sum for the salary then im getting the total's but with out a text named total.
Since i can see the highlighted feature in interactive report but im not sure how to apply it for the sub-total and total column.
I have reproduced the example in apex.oracle.com
http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
In the application 9494 named "test" in page1.
Thanks in advance.
Brgds,
MiniHi, Mini,
style=background-color:red;
But that Total region color dint change.The code for style should be in "Form HTML Element Attributes". However, this changes the background color only for the Total value not for the whole row.
If you want to change for the whole row, you need to change the template that is selected for the region.
I changed the region template in your application to "Borderless Region" and made the changes to the "Borderless Region" template, it now shows the background color for Total Value.
<table class="t20Region t20Borderless #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" border="0" cellpadding="0" cellspacing="0" summary="" #REGION_ATTRIBUTES#>
<thead><tr><th class="t20RegionHeader" id="#REGION_STATIC_ID#_header">#TITLE#</th></tr></thead>
<tbody id="#REGION_STATIC_ID#_body">
<tr><td class="t20ButtonHolder">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
<tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>
</tbody>
</table>The below does the trick. :)
<tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>Note: I made the changes to "Borderless Template", but you can copy the template to your own and apply this change.
Regards,
Natarajan -
Sub-totals and Totals calculations....?
How to Calculate the Sub-totals and Grand totals in ABAP Programs.
Hi Bhaskar,
In my opinion this can be acheived in two ways:
1. Using ALV GRID DISPLAY
2. Using AT NEW , ON CHANGE OF , etc events.
1. In the ALV field catalogue u create entries for all the fileds to b
displayed in the output list.
Here, we need to put DO_SUM = 'X' .
eg
****************fieldcatalog*********************
data:anytab type slis_t_fieldcat_alv with header line.
**************pgm name**********************
data:anypgnm type sy-repid.
**************events*************************
anytab-fieldname = 'MATNR'.
anytab-seltext_m = 'Material Number'.
anytab-col_pos = 0.
anytab-outputlen = 20.
anytab-emphasize = 'X'.
anytab-do_sum = 'X' . <----
here it is.
append anytab to anytab .
clear anytab .
Now wen u call the fm REUSE_ALV_GRID_DISPLAY , plz pass anytab ie fieldcatalog and the tabel with records to b displayed .
this would sum the fields at the end.
2. Alternately ....for SUb-totals ;
Sort itab in an ascending manner.
Data : wa_itab like line of itab,
wa_subtotal type i.
" fieldname1 in itab is the key field
" fieldname2 is the value field
LOOP at itab into wa_itab .
wa_subtotal = wa-subtotal + itab-<fieldname2>.
AT END OF <fieldname1> .
" your programming logic for subtotal
Write :/ wa_itab-fieldname1 , wa_subtotal.
Clear wa_subtotal.
ENDAT.
" write :/ ....if u need to write any lofgic values ....
ENDLOOP .
Note : plz sc if a field in itab that is left of fieldname1 changes
the AT END OF event is triggered.
Therefoe , see that pur key fields towards left in itab.
FYI : u can try ON CHANGE OF....ENDON....
AT NEW .....ENDAT
AT LAST....ENDAT
AT FIRST ......ENDAT events for ur own understanding
i hope this helps u.
Regards
panakj -
I DON'T WANT TO UPGRADE OR HAVE AN ADD ON EVER, DISABLING UPDATES DOES NOT WORK, HOW DO I KILL ALL MESSAGES FOR UP GRADES AND ADD ON'S FOR EVER, ONCE AND FOR ALL, COMPLETELY, THE END AND NEVER BE BOTHERED AGAIN EVER! ALSO IF I KILL MYSELF I WILL HOLD YOU PERSONALTY RESPONSIBLE.edit
There is a world of information in these forums if you use the search function near the top right of this page. Just type in NAS for example and you get many threads on the subject (marked with a green checkmark if it solved the question) another example would be Airport Exterme and sound system. Once you formulate your ideas better then specific questions can be addressed one at a time. You may find that a less expensive choice for a server might be a mac mini. Good luck with your project, ask more specific questions and update you systems profile.
-
I use Apple Mail and dislike Outlook. If I create a note in Apple Mail, move it to my desktop for easy access and then open the note, it opens in Outlook. How do I stop Outlook from opening? Do I need to uninstall Outlook? Will it disrupt other software?
Open Apple Mail, and open Preferences (under Mail in the Menu Bar). On the General tab, check the "Default Email Reader" and set it to Mail (6.6).
-
Urgent : how to calculate sub total and grand total in smart forms
Hi Friens..how to calculate sub total and grand total in smart forms..How to print them in smart forms...Also kindly explain how to handle events in smart forms..Thanks in advance
Re: Subtotal with Table Node in smartforms
-
Hi All,How2 delete a pkey for std table and add 2 new primary keys
Hi All,
How2 delete a pkey for std table and add 2 new primary key fields .Please provide me the required procedure .
Thanks&Regards.
Bharat.Hi Bharat,
First thing is you need to have the access key to change any standard dictionary object/standard programs/ standard transactions.You may get this from your basis person after getting approval from your respective manager.But changing or modifying the standard object is not recommended, but if there is no alternate to meet the business requirement then we have to follow this way only.
Next, you need to check whether this table's primary key is being used in any other table as foreing key or not. If there is, then you must remove this relation and then you can delete the unncessary primary key field from that table.Finally you can add the two new fields and set them as primary key, save, check for any errors and activate.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
Revision: 12295
Revision: 12295
Author: [email protected]
Date: 2009-11-30 13:41:29 -0800 (Mon, 30 Nov 2009)
Log Message:
fix for FLEXDOCS-889, and add doc on the WindowedApplication.useNativeDragManager property
QE notes: -
Doc notes: -
Bugs: - FLEXDOCS-889
Reviewer: -
Tests run: - checkintests
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/FLEXDOCS-889
http://bugs.adobe.com/jira/browse/FLEXDOCS-889
Modified Paths:
flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as
flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as
flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/AnchorStyles.as -
Add opening balance and transactions in the total of the general ledger
How can we add all the opening balances and all the transactions of each vendor in the total of the general ledger in SAP Business One 2005 PL45 when we select several vendors ?
At first sight, there is no system variable in SBO 2005 for this.
Thierry.Hi
What is your selection criteria:
At the bottom , there is an option --Sort and summary
Sort by posting only ;
Sort by -BPCode ... Summary(yes)
This should help you
Bishal -
Fbl3n heading we need to adde opening balance and date
Hi guru's
My requirement is adding fields opening balance and date in fbl3n (g/l account line item display)
please guide me.Hi,
Use Business Transaction Events(Tcode FIBF) to populate custom fields in FBL*N transactions.
Regards,
Madhu -
Hi gurus,
I have a problem, please help me out.
Iam doing an report program with alv display. In that iam calculating the AVG for the workcenter wise for the field TAT.
please observe my below o/p in general ALv format.
work center-- TAT- Tat(Yes/no)
qm0010------ 1 -- yes
qm0010-------2 -- yes
qm0010------ 4 -- yes
qm0010------ 7 -- No (because >5)
Subtotal(qm0010)--3 (avg caluculated)
qm0020-- 4 --- yes
qm0020-7-- No (because >5)
qm0020--10 - No (because >5)
qm002010- No (because >5)
Subtotal(qm0020)-- 7 (avg caluculated).
this is the rough o/p iam getting . this is acheived by programming the Field catalog for TAT field i.e... do_sum = 'C'.
then giving the sort table to REUSE_ALV_GRID_DISPLAY.
Now my problem is:
I want the avg to be calcuted by the business formula which is:
avg = sum of(TAT within 5 days) / total no of the entries .
Ex:
work center-- TAT- Tat(Yes/no)
qm0010------ 1 -- yes
qm0010-------2 -- yes
qm0010------ 4 -- yes
qm0010------ 7 -- No (because >5)
Subtotal(qm0010)---*7/4=2 (avg caluculated for tat<5)*
qm0020-- 4 --- yes
qm0020-7-- No (because >5)
qm0020--10 - No (because >5)
qm002010- No (because >5)
Subtotal(qm0020)--4/4=1 (avg caluculated for tat<5).
How can i acheive the above, since in field catalog and alv, i think we cannot pass any conditions(like for TAT which is less than 5). So is there any other way to acheive the above.
Please understand the problem and give me(please directly dont suggest any programs , since iam not a expert to understand)..
Please explain me in detail. Points will be duly rewarded.
Thanks in advance........Chaitu
Edited by: chaitanya on May 30, 2008 12:33 PM
Edited by: chaitanya on May 30, 2008 12:38 PM
Edited by: chaitanya on May 30, 2008 12:39 PMHi Chaitanya,
You can display in your report with totals and sub-totals using alv, but not average. That functionality has not provided by sap. Do one thing add one more extra column Average in your output, do the calculation for average and pass the value in the coding itself. Then last display your report with Average field.
Rgds,
Bujji
Maybe you are looking for
-
Data Transfer Workbench can copy sales & purchase modules's data?
Hi, Just wondering that,any way to copy the Sales & Purchase Modules's data from existing company to new company? Copy Express can't do it. But how about Data Transfer Workbench can copy? Thanks Regards, Danny Edited by: Danny Gan on Mar 18, 2008 5:2
-
can i after setting up drive in ix2 dl can i turn it off remove drive to usb enclosure copy files to disk and replace it boot ix2 up and not lose any data becuase copying is real slow does any one know? Solved! Go to Solution.
-
Create sesrch method (Argent)
Dear all, I am working in ADF 10g (I have a problem when I am creating Search method). I need to make search by using LOV (create 2 LOV list one for month and one for Year) In my DB I have the the date in one column (19-Feb-2009) I make two view obje
-
Hello gurus, Is it possible to create a query from SAP structures using TX:sqvi? if it is possible, pls help out Regards, Tolulope
-
Fundamentals validation problems
i have a textfield which contain accept string values. i need to validate the textfield to accept only numbers. how can i check for characters and symbols? I have search for documentation but can't find any appropriate methods. Please help.