How to get opening balance of a g/l account using query ?

Dear all,
I'm developing consolidated g/l accounts debit,credit totals month wise with opening & closing balances thru query based report,
i'have got expected results except opening balance g/l account,
How to get opening balance of a g/l account based on date as conditonal parameter ?
Any one throw light on this ?
Jeyakanthan

Hi ,
Please kindly help me on this.I don't know how to calculate opening bal and closing bal over a period of time by Quarter, and how to generate the reprot using crystal reports and please suggest me on this how to go ahead with this report.
Here you can go through the reprot requirement , and also an attachment of my Report template.
we have "Category of Investment" , "Income On Investment" ,"Gross yield" and "Net yield" are  report fields.
1)"Category Of Investment " is Hardcoded.
2)In this we have to get  "Investment" column from VTBFHAPO(BZBETR Field) table Database based on
Flow type(SFHAZBA) in VTBFHAPO table ='0100' for bonds category.
3)"Income on Investment" also we will get from DB using the following formula.
  Income On Investment= "Interest IncomeAmortizationCapitalgain"
4)With the Date field(Making Date dimension based on date(DCRDAT) field in VTBFAHPO table.
By Current Quarter,Year to Date,Last year)
5)Opening bal---Investment
Purchase--Flowtype=0100
Meturity/Sales--Flowtype=0200
Closing balance=Opening bal+(Investment or Purchase)-(Meturity or Sales)
                                  '0100'                 '0200'
Here '0100' and '0200' are Flow types based on this i need to get value from the same Field.
we need to Calculate "Gross yield" .
The bellow are formulas  to evaluate "Gross yield "
Ist Qtr  .Gross yield=Investment income/(((April opening balanceApril closing balance)/2)((May opening balanceMay Closing Balance)/2)((June opening balance+June closing balance)/2))/3)
Ist qtr. Year to date   Gross yield=Investment income/(((April opening balanceApril closing balance)/2)((May opening balanceMay Closing Balance)/2)((June opening balance+June closing balance)/2))/3)
Investment income=interest incomeamortisationcapital gain
Iind Qtr.Gross yield=Investment income/(((July opening balanceJuly closing balance)/2)((Aug opening balanceAug Closing Balance)/2)((Sept. opening balance+Sept. closing balance)/2))/3)
Iind Qtr. Year todateGross yield=Investment income/(((April opening balanceApril closing balance)/2)((May opening balanceMay Closing Balance)/2)((June opening balanceJune closing balance)/2))((July opening balanceJuly closing balance)/2)((Aug opening balanceAug Closing Balance)/2)((Sept. opening balance+Sept. closing balance)/2))/6
This data should display over a period of time. based on "Current Quarter","YearToDate" and "Last year"
The quarter starts from April,i,e FY,  I Like this i need to generate the report.
Thanks in advance.

