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...

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 query the opening balance for an specific account for an spec. date

    Hi all,
    for my user query I need to calculate the opening balance for an cash account for an specific date.
    Any ideas, how can I do this?
    Or may be you know a field in an SBO table that already contains information I need...
    Best Regards,
    Inna

    Hi Inna,
    to find the opening balance for an account or a business partner, please see SAP Note [1114253|https://service.sap.com/sap/support/notes/1114253] :
    Symptom
    How to find the opening balance of a business partner or G/L account.
    Other terms
    Account, customer, supplier, vendor, creditor, debitor, start, initial, first, opening balance, business partner, G/L, SAP Business One
    Reason and Prerequisites
    Consulting
    Solution
    There are several possible approaches:
    Approach 1 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data -> find the Business Partner
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 2 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data.
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Double click on the column header 'Posting Date' to find the earliest transaction on the business partner account. This transaction could be opening balance, verify this with the company accountant.
    Approach 3 - G/L Account Opening Balance:
    1. Go to Financials -> Chart of Accounts -> click on the account name once.
    2. Click on the orange link arrow next to the field 'Balance'.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 4 - Business Partner and/or G/L Account Opening Balance:
    1. If using SAP Business One 2005 SP01 or earlier, go to Reports -> Query Generator -> click on 'Execute'.
    2. If using SAP Business One 2007 or later, go to Tools -> Queries -> Query Generator -> click on 'Execute'.
    3. Ignore the red system message in the bottom of the screen.
    4. Click on the pencil icon in the top left of the window, the field with 'SELECT *' will change colour to white, then yellow when activated by clicking in the field.
    5. Copy the query below:
               SELECT T0.[TransId], T0.[Debit], T0.[Credit] , T0.[CreatedBy], T0.[TransType] FROM [dbo].[JDT1]  T0 WHERE T0.[TransType] = '-2'  and T0.[ShortName]  = '[%1]'
    6. Click on 'Save' and give the query an appropriate name and select the appropriate category.
    7. Click on 'Execute'.
    8. Click on 'Existing Values'.
    9. Select the G/L account or the Business Partner name from the list and click on 'OK'.
    10. The system message 'Records retrieved by this query #' (# = number of records) will pop up. Click on 'OK'.
    All the best,
    Kerstin

  • 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

  • Get Open Items for GL Reconciliation account for Customers

    Hi All
    We have a difference on our AR to GL reconciliation, we are unable to view all postings to the GL account using Tcodes FBL3N or FS10N ?  - the function is not available on that GL account.
    how do we compare the open items on customer accounts to the postings in the GL reconciliation account if we can not get a line item report ?
    Thanks in advance for any assistance
    Dylan

    Hi,
    Generally for recon accounts, the indicator Lina item display will set to off. So you will not get line items for your recon account in FBL3N report. But still you can get the GL balances in FS10N for that recon accounts.
    If you want to see the line items also for that recon account, then go to master data of that GL and select Line item display option  and block the account in company code for postings temporarly.
    Now run report RFSEPA01 in SE38 for you recon GL account.
    Again go to GL master and unblock the blocking indicator.
    Now check the line items in FBL3N for that recon account.
    Thanks,
    Srinu

  • Opening balance for bank GL Account

    Hi,
      Is there any function module or table to get the bank opening and closing balance with respect to business area and date.
    Regards

    Hi Ankita,
    Please check these Function Modules.
    BAPI_GL_GETGLACCPERIODBALANCES ---> Posting period balances for each G/L account
    BAPI_GL_ACC_GETPERIODBALANCES ---> Posting period balances for each G/L account
    Best regards,
    raam

  • BingAds API: Can we configure the same email id to get API access for multiple BingAds account ?

    Hi Eric,
    We help our customers to analyze their marketing performance. We have configured the email id e.g. [email protected] which has the API access to one of our customer BingAds Account. Now we are able to authenticate using Oath tokens and able to access customer
    data using the given developer token.
    Now i need your help to clarify the below.
    1) Can i have the access to my other customer BingAds account using the same email Id i.e. [email protected] or Do i need have the two different users/email ids to access different BingAds account?
    2) If it is possible to configure the same emailId/usert for different BingAds accounts , then i belive my Oauth tokens will be same in this case, but how about my devloper token , do i need to maintain two seperate developer tokens?
    3) If its not possible to use the same email id for two BingAds account api access, is there any alternate way to have the common oauth authentication for  both the accounts?
    Thanks in advance.
    Regards,
    Sreekanth.
    Sreekanth A

    Hi Eric,
    I have got to know from the BingAds support that i have to switch my account to Agency type to access multiple accounts data over API. But they only assist on this for Microsoft Managed BingAds account, but it can not access the data from BingAds account which
    is managed by Yahoo.
    If i need to create Agency type BingAds account which can have the API access to multiple BingAds accounts managed by Yahoo, what may be the process?
    Can you please guide me on this? as of now i got the news is that to contact the Yahoo Account managers, if you have any more information on this , please let me know.
    Thanks,
    Sreekanth.
    Sreekanth A

  • How to get the opening balances for lessthan selected date in cubes.

    Hi All,
    my task is to get the opening balances for the selected date.
    Ex: If I select date say 31-1-2013, I should get the sum of values which are less than the selected date.
    in sql:
    select sum(balance) from banktrans where banktrans.transdate < 31-1-2013;
    BankTable                            BankTrans
    BankId                               BankId
                                            balance
                                            transdate
    BankTable (records):
    SCB
    BankTrans(records):
    a) SCB, 15000, 10-02-2013
    b) SCB, 20000, 31-01-2014
    c) SCB, 50000, 21-09-2012
    If I select date as 31-01-2014, I should get the value as 65000 
    If I select date as 10-02-2013, I should get the value as 50000
    Date will be dynamic selection from years months days hirearchy ( time dimension)
    How can i achieve this?  
    any help is much appreciated.
    Thanks,
    Rakesh

    Dear David,
    I've tried the below with static date but i'm not getting the values which are sum of less than the given date.
    I've given 1st jan 2013 as static date and I need to get the sum of values which are less than the 1st jan date.
    CREATE
    MEMBER
    CURRENTCUBE.[Measures].[OPENBALANCE]
    AS
    Sum({Null:[Time].[Years
    Quarters Months Weeks Days].[Days].&[2013-01-01T00:00:00]},[Measures].[AmountCur]]),
    FORMAT_STRING
    = "Standard",
    VISIBLE
    = 1
    can you plz check the above once and guide me.
    Thankyou,
    Rakesh

  • Passing the Opening Balance for the 1st peroid of the quater

    HI ,
    Passing the Opening Balance for the 1st peroid of the quater: The report format is as follows
    Code-Desc-Amount
    1001-AAAA-1000
    1002-BBBB-2000
    1003-CCCC-3000
    The output is based on quaterwise. If I enter the first period of the particular quater, it will show the reports for the whole quater. I created the report and working fine.
    But the problem is that, if it is AAAA, i need to pass only first period of that quater else total of the quater.
    Can you please, explain me how to do this....
    Thanks and Regards
    Rajesh

    Hi Pooja,
    RSA3 only shows records in setup table, which is collected by MCNB.
    by MCNB, you could only get the current opening stock, and in order to calculate the open stock in previous month,
    you'd have to load the history movement via 2lis_03_bf.
    Thanks & B.R.
    Vince

  • Opening Balances for Previous Periods

    Hi Experts,
    There is a client requirement of entering opening balances for GL for previous periods before going live.
    eg it is required to have OB for 2006,2007 and 2008 before live transactions are entered into the system.
    Please enlighten on how to carry out this.
    Regards,
    Asap

    Hi Asap,
    You could only have one OB for one account.  If those OB for different years are for different accounts, it is ok.  Otherwise, you have 2006 OB only. You may create JE to get something like OB for 2007 and 2008.
    Thanks,
    Gordon

  • 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 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.

  • Opening balance for Trial balance report

    Hello  Experts,
    I have requirment to develop a Trial Balance report with the colum like Opening Balance, Transaction Debit,Transactoin Credit and closing balance.
    I am trying to get opening balance from the Table FAGLFLEXT.
    how can I get the opening balance. In FAGLFLEXT in the fild HSLVT ( Carry forward Bal. in local currency) has more than one line item for one fiscal yer, one G/L and one profit center. Should I club all the values of HSLVT value.
    Thanks

    Hi Srikant, Yogesh...
    Thank you for your reply. But  I have some other requirment for that I have to go for devlopment for this report.
    Regards,

  • AP opening Balance for one year

    Hi
    I need opening balance upto 2009,total purchases and payment from which table i can get opening balacne fro specif year and total purchases and payments
    Thanks

    Dear Experts,
    I also have the same requirements, I want to load the Opening balance for the year 2011.
    I Never load this, and any help would be highly appreciated.
    Thanks,
    Atul

  • Opening balance for vendor in debit

    Hi
                                  When I post the opening balances for vendors it is showing the vendor balance as debit.(+) Is this correct or it should show vendor balance in credit and customer balance as debit ?
    Regards
    Sekar

    Hi,
                              This was the JE:
                                                                                    VENDOR                         1000 (Debit)
                                                              OP BAL(Asset)               1000(Credit)
    Remarks: BPartners  Opening Balance       
    Thanks and Regards,
    Sekar
    Edited by: S. Gamaliel Sekar on May 17, 2011 11:38 AM
    Edited by: S. Gamaliel Sekar on May 17, 2011 11:39 AM

Maybe you are looking for

  • Error Message while sending a photo message

    While trying to send a photo message the following failed error message occurs   1xDNS not responding.   Phone being used is a Casio GzOne

  • How to restrict erroneous material in 0MAT_SALES_LPRH_HIER in BW 3.1

    Hi Friends, There is one erroneous material which has junk characters in it. It has been marked as deleted in R/3. But still that material is getting pickedup into BI when I am doing full load for 0MAT_SALES_LPRH_HIER hierarchy datasource in BW 3.1.

  • Single-signon for multiple sites or sub sites

    Does anyone know of some good articles/publications or suggestions for implementing a single signon for multiple very secure internet sites in weblogic type environments. For example, bank1 has a internet site and bank 2 has an internet site. Bank 2

  • Error 4002 every time I open iTunes

    Every time I open iTunes up I get an error box stating; "We could not complete your iTunes store request. An unknown error occurred (4002). There was an error in the iTunes store" This box comes up every time I open the application, whether it's been

  • Submit PDF Data via SOAP

    Situation: Write a PDF out to a public share. Email the location reference to a user. Allow the person to add their data to the form. Allow the person to submit. I would like to submit the data to a workflow process. From what I have read, a lot of p