How to calculate Average balance for an account

Hi,
How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
I'm using the following query :
SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
FROM gl_code_combinations cc,
gl_je_lines l
WHERE cc.code_combination_id = l.code_combination_id
AND l.set_of_books_id ='XX'
and code_combination_id = replace it with code combination_id for account_xx
AND l.effective_date <= '31-Jan-12' (january period end ??)
GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
There are some discrepancies in "average balance" after end of month (Jan-12)?
How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
Thanks,
Kiran

Kiran,
Please let me know first, is Average Balancing feature enabled in your GL Ledger?
Regards
Muhammad Ayaz

Similar Messages

  • How to calculate Opening balance for a customer?

    Hi Experts,
    How to calculate Opening balance for a customer? I am trying to develop a report where in i have to get opening AR balance,current sales,adjustments etc of a customer. Please let me know how can i do this. I have some tables with me KNC1, BSAD, BSID.
    Thanks in Advance.
    Sharat Chandra.

    Say for example ..
    Get the opening bal for Customer 'K' in CCode 'C1' in 2008 ..
    First get all items from BSEG ..
    Select * from BSEG where KUNNR eq 'K'
                                     and BUKRS eq 'C1'
                                     and GJAHR eq '2008' .
    Sum all the DMBTR values (This is the total value).
    Second get the cleared items form BSAD for the above entries;
    Select * from BSAD for all entries in BSEG where KUNNR and BUKRS and XBLNR eq BSEG-XBLNR.
    Sum all DMBTR values ( this is cleared value).
    Third substract the cleared value from total to get Open value.
    This is a overview .. you should go to the tables and look for fields and etc.. and then define the logic meeeting your requirements .... this is a genric undersatnding ....
    Thanks,
    Aditya. V

  • How to Calculate Opening balance

    Hi BW Gurus,
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    Thanks in advance
    DJ

    Hi Friend,
    If Your Prob is solve then tell me how to find perticular month balance amount.
    i m create cash book report for perticuler GL Account , i use BKPF + BSEG for this
    i found all entries,
    But at last i want to Opening Balance for perticuler date.
    like     01/05/2007 opening balance = 10000 as per tcode FS10N
    and in 26/05/2007 ??????
    how to find exact date opening balance is there any function for same
    or any procedure..
    Thanks
    From
    Gaurav

  • HOW TO CALCULATE OPENNING BALANCE

    HI Experts..
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    I am Using 0FIAR_O03 ODS ..
    Very Urgent Issue..
    If Possible Stp by Step..
    Cheers
    Purushottam
    09891683828
    [email protected]

    Hi Saloni,
    to get the debit and credit you would be using a variable 0I_FPER(Fiscal year / period), which is a user entry interval variable.
    now to get the opening balance you will have to create a customer exit valiable and the low value of 0I_FPER will have to popuplated by writied the code for the customer exit valiable. you will have to restrict the key figure DEB_CRE_LC for this customer exit variable with the operand as less than(< Fiscal Year /Period from 0I_FPER)).
    If the above was useful please assign reward points.
    Regards
    Venkata Devaraj

  • How to see Trial Balance for a Segment

    Hi Experts,
    Does anybody has idea on how to see Triala Balance for a Segment ?
    In Standard Reports for Balance Sheet and Profit & Loss, SAP B1 has provided option for filtering on Segment, but the same is not true for Trial Balance.
    BR
    Samir Gandhi

    Hi Samir,
    yes it is possible to display Trial Balance in Segment format.
    open Trial Balance Report, in the Upper right hand of the of the window next to G/L Accounts you can find the "FIND" button, click that one then the Find G/L Account window opens. from this window you cans Select Segmentation accounts.
    regards,
    Fidel

  • How to get Open Balance for the year and Total Ending Balance?

    For a given account, how to get Open Balance for the year (Cumulative Ending Balance) and Total Ending Balance (Cumulative Ending Balance)?
    Is there any function module available? or should I read from some tables? Please advice.

    Hello Paul,
    You could try calling one of the following BAPIs - see which one meets your requirement. They are documented well so shouldn't be a problem finding out the correct one for your requirements.
    BAPI_GL_GETGLACCBALANCE      
    BAPI_GL_GETGLACCCURRENTBALANCE
    BAPI_GL_ACC_GETBALANCE      
    BAPI_GL_ACC_GETCURRENTBALANCE
    BAPI_GL_ACC_GETPERIODBALANCES
    BAPI_COND_VAL_DECRE_BALANCES
    You might have to put in some of your own logic after the BAPI call to get what you want.
    Hope this helps,
    Cheers,
    Sougata.
    p.s. Also look at FM FAGL_GET_ACCOUNT_BALANCE
    Edited by: Sougata Chatterjee on May 7, 2008 11:47 AM

  • How to calculates averages and send to a file?(source code)

    how to calculates averages and send to a file?(source code) I need to get started but I don't know where to begin...........the book I have doesn't really say how to handle averages and send to a file.................anybody got suggestions on how to get started? I am a newbie so place in layman's terms.............thanx

    To calculate an average: add all of the numbers together and divide by how many numbers you added together.
    ex: (1 + 2 + 3 + 10)/4 = 4 (4 is the average)
    As for writing them to a file, look over the API for random or sequential access files.

  • How system calculate Exchange Rate for material?

    I have some doubt how system calculate exchange rate for material when doing GR.
    For example, standard price of material is 0.01 USD per ea. PO is created in foreign currency (THB) with qty: 40,000 ea (THB 2,852.00)
    Actually when I do GR ea then accounting doc is:
    Dr. Inventory 400 USD (12,800 THB)
       Cr. GR/IR    88.64- USD (2,852.00- THB)
       Cr. Variant 311.36- USD (9,948.00- THB)
    for 2nd and 3rd line item, exchange rate M (THB -> USD) is 0.03108 which is correct.
    Could anyone advise where system get exchange rate for 1st line item?

    Hi
    First of all, as mentioned by you, the exchange rate for Item 2 and 3 is not 0.03108.. It is as below, based on the figures given by you...
    Dr. Inventory 400 USD (12,800 THB)........ Exch rate is 0.03125
    Cr. GR/IR 88.64- USD (2,852.00- THB)....... Exch rate is 0.03108
    Cr. Variant 311.36- USD (9,948.00- THB).... Exch rate is 0.0313
    I guess the item 3 is just a derivation from Items 1 and 2.. The Price diff results as a difference between std cost and purchase price...
    I believe, the exchange rate would have been 0.03125 at the time of GR... You need to check this in your system... For sure, it uses  exch rate type M in the standard... Check if 0.03125 (USD -> THB) or 32 THB -> USD exists in your system at all
    Item 2 is based on your PO negotiated rate...
    Regards
    Ajay M

  • How to find Opening Balance for Cash Book

    Hello Friends,
    I am Creating one Report for Cash Book.(Means : For Perticuler GL Account)
    I have no idea how to find Opening Balance for some Perticuler Date.
    Ex.
         Current date: 07/06/2007
        and i want to find Opening Balance on 26/05/2007
    i have Function for Calculating Opening Balance,                                                                               
    Group No: 3006             Business Object General Ledger Account  
    BAPI_GL_ACC_EXISTENCECHECK     Check existence of G/L account                  
    BAPI_GL_ACC_GETBALANCE     Closing balance of G/L account for chosen year  
    BAPI_GL_ACC_GETCURRENTBALANCE  Closing balance of G/L acc for curr year
    BAPI_GL_ACC_GETPERIODBALANCES  Posting period balances for each G/L account    
    but they show current opening balance, and i want for perticulaer Date..
             How to find Opening Balance for Cash Book
    please Help me out
    Thanks
    Gaurav Tripathi

    Hi Maruthi,
       Opening balance for a cutomer for a given period, u need to first find closing balance of that customer in the previous period. For eg. Suppose u want to find opening balance for customer 'A' for month of Nov'06, then U have to find wot was his closing balance in at end of Oct'06. Hope this solves u r problem

  • How to enter opening balance for GL A/C(Ex. Bank A/C, Cash A/C, Vendor A/C)

    Hi Expert,
    How to enter opening balance for last year to closing balance to this year opening balance explain deeply helpful for me Thanks in advance.
    Example
    All Bank A/C, Cash Book, Vendors, Customers, like that how to enter closing to opening balance.
    With Warm regards,
    Selva

    Dear,
    As per SAP standard there is no need to carry forward the balances as the system will do a virtual carry forward into next year opening without creating any FI documents.
    If your business scenario demands then you can use the transaction code F-02 for posting a carry forward balances, this will not effect any of your balances but only creates a FI document.
    If your R3 version is SAP ECC5 or 6 then use the transaction code FAGLGVTR

  • How to query opening balance for all customer or Vendor for an speci. date

    Hi,
    How to query opening balance for all customer or Vendor for an specific date?
    Example:
    put any date and query will show all customer/ Vendor  that date opening/current balance.
    Regards,
    Mizan

    Hi mizan700 ,
    Try this
    SELECT T0.[DocNum] As 'Doc No.', T0.[CardCode] As 'Customer Code',
    T0.[CardName] As 'Customer Name',(T0.[DocTotal]-T0.[PaidSys]) As 'O/S Balance'
    FROM OINV T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
    INNER JOIN OCRG T2 on T1.GroupCode = T2.GroupCode
    INNER JOIN INV1 T3 ON T0.DocEntry = T3.DocEntry
    WHERE T0.[DocStatus] ='O'
    AND
    (T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]')
    Regards:
    Balaji.S

  • How to calculate Average time from a date field

    Hi All,
    I have a date type field in my table .
    I want to calculate average time for a given country in a select query. Date has to be exculded. Only time has to be taken into consideration.
    Kindly help me.
    Sample data
    india 25-JUN-09 08:12:45
    india 25-JUN-09 09:01:12

    Take which one you want.WITH dates AS
      (SELECT sysdate x FROM dual
        UNION
       SELECT sysdate + 1 +1/24 FROM dual
    SELECT TO_CHAR(to_date(AVG(to_number(TO_CHAR(to_date(TO_CHAR(x,'HH24:MI:SS'),'HH24:MI:SS'),'sssss'))),'sssss'),'hh24:mi:ss')
       FROM dates;
    WITH dates AS
      (SELECT sysdate x FROM dual
        UNION
       SELECT sysdate + 1 +1/24 FROM dual
    SELECT floor(24 * AVG(x- TRUNC(x)))
      || ':'
      || floor(mod(24 * AVG(x- TRUNC(x)),1) * 60)
      || ':'
      || floor(mod(mod(24 * AVG(x- TRUNC(x)),1) * 60,1) * 60)
       FROM dates;By
    Vamsi

  • [svn:fx-trunk] 10545: Make DataGrid smarter about when and how to calculate the modulefactory for its renderers when using embedded fonts

    Revision: 10545
    Author:   [email protected]
    Date:     2009-09-23 13:33:21 -0700 (Wed, 23 Sep 2009)
    Log Message:
    Make DataGrid smarter about when and how to calculate the modulefactory for its renderers when using embedded fonts
    QE Notes: 2 Mustella tests fail:
    components/DataGrid/DataGrid_HaloSkin/Properties/datagrid_properties_columns_halo datagrid_properties_columns_increase0to1_halo
    components/DataGrid/DataGrid_SparkSkin/Properties/datagrid_properties_columns datagrid_properties_columns_increase0to1
    These fixes get us to measure the embedded fonts correctly when going from 0 columns to a set of columns so rowHeight will be different (and better) in those scenarios
    Doc Notes: None
    Bugs: SDK-15241
    Reviewer: Darrell
    API Change: No
    Is noteworthy for integration: No
    tests: checkintests mustella/browser/DataGrid
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-15241
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase .as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColu mn.as

    Hi Matthias,
    Sorry, if this reply seems like a products plug (which it is), but this is really how we solve this software engineering challenge at JKI...
    At JKI, we create VI Packages (which are basically installers for LabVIEW instrument drivers and toolkits) of our reusable code (using the package building capabilities of VIPM Professional).  We keep a VI Package Configuration file (that includes a copy of the actual packages) in each of our project folders (and check it into source code control just as we do for all our project files).  We also use VIPM Enterprise to distribute new VI Packages over the network.
    Also, as others have mentioned, we use the JKI TortoiseSVN Tool to make it easy to use TortoiseSVN directly from LabVIEW.
    Please feel free to contact JKI if you have any specific questions about these products.
    Thanks,
    -Jim 

  • How to calculate acquisition value for specified day

    Hi,
    in my z program I have a problem how to calculate acquisition value for my asset for specified day.
    Example:
    I have asset created 8.7.2008 with TTYPE 104 (External asset acquisition) with value 5950.
    30.11.2008 there is another TTYPE 272 (Retirement of current-yr acquis., w/o revenue) with value 950.
    So BEFORE 30.11.2008 acquisition value is 5950. After is 5000. Is there any function module (or something else) in SAP system where I can send asset number and date a it return to me acquisition value for that day?
    Many thanks for any answer!

    Hi,
    your suggestion means that I have to compute acquisition value by myself (sum all TTYPE 1** - sum all TTYPE 2**). So SAP does't provide such functionality (LDB ADA have it, because it can compute acquisitiob value for specific day)?
    Mant thanks for answer

  • I want to keep track of a running balance for a account

    I would like to keep a running balance for a account, I would like to be able to add a new amount whenever there is a new transaction and be shown what the new balance for that account is. I am sure that this is simple to do and i can do it the long way however a shortcut would be greatly appreciated, if there is already a thread that answers this question, please point me in the right direction.

    See this thread, among others.  "Running totals" is another way you might search.
    SG

Maybe you are looking for

  • Unable to view "Properties" for Spartan launch icon.

    Build 10049 ... minor nit ... glitch When I right-click on the pinned Spartan Quick Launch icon, I seen the normal three choices: Project Spartan Unpin this program Close this window. However, when I right-click on the top choice (Project Spartan), t

  • My iPad 2 has 10 music videos in the "Video" app but ............

    My iPad 2 has 10 music videos in the "Video" app, yet when I go to Settings / General / About, it indicates that there are 36 videos.  What gives?

  • HP Pavilion P2-1013w disks & videos freeze turn orange and wont run

    This problem happens mostly with you tube and disks I try to watch on the computer. Never have been able to watch much of anything on here especially disks. HP Support Assistant Unable to Complete Downloading Updates it has this problem also. Cannot

  • Install BPA Repository

    Hi, somebody know a good documentation about how to install BPA Repository 11g? I try to intall BPA Repository, from this link in OTN, but I cound't find how. http://download.oracle.com/otn/nt/bpa/Oracle_BPA_Suite_11gR1_OTN_download.zip This is the d

  • Problem with saving from another location.

    Hi:) My name is Steffen, and I have a little problem. I have this code down under. It works well enough, but the problem is that I can not give a new file name, but it is the same name that recur. How do I fix this. I use a template. The code Sub Sav