Possibility to show opening balance of a GL account through SQL query?

Hi experts,
Is it possible to run an SQL query in SBO that shows the opening balance
of a GL account based on a date entered by the user?
This is similar to how the general ledger shows the opening balance of a GL account based on the posting dates entered.
Thanks for your ideas.

Hi Gordon,
Thanks for that idea.
I am thinking of the following:
1. Create a virtual table (#TEST) from a SELECT statement that gets all journal entries for the specified GL account BEFORE the specified posting date.
2. Perform a SELECT statement that sums the debit and credit from (#TEST).
This should show the opening balance of the GL account right?
Regards,
Eric
Edited by: eceguerra on May 18, 2011 7:02 AM
Edited by: eceguerra on May 18, 2011 7:02 AM

Similar Messages

  • How to show opening balance

    hi all,
      i want to show opening balance in the detail list of fbl5n...how can i do this?
    thanks.

    Hi,
    In fbl5n ,select all items and in dates fields don't put start date just put end date .
    Regards,

  • GR/IR account showing open balance in FBL3N

    Hi All,
    There are no open GRN for booking still there is difference of amount in FBL3N.
    what could be the reason for showing open line item in fbl3n?
    Thanks
    chinna

    Hi Atif,
    Thanks for your detailed analysis& for your help in these days
    Please find below example:
    The PO quantity 250*155 -usd=38750 USD
    GRN-38750.00 -usd
    MIRO-1,738,529.42 -INR
    The GRN and MIRO and condition types all are booked 250 quantity, there is no pending to book however the GR/IR account t.code FBL3N is showing open balances.
    As your said F.13 is pending?
    Thanks
    Chinna

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

  • Upload Opening balance of G/L accounts from legacy system to SAP, and also

    Hi Gurus,
    How to upload Opening balance of G/L accounts from legacy system to SAP, and also Vendor and Customer balance.
    My Doubt is when you upload the customer balance and vendor balance will it effect the sundry debtor account and sundry creditor account if not the how will the sundry debtor account and sundry creditor account will be posted with the balance. Please send me the general entry passed for posting the same.
    What I understood is that when we are uploading the customer and vendor balances through LSMW, no entry will be passed and it will update the customer and vendor sub ledger in FBL1N and FBL5N but it will not affect the sundry debtor account and sundry creditor account.
    To give effect to sundry debtor account and sundry creditor account we need to manually pass a journal entry as follows.
    1)  Sundry debtors account A/c -
    DR
          TO clearing account A/c
    2)     clearing account A/c -
    dr
         Sundry creditor account A/c
    Please let me know whether iam correct
    Also please tell me what will be the scenario for uploading of the assets balances through LSMW.
    THANKS AND REGARDS
    MV

    Hi,
         When you uploading any data from legacy system to sap normally we will be using LSMW or BDC,thru this we will be uploading master data like G/L,vendor,Customer and asset master these are the some examples and we will upload transaction data also that is P&L Account and Balance sheet.When we do uploading data thru LSMW system will update all the values of vendor,customer and asset values as well as subsidary ledger also.No need to do manully.
    Regards,
    satya,
    FICO

  • How to show the VALUE as the Column Header using SQL query?

    Hi
    I have a requirement to show the picked value as the column header using SQL query.
    Example:
    ======
    SELECT EMPNO FROM EMP
    WHERE EMPNO=7934;
    Result Should be:
    7934
    7934

    I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
    SQL> set verify on
    SQL> def e =  7934
    old: SELECT empno "&&e"  FROM emp  WHERE empno = &&e
    new: SELECT empno "7934"  FROM emp  WHERE empno = 7934
    SQL> SELECT empno "7934"  FROM emp  WHERE empno = 7934
          7934
          7934
    1 row selected.

  • 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

  • FS10N Opening balance difference (Retained Earnings Account)

    Hi,
    We are getting opeing balance difference in FS10N balances from 2007 to 2008 (retained earnings accounts)
    1. We have carry forward the 2007 balances to 2008 through T.Code : F.16
    2. We are getting difference in 4 company codes.
    3. But there is no difference in T.Code: FBL3N
    Company      2008                            2007     
    1000     20,457,623.98     20,635,622.78
    Difference     =     177,998.80     
    1001     49,091,242.21     48,913,243.41
    Difference     =     177,998.80     
    1002     394,867,485.91-     396,028,401.55-
    Difference     =1160915.64     
    1003     2,556,851.66-     1,395,936.02-     
    Difference     =1160915.64     
    Can you please let us know why this difference is comming ?
    Thanks
    Madhusudan

    If you are using ECC use T. code FAGLGVTR - Balance Carryforward (New)
    F.07 - Balance Carryforward for Vendor/customers
    then only it shows the correct picture.
    when FBL5N is line item report it is no way relavent to balance carry.
    this may solve your problem
    assign points if it help

  • To get the possible comb'ns through sql query

    Hi
    I have a table link_details as
    sql>select * from link_details;
    link_id from_node to_node
    1 512 9546
    2 546 9129
    3 512 9129
    4 9546 9234
    5 9234 9589
    6 9129 9217
    7 9589 9900
    8 9217 9900
    and the from_node and to_node are the FK's which are referenced from the node_id in nodes table.
    And now i want to calculate the no'of combinations(Routes, to go from node 512 to node9900) from node 512 to 9900.
    I want the o/p like
    combination
    512-9546-9234-9589-9900
    512-9129-9217-9900
    Please Help me
    Thank you

    Well...
    I was trying my hands on the problem but could not achieve the end result. I could derive a column, by using ROWNUM, which can be used to group by. Following is what I tried:
    SQL> set serveroutput on
    SQL> create table link_details (link_id int, from_node number(4), to_node number(4));
    Table created
    SQL> insert into link_details values (1, 512, 9546);
    1 row inserted
    SQL> insert into link_details values (2, 546, 9129);
    1 row inserted
    SQL> insert into link_details values (3, 512, 9129);
    1 row inserted
    SQL> insert into link_details values (4, 9546, 9234);
    1 row inserted
    SQL> insert into link_details values (5, 9234, 9589);
    1 row inserted
    SQL> insert into link_details values (6, 9129, 9217);
    1 row inserted
    SQL> insert into link_details values (7, 9589, 9900);
    1 row inserted
    SQL> insert into link_details values (8, 9217, 9900);
    1 row inserted
    SQL> commit ;
    Commit complete
    SQL> select * from link_details;
                                    LINK_ID FROM_NODE TO_NODE
                                          1       512    9546
                                          2       546    9129
                                          3       512    9129
                                          4      9546    9234
                                          5      9234    9589
                                          6      9129    9217
                                          7      9589    9900
                                          8      9217    9900
    8 rows selected
    SQL> select max(r) over (order by rownum) rt, ln, from_node, to_node
      2  from (
      3  select decode(ln, lag(ln) over (order by rn) + 1, null, rn) r, ln, from_node, to_node
      4  from (
      5  select rownum rn, level ln, from_node, to_node
      6  from link_details
      7  start with from_node = 512
      8  connect by prior to_node = from_node ) ) ;
    RT                                               LN FROM_NODE TO_NODE
    1                                                 1       512    9546
    1                                                 2      9546    9234
    1                                                 3      9234    9589
    1                                                 4      9589    9900
    5                                                 1       512    9129
    5                                                 2      9129    9217
    5                                                 3      9217    9900
    7 rows selected

  • Posting the opening balance of Assets in GL account through OASV

    Hi,
    When we are entering the opening balance in assets GL account through OASV , system gives error
    " Document number is 1000000000 is already assigned to company code  with document type 01"
    Asset GL account is alreay having some balances.
    Pl let us know that how can we increase the number ranges for 01 document type.
    thanks
    harish

    Hi!
    Check this links
    Re: Opening Balance
    Opening Balance
    Opening Balance
    Re: Question regarding Opening Balance

  • G/L  Account  opening Balances.

    hi
    Experts,
    is there any Function Module/BApi  for  G/L(  cash/ bank)  opening  balance as  on date.
    Thanks &  Regards
    Spandana

    Hi,
    You can upload opening balance to any GL account through a BDC program.For this you need to co ordinate with your ABAP consultant.
    Or if your trial balance was having less number of items, you can pass a journal voucher with Tcode F-02.
    Hope this will help.
    Thanks,
    Srinu

  • Fault found with opening balances output on Trial Balance report

    When running the Trial Balance report and adding "Opening Balances" and taking the "OB from Start of Fiscal Year" option, the relevant opening balances are not shown from the closing balance of the prior period.
    All balance sheet accounts should always show a "brought forward" balance if one exists, whereas P&L Accounts should only carry balances forward over monthend boundaries, resetting at the point of a yearend. This is not the output provided by the report.
    This issue has been checked on numerous patch levels (including the beta release of 2007a SP01 by a support consultant) and returns the same problem.

    Hi Julian,
    I checked the functionality by myself and I have two findings:
    1) that the Trial balance displays in the opening balance balances for the P&L accounts from previous period.
    2) On the other side there is a functionality "Add closing balances" on the Trial balance selection criteria with option "Closing balances before Selected Period Only" which would adjust the presented opening balances for P&L accounts in point 1.
    Based on your description I understand that Global Support Center knows about the issue, so I think the point 2 could be used as temporary workaround till the system is corrected.
    Best Regards,
    Martin Slavik
    SAP Business One Solution Manager

  • GL Account Openning Balance

    Hi
    In GL account there was no closing balance in 2007 but we are able to see Openning balance in 2008 as cumulative balance
    How is it possible?
    Regards
    Prasad

    Dear Prasad,
    The system will transfer the Balance sheet account balances for the next fiscal year as opening balance.
    P&L account balances will be transfered to the retain
    earning account.
    The value of profit and loss of the previous year is always carried forward to the retained earnings account, for the P&L acoounts have zero opening balance.
    For futher information please take account the note 176067 and 402917.
    I hope the above information is of help.
    Renata

  • Opening Balance of Banks in G/L Accounts

    When I want to Show the opening balance in Bank ( G/L ) Accounts I am following the sequence mentioned Below. But It is not clear for me . Can U guide me.
    Administration -> System Initialization -> Opening Balances -> G/LAccounts Opening Balances  In G/L Accounts Opening Balance Screen when we select Specific Bank G/L Account Number the same is Disappearing from the list of G/L ACCOUNTS. Due to this I am unable to enter Opening Balance for the required Bank. What is the reason.
    May be my procedure is wrong, please guide me.

    Santosh,
    As I suggested in one of my earlier messages, You may use Journal Entry to bring in Opening Balances.
    Debit       Bank Account G/L
    Credit      Opening Balance Account.  (this is the account you would be creating to balance all the opening balance import)
    Suda