Similar Messages

  • 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 Get Opening Balance?

    Hello All,
    from our legacy system we inputed it to SBO... now i want to get the summary of all the opening balance. how can i get the data that i wanted to. is there a built in report in SBO for this?
    Please advice.
    FIDEL

    Hello,
    When in the Trail Balance selection criteria window, on the left hand side there is an option of selecting the Opening Balance.
    User can select the Opening Balances radio box and the balances would appear on the window under the column O/B in the Trial balance window.
    Hope it helps.
    Regards,
    Jitin Chawla

  • How to get Opening Balance for Stock Report in Crystal Report?

    Dear Experts,
    I am using SAP B1 8.82.
    I am new to crystal report and now trying to do a monthly stock report with the following format:
    Species  BatchNum   OpeningBal   QtyInKD    QtyInRD    QtyInCD   Adj    ClosingBal
    ABC       T1234          17.43           10.16         17.43        0.00         0.00   10.16
    ClosingBal = OpeningBal + QtyInKD - QtyInRD - QtyInCD + Adj
    Parameters:
    - DateFrom
    - DateTo
    - WarehouseFrom
    - WarehouseTo
    I am having problem in defining formula to get the opening balance for each item. The report is grouped by species, whscode & batchNum.
    Anyone please share with me how to write the formula for opening balance in stock report.
    Thanks.
    Best Regards,
    Leng

    Hi
    Check the below discussion it may helps you
    Opening Stock Batchwise
    With Regards
    Balaji Sampath

  • 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 calcualte opening balance of supplier for given period

    Hi all,
    i have to develoed suppler ledger report.please help me how to calculate opening balance of supplier.
    Thanks and regards,

    Hi,
    Are you looking out for the outstanding balances for the Supplier.
    If in this case, if you are particular to know the opening balance of the supplier then you can run the report
    called ' Supplier Open Balance Letter', wherein you can get the opening balance of the supplier.

  • 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

  • Problem in getting opening balance for multiple GL Account

    Hi,
    I am working on a  Trail Balance Report in which i am trying to fetch the data for the opening balance for multiple GL Accounts but it is not coming accurate.. Here is the link to the code which i am using currently right now:-
    http://docs.google.com/View?id=dfxswwff_13fgpdcbgt
    here i am showing the logic for the data of previous year only... i.e. data from begining to 1 day less of the date-low.

    Hi,
    It is a tranparent table which is getting data from the 2 other tables,the filling of this table is right. The execution of this query is right in the program but the problem comes when it is trying to calculate the opening balance for the respective GL Account present in the query it is not doing it. i.e. if there are 2 gl account ids having 3 rows of data each it is not calculating the of it in a single row.. i hope it is clear now...

  • 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 get loan balance

    Dear Friends,
    How to get loan balance in HR module.
    any help higly appricated.
    Regards,
    Malik

    Hi,
    Use the Function Module "PYXX_READ_PAYROLL_RESULT".
    Check Tables PA0045 & PA0078 (If loan amount is more than Salary).
    Cheers,
    Sunil B.

  • How to get aggregate balance?

    Hi,
    i have a requirement need to calculate % of total amont for each level.
    ex:
    product dimension have have 4 level, product level 1,product level 2, product level 3, product level 4.
    if i drill to product level 4, i need have a calculate column to calcuate percentage
    product level 4' balance / sum(product level 3' balance)
    how to get aggregate balance sum(product level 3' balance)?

    Hi,
    Use the Function Module "PYXX_READ_PAYROLL_RESULT".
    Check Tables PA0045 & PA0078 (If loan amount is more than Salary).
    Cheers,
    Sunil B.

  • 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 display Opening Balance/Closing Balance in Genral Ledger PLD

    Hi all,
    How to display Opening Balance
    in General Ledger
    PLD
    (OB is already displayed in
    header of print report)
    on first page only?
    How to display Closing  Balance
    in General Ledger
    PLD
    (CB is already displayed in
    footer of print report)
    on Last page only?
    Thanks,
    With regards,
    Jeyakanthan.

    Hi,
    If you open General Ledger Report and after selecting customer code you will see the Print Preview. On that time, one window opens and asks you to select any one from two options.
    Option 1 : Book of Accounts
    Option 2 : Subsidiary Account
    In both the Options, PLD has Opening Balance in Repetitive Area Header and Closing Balance in Repetitive Area Footer. So, it will when Report grows more than one page and if you want to see both the Opening Balance and Closing Balance in all the pages then you should Tick the Check Box "Display Repetitive Area Footer on all Pages" . So that you can view OB and CB in all the pages.
    Raja.S

  • How to calculate Opening Balance / How to Enhance 0FI_AR_6 DS

    Hi FI Experts,
    I need Opening Balance in my BI report,
    I am using 0FI_AR_6 DS , I have loaded data to CUBE, loaded Successfully.
    In this Data Source I need G/L Account Number and Terms of Payment (Payment Terms)
    I wrote the User Exit for this , then I check in RSA3, data is populating for those two fields.
    When I Try to load the data in to BI, it is not loading , it is showing Request is still Running  , records it is showing zero ‘0’.
    If I remove the user exit , data is loading fine.
    My requirement is to calculate Opening Balance,
    First I used 0FI_AR_4 DS , but I am not getting Accumulated Balance here, then I use the DS 0FI_AR_6 it have Accumulated Balance field but in this DS I don’t have G/L Account Number and Terms of Payment (Payment Terms)
    Its very urgent , we are in UAT stage…
    Need some inputs to resolve this..
    Thanks & Regards,
    SHAIK
    Edited by: shaik on Jan 16, 2008 10:55 AM

    Hey Shaik,
    Why you are using AR extractors to get the G/L account opening balance ? As i understand the AR accounts post to a limited G/L account (known as the recon accounts) and it will not extract all the G/L accounts in the first place. So even if you manage to get the opening balance, AR extractors will not give you all the G/L accounts opening balance. If you need to get the opening balance for the G/L accounts then you need to look at G/L extractors.
    For the AR extractors what is your extraction period range ? Have you included period '000' for your extraction ?
    Hope it helps.
    Thanks,
    Soumya

  • How to legecy opening balance

    Dear Friends
    Please  let me know how to legecy opening balances import respective GL  accounts in SAP. Customer, Vendors, we can import LMSW or BDC
    Regards
    NitheshP

    Hi,
    You can upload the Master Data or opening balances of Customers, Vendors, Materials and Asset through LSMW tool or you can also upload through BDC with the help of ABAPers.
    Srinivasa Chary

Maybe you are looking for

  • How to reduce file size

    I have one page file. There is no image, just text. Now the file size is 3MB. I cannot reduce size anyhow. I have moved the tick from embed fonts at save option tab but file size is same. How I can reduce file size? In addition this file is used so m

  • Regarding sapsscript

    can you please tell me &VBDKL-BRGEW(I13)& what (I13) signifies regarding the layout set in sapscript in?i am beginner ?thank you.

  • Video player to Adobe Flash Media Encoder

    Hi i want stream same video with Adobe Flash Media Encoder what software i can use now im using manycam but quality is no good plz for help.

  • Port number 8686

    The port number of bpm admin of BPM for weblogic 10.3.1 and BPM standalone 10g is 8686. I need to change it. Does anyone how to change the port number?

  • My iMac crashed and took my website with it

    My iMac won't boot up and I use it to run my website. The website is hosted on dot mac and the files are on iDisk. Is there any way to get it up and running on another Mac by importing those files into iWeb on that machine?