Query help on totalling 2 account balances

Hi Experts,
I have the following query:
SELECT SUM(T0.[SYSDeb] - T0.[SYSCred]) AS 'Production'
FROM JDT1 T0  INNER JOIN OJDT T1 ON T0.TransId = T1.TransId WHERE T0.[Account] = '_SYS00000000238' AND T0.[Account] = '_SYS00000000239'
If I add the second WHERE statement the query gives me no results. I want to see the total of the 2 account balances in this query.
Any help would be appreciated.
Marli

Hi Marli,
Try this:
SELECT SUM(T0.SYSDeb  - T0.SYSCred) AS 'Production'
FROM JDT1 T0
WHERE T0.Account in ('_SYS00000000238','_SYS00000000239')
Thanks,
Gordon

Similar Messages

  • GL Account Balance Query Issue

    Hi,
      I'm trying to extract GL Balances in the following format
    Company Segment(Segment2)  ||   Account Number(Segment1) ||  Cost Center Segment4 ||  Account Descr ||  Actual Flag || Account Type || Activity || Activity in Period || Currency || Period End date || Account Balance
    Here's my query :
    SELECT     gcc.segment4  "Company Segment",
               gcc.segment1  "Account",
               gcc.segment2  "Cost Center",
               a1.description "Account Description",
             --  a2.description Company_Description,
               Decode(gcc.account_type,'A','Asset','E','Expense','L','Liability','O','Equity','R','Revenue') "Account Type",
               Decode(gcc.enabled_flag,'Y','TRUE','FALSE')  "Active Account",
               Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE') "Activity in Period",
               bal.actual_flag  " Actual Flag",
               bal.currency_code  "Account Currency",
               per.end_date  "Period End Date",
               SUM(( NVL(bal.PERIOD_NET_DR,0) + NVL(bal.BEGIN_BALANCE_DR,0))) - SUM(NVL(bal.PERIOD_NET_CR,0)+NVL(bal.BEGIN_BALANCE_CR,0)) -
                         SUM( NVL(bal.BEGIN_BALANCE_DR,0) - NVL(bal.BEGIN_BALANCE_CR,0))   "Account Balance"
    FROM        apps.fnd_flex_values_vl a1,      --- For Account Segment
                apps.fnd_flex_values_vl a2,              -- For Cost Center
                apps.gl_code_combinations gcc,
                apps.gl_balances bal,
                apps.gl_periods per
    WHERE       a1.flex_value = gcc.segment1 
    AND         a2.flex_value = gcc.segment2
    and         a1.flex_value_set_id = 111111        -- Value set id for Account
    ---and         a2.flex_value_set_id = 222222    -- Value set id for Cost Center
    and         gcc.code_combination_id = bal.code_combination_id
    and          bal.period_name = per.period_name
    and         gcc.segment1 in ('777777')      --- Sample Account for testing only
    --and         gcc.segment2 in (222222)
    and         per.period_set_name ='GL_CALENDAR'
    and         bal.period_name ='SEP-13'
    and         bal.actual_flag='A'
    group by    gcc.segment4,
                gcc.segment1,
                gcc.segment2,
                a1.description,
               --            Decode(gcc.account_type,'A','Asset','E','Expense','L','Liability','O','Equity','R','Revenue'),
                Decode(gcc.enabled_flag,'Y','TRUE','FALSE'),
                Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE'),
                bal.actual_flag,
                bal.currency_code,
                per.end_date
                order by gcc.segment1,gcc.segment2
    1) If I  comment value set id 222222(Cost Center), then I'm getting 15 Records ,If I uncomment that I'm getting 10 records?Is there anything wrong with my queryAs I'm not displaying descriptions for cost center and company do I need to join fnd_flex_values_vl again or not ? 2) To check activity in particular period in this case for SEP-13,I'm using the following clause : Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE') Do I need to check ABS values also ro not?

    Hi,
      You can do this with WD dynamic programming.
      You can do with domodifyview badi for accounting component /SAPSRM/WDC_UI_DO_ACC.
      You need to handle both views 'V_DO_ACCOUNTING' and  'V_DO_ACCOUNT_DETAIL' in the domodifyview badi implementation.
    I am sending the sample  code. How to attach the custom search help dynamically.
      DATA lo_nd_comp_context    TYPE REF TO if_wd_context_node.
      DATA lo_nd_acc_context     TYPE REF TO if_wd_context_node.
      DATA lo_nd_info_acc        TYPE REF TO if_wd_context_node_info.
      DATA lv_value_help_mode    TYPE i.
      DATA lv_value_help         TYPE string.
      " Read Context
      lo_nd_comp_context = wd_context->get_child_node( name = 'COMP_CONTEXT' ).
      " get node info object of accounting node
      IF lo_nd_acc_context IS BOUND.
        lo_nd_info_acc = lo_nd_acc_context->get_node_info( ).
      ENDIF.
      " continue only if node info is supplied
      IF lo_nd_info_acc IS BOUND.
        " get current search help info
        lo_nd_info_acc->get_attribute_value_help(
          EXPORTING
            name            = 'G_L_ACCT'
          IMPORTING
            value_help_mode = lv_value_help_mode
            value_help      = lv_value_help
    " Below this will add the custom search help from SRM .
             lo_nd_info_acc->set_attribute_value_help(
            EXPORTING
              name            = 'G_L_ACCT'
              value_help_mode = 'BUS2121'
              value_help      = 'Z_F4-Your search help'   " you own search help.
      endif.
    Regards,
    Devi prasad

  • GL account balance not matching with the total stock value

    Hi,
    The GL account balance is not matching with the total stock value in report RM07MBSTfor stock in transit, Can anyone please let me know, where should, I look into to verify the reason for difference.
    Quick response will be appreciated.
    Thanks & Regards

    I am able to solve this issue. My client has a customized report, which helped me to look into the details of stock in tranisit account. Stock in transit account actually include PPV and TPV alongwith standard cost.

  • Query G/L Account Balances

    Can anyone help me determine which view to use in Oracle Financials to query the Actual G/L Account Balances?
    I have used "GLBV_ACTUAL_BALANCES" but my results are suspicious (I have one account that returns a balance, when there is no balance for that account when viewed inside of Oracle Financials).
    Thank you very much,
    Craig Tennant

    GL_BALANCES stores actual, budget, and encumbrance balances for detail and summary accounts.So pls try this table.
    Note that the column ACTUAL_FLAG is either ’A’, ’B’, or ’E’ for actual,budget,or encumbrance balances, respectively.

  • Query to Find Account Balances (Actual & Budgeted).

    Hi
    can any one suggest a query to list all GL (R12) Account (Segment2) Balances (Actual and Budgeted) for a given Enitity (Segment1) and Period.
    Some accounts have sub-accounts with Parent child relationship. List should include all child accounts where ever balances exist.
    or Pl. point me thread if it is already answered earlier in this forum.
    Thanks,
    T.
    Edited by: user13072694 on May 28, 2010 2:15 PM
    Edited by: user13072694 on May 28, 2010 2:19 PM
    Edited by: user13072694 on May 28, 2010 2:25 PM

    Hello.
    See if this query helps you:
    SELECT cc.segment2,
    nvl(sum(bal.begin_balance_dr + bal.period_net_dr - bal.begin_balance_cr - bal.period_net_cr),0) "Actual Balance",
    nvl(sum(balb.begin_balance_dr + balb.period_net_dr - balb.begin_balance_cr - balb.period_net_cr),0) "Budget Balance"
    FROM gl_balances bal, gl_balances balb, gl_code_combinations cc
    WHERE cc.code_combination_id = bal.code_combination_id
    AND balb.code_combination_id = cc.code_combination_id
    AND bal.set_of_books_id = <'your SOB id'>
    AND balb.set_of_books_id = <'your SOB id'>
    AND bal.period_name = <'your actual period name'>
    AND balb.period_name = <'your budget period_name'>
    AND bal.actual_flag = 'A'
    AND balb.actual_flag = 'B'
    AND bal.currency_code = <'you SOB currency code'>
    AND balb.currency_code = <'your SOB currency code'>
    GROUP by cc.segment2
    Hope this helps,
    Octavio

  • Query Account Balance Last Month

    Dear All,
    I need your help...I want to make query that show account balance AR at level 4 at end of month of last month. For example this month is March, so I want to show account balance AR at level 4 at end of month Feb.
    Thanks for your help
    Edited by: Ho  We I on Mar 3, 2009 3:47 AM

    Hi Ho,
    Try this out,
    SELECT SUM(Debit-Credit) as Balance from JDT1 WHERE RefDate <= [%0] and Account = [%1]
    Supply the first parameter with end date of the month and the second parameter with the account you want to check.
    Regardless which account you want to query (i wondered why you want to check AR balance by the account, you can get it from Customer Aging Report instead), you can use the query for any accounts
    Hope it helps.
    Cheers,
    Marini

  • Query Active account balance

    Hi Expert,
    Is it possible to get active account balance (by passing parameter using 'create date') thorugh Query.
    If possible post query.
    By,
    Kart

    Hi Gordon Du,
    This query may not correct, actually i need -Chart of accountwise
                                                        Balance
    such as 101010 - capital account = 200000
                 210101 - Bank account  =  100002
    SELECT T1.[AcctName],  T0.[LineMemo] Detail, T0.RefDate 'Posting Date', T0.TransId 'Transaction Number', T2.[AcctName] OffsetAccount, T0.[Debit], T0.[Credit], T0.[Ref1], T0.[Ref2], '0' Balance  FROM JDT1 T0  INNER JOIN OACT T1 ON T0.Account = T1.AcctCode INNER JOIN OACT T2 ON T0.[ContraAct] = T2.AcctCode WHERE (T1.[AcctName]  = '[%1]' or '[%1]' = '') and  (T0.[RefDate] >= '[%0]' or '[%0]' = '') and (T0.RefDate <= '[%2]' or '[%2]' = '')
    by
    kart

  • Currency conversion - Line item total does not tally with account balance

    hi guys!
    we are currently going through currency conversion in Zimbabwe and we are at preparation stage. i have got 3 issues:
    1. while trying to run program RFSEPA02 the following error is appearing-
       -Line item total does not tally with account balance
    2. i might need to retrieve some FI documents whic were archived. how do i retrieve archived documents
    3. i might also be required to delete(if its an option) some records so tha line item total will tally with account balance

    put a break-point @
    if t_balance_items_hw[] <> t_balance_account_hw[] or
         t_balance_items_tw[] <> t_balance_account_tw[].
        perform dequeue_account.
        message e099.
    *   Summe der Einzelposten stimmt nicht mit Kontensaldo überein. ->
      endif.
    endform.                               " CHECK_ACCOUNT_BALANCE_2
    and debug y it is getting the error.
    Short text
    Switch On Open Item Management by Changing Master Record
    Description
    This program activates open item (OI) management for a G/L account and makes the necessary changes to documents already posted. These are then displayed afterwards as open items. It does not process the open items any further. In reversed documents especially, it does not reenter clearing data in the document.
    Requirements
    No items can already be archived from this account.
    Caution: Company policy must be in place to ensure that this does not happen.
    Some G/L accounts cannot be managed on an open item basis, especially G/L accounts that are used in account determination for automatic transactions (for example, accounts set up for transactions MVA or VVA, or accounts which are posted to using posting keys set up for account type M).
    Caution: Before making any changes, check that the G/L account can really be managed on an open item basis. If necessary, contact your SAP consultant.
    The account must be blocked from posting since any new documents posted at the same time as converting documents and postings for this account would not be entered.
    Output
    When using the list log, each document that was changed is listed. In addition, the total of the changed BSIS/BSAS entries and the total of the changed documents is listed.
    Regards
    Prabhu
    Message was edited by: Prabhu Peram

  • There in my iTunes account balance and I can not buy any program from the store I do not know what problem I would like to help me

    There in my iTunes account balance and I can not buy any program from the store I do not know what problem I would like to help me

    I agree with gnome up there, more info is needed about what's happening

  • Account balance draining? Need help!

    This morning, I noticed my account balance was slowly draining, at about 5 cents per three seconds. When I checked my account activity, it says I've made a bunch of SMSs. The only way I found of stopping it was to turn airplane mode on. Is this something I did unknowingly to my phone, or is there a bigger problem?

    call customer service 1-888-294-6804  so they can fix this and maybe get your money put back into your account. Have you been using any data? Or are you in a roaming area?

  • I have just installed the latest version of iTunes, now I have no playlists. So I uninstalled and tried again, now I have no songs! Also my account balance has gone down by £5, which incedently happened the last time I installed an update. Please help

    I have just installed the latest version of iTunes version 11.1.5.5, now I have no playlists. So I uninstalled and tried again, now I have no songs also! Also my account balance has gone down by approx £5, which incedently happened the last time I installed an update. Please help

    See Empty/corrupt iTunes library after upgrade/crash.
    tt2

  • My account balance disaapeared, HELP!!

    Ok I got two gift cards and I entered them in and in the top right hand corner it said my acount was $30 (15 for each card) I went to download a song and all of a sudden my account balance disappeared. I tried to reenter the codes but it said they were already redeemed. THis is really irritating me. I emailed itunes support but is there a number I could call to get this resolved quicker. I feel like Im going to get screwed over on this one. I want my account balance back.

    iTunes support service finally responded to me, apparently, the account in which I redeemed the music cards was an apple account, but I thought it was an AOL account. I was confused because they said my apple account was "[email protected]" which to me was misleading because of the aol.com part. I don't know how it happened, but I guess apparently I had two accounts, one was an Apple account in which my account name was "[email protected]" and the AOL account was just "myscreename". But they confirmed that my Apple account has $30.00 of store credit on it, so I think everything will be ok. The reason the account balance disappeared was because when that box came up for me to type in my password I clicked on the AOL dot and signed into my AOL account. I really didn't have the slightest clue that I had both account and I don't know how it happened. Im not at my computer that has iTunes, so I hope when I get back to it, everything will be sorted out.

  • GL Account Balance Display Problem

    Hi SAP Gurus
    I am having the problem with the GL Account display.
    When I use the T.Code:FS10N to display the balance of the particular GL Account
    the total shows  one balance and if I go through Line item, it shows different amount.
    I request you to kindly reply to me why this difference occurs and due to what reason?
    Thanks with regards,
    Bala.

    Dear Bala,
    You can check the data (GL Account Balance) in database table GLT0 or write a query or report with logical datbase SDF and structures SKC1A / SKC1C
    Try to analyse if the the difference is in differnet currencies or different business areas.
    What report are you using for line item.
    RFSUSA00, RFSOPO00, or RFSSLD00.
    Also, visit the following thread:
    Problem regarding difference in FS10N and FBL3N
    Hope this will help.
    Regards,
    Naveen.

  • GL Account Balance Difference

    Hi All,
    We recieve GL Account Balances from some other system (different SAP landscape) and the balances in the file are compared to the GL Account Balances in our system. For this purpose, we are using a standard BAPI :->BAPI_GL_GETGLACCCURRENTBALANCE. This BAPI calculates the current GL Balance in our system and the program them matches both the balances (one in the coming feed and other calculated by the BAPI).
    Starting this year, the BAPI is not performing correctly. It only calculates the period balance and does not add the cumulative balance of the previous year and hence there is a difference in the GL Account Balances in both the system since the feed coming in contains the total balance till date (i.e. Period Balance + Cumulative balance of last year).
    Can somebody suggest another BAPI that adds both the Period Balance + Cumulative balance of last year for all the GL Accounts till date.
    Thanks,
    Gaurav

    Hi
    As the documentation for that BAPI showing the ending balance for the fiscal year. As you can see the balances for the B/S accounts only & if those balances carried forward to the current year - then it should show the total cumulative balance. Check whether balance carryforward program done or not.
    Below is the help :
    Short text
    Closing balance of G/L account for current year
    Functionality
    The method provides the ending balance of a G/L account for the current fiscal year.
    The user decides whether the balance should be provided in the transaction currency or the company code currency. Exceptions are G/L accounts kept in various transaction currencies. In this case, only the company code currency can be used.
    The system provides the balance and currency determined.
    VVr

  • GL account balance reports

    Hi all
    Can you please suggest a report which can give me following details for multiple GL accounts at a time
    a) Opening balance
    b) closing balance from beignning of the month to till date
    c) Closing balance from beginning of the year to till date
    We do not need details of total debit balance and total credit balance of the same GL account which most of the standard reports provide. We need a report just to show net balance of each GL account as on month end, year end along with opening balances.
    Any pointers on this would be helpful.
    Regards,
    Santosh

    Hi Santosh,
    You can get the report as you like in T.code FBL3N and check this T.code FS10N for Debit and Credit Balances.
    In FBL3N
    Opening balances
    closing balance from beignning of the month to till date
    Closing balance from beginning of the year to till date
    Debit and Credit Balances at FS10N
    May be this information is useful to you
    If you have any doubt feel free to ask
    Regards
    Surya