Maybe you are looking for

  • Text that spans more than one cell in a JTable

    Hi all. I have a JTable where I've altered the renderer so that it looks like I have columns that span more than one cell. e.g.: http://i.imgur.com/RSGOh.png From that image though you will notice that the text (which is based in a JLabel) is truncat

  • Level 0 & level 1

    Hi, Below is example backup strategy. Sunday - Level 0 (Full) Monday - Level 1 (Difference between 0 & 1) Tuesday - Level 1 Question 1: now on Tuesday will it take backup from last level 0 or last level 1? Question 2: Does backup of archive log follo

  • Generic Icons on server, others not having problems

    At work we have 3 Macs that are all hooked up to the same server. All the Macs are similar, 2-G4 Dual 1.25 GHz and 1 Imac Intel. Out of the 3, only 1, a G4, gets generic icons for Quark, fonts, Illustrator, and photoshop files. Both of the G4s were s

  • Can I uninstall CC versions of software now that I've upgraded to CC2014?

    In the past week I've updated several of my Adobe CC products (DW, Photoshop, Illustrator, etc.) to the CC 2014 versions. Can I/should I uninstall the original CC versions? I'm running Mac OSX v10.9.3 if that has any bearing. Thanks!

  • Passing Credentials When Reading Performance Counters on Remote Computers; Systems.Diagnostics namespace

    Hello, I am working on a website where I need to read a few performance counters on remote computers. I'm using the System.Diagnostics namespace and the following is a snipet of my code: ****************  CODE  ***************************************