Maybe you are looking for

  • Error installing iTunes 10 on Windows 7 64 Bit

    I upgraded to Windows 7 from XP since I changed laptop. I did tried to install iTunes on this new machine (win 7 64 bit Corei7 processor and 4G RAM) but during the installation when the status screen states "Publising Product Information", I'm gettin

  • Logic Pro 8 gives me an error every time I shut it down

    Every time I shut down Logic Pro 8 I get an error message that says something like "Logic Pro crashed...". It DIDN'T crash, I shut it down. Is there something I should be doing BEFORE I shut it down? I do the normal stuff, like save things & then jus

  • Subse dr/cr and credit memo explanation

    hi, i got this from forum but i do not understand of the explanation on 'full amount and value'. can have example of the subsequent dr/cr on the $1 and credit memo full amount and value? Subsequent Debit/Credit is for the case when the credit is not

  • Importer une vidéo .avi sur premiere pro cs5?

    Bonjour, J'aimerais importer une vidéo que j'ai sous format .avi sur adobe première pro cs5, je n'y arrive pas et je ne sais pas pourquoi... voilà toutes les données que j'ai sur ma vidéo : AVI : 31,4 Mio, 55s 464ms 1 flux vidéo : AVC 1 flux audio :

  • Lost everything on iPhoto.  It's like I'm starting from scratch?

    Recently I upgraded to Yosemite.  I thought I had done an image back-up on from my iPhone on to iPhoto since, but I may not have.  Two nights ago I opened iPhoto to find everything had disappeared and I was seeing yellow sticky notes indicating that