AP Subledger Trial Balance query in R12

I have to display below columns in the output(AP Subledger Trial Balance) in R12:
GL_CODE_COMBINATIONS(Segment1,segment3,segment4)
GL_PERIODS(END_DATE)
XLA_TRIAL_BALANCES(remaining amount)
I have written a sql query but i need to satisfy below conditions in the below query. I am facing issues with the joins.can any one please help me to solve issue.
  ‘Accounting Period’ parameter needs to be added in the below query.
The sql query will generate the AP subledger balance data for the particular operating unit from where the report is run.
The report will give ‘at point in time’ data for the entire period for which the extract is run.
Example:
When the report is run on 01-Jul-2014 for the period ‘JUL-14′, then the report will extract all the data for JUL-14 at that point in time , i.e. the sysdate would be considered
SELECT gcc.segment1,
gcc.segment3,
gcc.segment4,
tb1.diff remaining_amount,
glp.end_date –join condition required
FROM gl_code_combinations gcc,
gl_periods glp,
(SELECT tb.code_combination_id,tb.ledger_id,
SUM (NVL (tb.acctd_rounded_cr, 0)),
SUM (NVL (tb.acctd_rounded_dr, 0)),
SUM (NVL (tb.acctd_rounded_cr, 0))
– SUM (NVL (tb.acctd_rounded_dr, 0)) diff,
tb.gl_date
FROM xla_trial_balances tb
WHERE tb.definition_code IN(‘XX_US’,’XX_CA’)
AND TRUNC(tb.gl_date) <= TRUNC(SYSDATE) –TO_DATE ('1-JUN-2014')
GROUP BY tb.code_combination_id,
tb.gl_date,tb.ledger_id
HAVING SUM (NVL (tb.acctd_rounded_cr, 0))
SUM (NVL (tb.acctd_rounded_dr, 0))) tb1
WHERE tb1.code_combination_id = gcc.code_combination_id
–Join condition required for gl_periods table to display end_date column.
–org_id and period_name parameters are required

Hi Vamsi,
I've recreated the standard oracle Trial balance package & XML file . Now i'm able to populate the data into custom table as well as standard table . But the report out doesn't show data in it . it just shows report title, columns bUT NO DATA. the xml file itself doesnt contain data. The custom report completes in 2 mins. But standard report completes in 7 mins
Steps
1. Create custom package similar to oracle standard package & added new insert statement to populate trial balance data into custom table.
2. created new datadefinition with new datatemplate(refering custom package) similar to oracle standard datatemplate.
3. create template same as standard template.
4. copy of standard conc program with custom application
5. Ran the report ...able to populate data into custom table .....but unable to see data in the report.
Please let me know if i'm missing anythng.

Similar Messages

  • Customize AP Trial Balance Report in R12.1.3

    Hi
    I have to customize AP Trial Balance Report in R12 Version 12.1.3.
    Can any one please provide some pointers how do we do it?
    Here is some background for AP Trial Balance Report:
    Its an XML Publisher Report with XDODTEXE Executable. XLAAPRPT.xml is the file uploaded to data definition(Code: APTBRPT) for Accounts Payable Trial Balance . XML template XDODTEXE calls oracle’ s seeded XML template “XLAAPRPT.xml ", this template further calls package XLA_TB_AP_REPORT_PVT for Trial balance.
    Our customiztion has to populate trial balance data in to our custom table instead of global temp table . XLA_TB_AP_REPORT_PVT package has a private procedure populate_trial_balance_gt which populates trial balance data into xla_trial_balances_GT.
    Please provide some ideas for customization of standard XML publisher reports in R12.1.3.
    Any ideas are appreciated.
    Thanks
    Theja R

    Hi Vamsi,
    I've recreated the standard oracle Trial balance package & XML file . Now i'm able to populate the data into custom table as well as standard table . But the report out doesn't show data in it . it just shows report title, columns bUT NO DATA. the xml file itself doesnt contain data. The custom report completes in 2 mins. But standard report completes in 7 mins
    Steps
    1. Create custom package similar to oracle standard package & added new insert statement to populate trial balance data into custom table.
    2. created new datadefinition with new datatemplate(refering custom package) similar to oracle standard datatemplate.
    3. create template same as standard template.
    4. copy of standard conc program with custom application
    5. Ran the report ...able to populate data into custom table .....but unable to see data in the report.
    Please let me know if i'm missing anythng.

  • AP Trial Balance Query.

    I'm trying to re-create the AP Trial Balance report so I can add additional info for the Accountants allowing them to analyze the data better.
    we are in R12.1.3
    Can any anyone provide query that gives the same data as 'Accounts Payable Trial Balance'.
    Please in urgent need....
    Gurus help me out...
    Thanks,
    Raj.

    Hi,
    Were u able to create customized version of AP trial balance report. Please provide somepointers if so.
    Thanks
    TR

  • RTF Template for AP Trial Balance Report   in R12

    Hi
    when i opened AP Trial Balance RTF Template (word doc) i see only the below statement & when i double clicked & open Form text field i see the Tag
    <?call-template:XLAAPRPT06?> Any idea where the actual template is stored? since i have to build new one i need to look at it for reference.
    Import Template XLAAPRPT06Call Template XLAAPRPT06
    Thanks
    Pravin

    You can navigate to 'Xml Publisher Administrator' responsibility --> Templates
    Give the code as 'XLAAPRPT06' and then 'Go'
    You will get a template, from where you can download the RTF document - XLAAPRPT06.rtf
    I've checked that the template is complete.
    Alternatively, you can read it from -
    select * -- file_date
    from apps.xdo_lobs
    where LOB_CODE = (select data_source_code
    from apps.xdo_templates_b
    where template_code = 'XLAAPRPT06');cheers,
    VB
    Edited by: VB on Oct 5, 2011 3:19 PM

  • SRKIM: R12: Accounts Payable Trial Balance issue troubleshoot

    Purpose
    R12 에서 AP Trial Balance Report 확인 시 데이터가 비정상적일 경우 check 해야 하는 내용에 대해 확인 해 보도록 한다.
    Question
    R12 에서 invoice 생성 후 gl 로 transfer 하였으나 ap trial balance report 의 데이터가 비정상적인 것으로 확인 된다.
    어떤 내용을 확인 해야 하는가.
    Answer
    1. APList Diagnostics Script 을 해당 invoice 에 대해 수행 하여 아래의 내용을 확인한다.
    - Accounting 이 생성되어 gl로 모두 transfer 되었는지 여부.
    - Accounting Date 가 Trial Balance Report 의 start date 와 as of date 안에 포함 되는지 여부
    2.위의 내용에 문제가 없다면 아래 sql 로 데이터를 확인 해 보도록 한다.
    select *
    from xla_trial_balances
    where source_entity_id in (
    select entity_id
    from xla.xla_transaction_entities xte
    where application_id = 200
    and (
    (entity_code = 'AP_INVOICES' and source_id_int_1 in (&invoice_id))
    OR
    applied_to_entity_id in (
    select entity_id
    from xla.xla_transaction_entities xte
    where application_id = 200
    and (
    (entity_code = 'AP_INVOICES' and source_id_int_1 in (&invoice_id))
    3.GL 에 실제 해당 데이터가 존재 하는지 아래 sql 로 확인 해 보도록 한다.
    SELECT distinct aeh.*
    FROM gl_je_lines gjl, GL_IMPORT_REFERENCES gir, gl_je_headers gjh, GL_JE_BATCHES gjb, XLA_AE_LINES
    ael,
    XLA_AE_HEADERS aeh, XLA_EVENTS aea, xla.xla_transaction_entities xte
    WHERE ael.gl_sl_link_id = gir.gl_sl_link_id
    and gjh.je_batch_id= gjb.je_batch_id
    and gjl.je_header_id = gjh.je_header_id
    and gjl.je_header_id = gir.je_header_id
    and gjl.je_line_num = gir.je_line_num
    AND gir.gl_sl_link_table in ('XLAJEL')
    and ael.gl_sl_link_table in ('XLAJEL')
    AND aea.application_id = 200
    AND aea.event_id = aeh.event_id
    AND aeh.ae_header_id = ael.ae_header_id
    AND gjb.je_batch_id = gir.je_batch_id
    and xte.application_id = 200
    and xte.entity_id = aea.entity_id
    and gjh.je_header_id = gir.je_header_id
    and gjh.je_source = 'Payables'
    and (
    (xte.entity_code = 'AP_PAYMENTS' and xte.source_id_int_1 = &check_id)
    OR
    (xte.entity_code = 'AP_INVOICES' and xte.source_id_int_1 = &invoice_id)
    SELECT distinct gjl.*
    FROM gl_je_lines gjl, GL_IMPORT_REFERENCES gir, gl_je_headers gjh, GL_JE_BATCHES gjb, XLA_AE_LINES
    ael,
    XLA_AE_HEADERS aeh, XLA_EVENTS aea, xla.xla_transaction_entities xte
    WHERE ael.gl_sl_link_id = gir.gl_sl_link_id
    and gjh.je_batch_id= gjb.je_batch_id
    and gjl.je_header_id = gjh.je_header_id
    and gjl.je_header_id = gir.je_header_id
    and gjl.je_line_num = gir.je_line_num
    AND gir.gl_sl_link_table in ('XLAJEL')
    and ael.gl_sl_link_table in ('XLAJEL')
    AND aea.application_id = 200
    AND aea.event_id = aeh.event_id
    AND aeh.ae_header_id = ael.ae_header_id
    AND gjb.je_batch_id = gir.je_batch_id
    and xte.application_id = 200
    and xte.entity_id = aea.entity_id
    and gjh.je_header_id = gir.je_header_id
    and gjh.je_source = 'Payables'
    and (
    (xte.entity_code = 'AP_PAYMENTS' and xte.source_id_int_1 = &check_id)
    OR
    (xte.entity_code = 'AP_INVOICES' and xte.source_id_int_1 = &invoice_id)
    4.위의 sql 을 통해 Trial Balance Table 의 데이타가 잘 못 생성 되었음이 확인 되면 해당 Trial balance table 의 데이타를 recreate 하는 작업을 수행 해야 한다.
    Reference
    Note. 553484.1 - THE R12 ACCOUNTS PAYABLE TRIAL BALANCE DATA IS
    INCORRECT/WRONG

    Follow the below steps and Run the Trial Blance and let me know if it helps.
    Thanks
    Girish
    How to Rebuild Trial Balance Data (repopulate XLA_TRIAL_BALANCES)
    1. Navigate: Payables Responsibility > Setup > Accounting Setups > Subledger Accounting Setups > Open Account Balances Listing Definitions
    2. Query up your Report Definition: select Defined By = Accounting Flexfield or Segment (whichever applies in your case), click “Go”
    3. Click on Update icon in the "Actions" column – the definition's update page opens.
    4. "Touch" the definition by simply clicking "Apply" button (without making any change).
    This should start the “Open Account Balances Data Manager” concurrent processes

  • What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10?

    Hi Guys,
    What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10?
    I have to write an AP Invoice Aging Report in Discoverer to show all unpaid invoices that have been transferred into GL... Business wants it to match one-to-one with the AP Trial Balance standard report...
    Business wants to run the report for any date in a past...
    The report has two parameters:
    As Of Date - the same as As of Date for the AP Trial Report
    Trial Balance Run Date - the date when Trial Balance was run...
    Conditions are:
    TRUNC(Invoice Date) <=TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    TRUNC(NVL(Payment Date,'01-JAN-5000')) > TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    TRUNC(Invoice Creation Date) <= TRUNC(NVL(TO_DATE(:Trial Balance Run Date),SYSDATE))
    Distr Accounting Date <= TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    NVL(Distr Creation Date,Invoice Creation Date) <= TRUNC(NVL(TO_DATE(:Trial Balance Run Date),SYSDATE))
    Show_Flag = 'YES', where:
    Show_Flag = CASE WHEN ( NVL(Cancelled Date,'01-JAN-1901') > NVL(:As Of Date,SYSDATE) AND NVL(Inv Amount Aud,0) = 0 ) THEN 'YES' ELSE ( CASE WHEN NVL(Inv Amount Aud,0) = 0 THEN 'NO' ELSE 'YES' END ) END
    There is a difference between the logic of my report, and the logic of AP Trial Balance...
    Could you please advise what I'm missing?
    Thanks,
    Iana

    What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10? You can get the code by opening the report in Reports Builder and get the query.
    Or, enable trace/debug as per (FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]).
    Thanks,
    Hussein

  • R12 AP Trial Balance definition cod

    Hi all,
    We are trying create a New/Copied definition as follow :
    Payables Responsibility > Setup > Accounting Setups > Subledger Accounting
    Setups > Open Account Balances Listing Definitions
    Query the Report Definition Code
    Note: To search for Report Definitions created by the upgrade, select Defined By = Accounting Flexfield.
    And upgraded report definitions are created by the apintbal.sql script during the upgrade with a definition code in the following format: AP_200_' || T.ledger_id
    When I am searching the definition code in the following format : AP_200_' || T.ledger_id which is AP_200_2021. I am not getting any results. The message was no record found.
    SELECT * 2 FROM XLA_TB_DEFINITIONS_B;
    DEFINITION_CODE OBJECT_VERSION_NUMBER LEDGER_ID E BALANCE_SIDE_CODE DEFINED_BY_CODE DEFINITION_STATUS_CODE CREATION_DATE CREATED_BY LAST_UPDATE_DATE LAST_UPDATED_BY LAST_UPDATE_LOGIN REQUEST_ID PROGRAM_APPLICATION_ID PROGRAM_ID PROGRAM_UPDATE_D OWNER_CODE
    PH_OPEN_BALANCES 1 2021 Y C SEGMENT CHANGED 22-02-2008 09:32 1130 22-02-2008 09:32 1130 46722 C
    1 row selected.
    Any idea?
    Thanks,
    Miguel.

    Hi Ramana
    Although the account code combination will be different but the natual account for liability will be fixed. As such the best option is to define by segment and not by accounting flexfield. So you select the type as Segment and select the segment as natural account. Then specify the liability accounts for which the trial balance is required.
    In case if at any point in time, a new natural account for liability is added to your chart of account segment value, then you need to come back to the defintion and update the same. Then rebuild the trial balance. But these scenarios are very rare to occur.
    Hope this helps.
    Thanks
    Vinit

  • R12 Accounts Payable Trial balance is reporting incorrectly (urgent)

    the trial balance is reporting penny amounts on invoices that are fully paid how do I correct this issue

    Follow the below steps and Run the Trial Blance and let me know if it helps.
    Thanks
    Girish
    How to Rebuild Trial Balance Data (repopulate XLA_TRIAL_BALANCES)
    1. Navigate: Payables Responsibility > Setup > Accounting Setups > Subledger Accounting Setups > Open Account Balances Listing Definitions
    2. Query up your Report Definition: select Defined By = Accounting Flexfield or Segment (whichever applies in your case), click “Go”
    3. Click on Update icon in the "Actions" column – the definition's update page opens.
    4. "Touch" the definition by simply clicking "Apply" button (without making any change).
    This should start the “Open Account Balances Data Manager” concurrent processes

  • R12 Trial Balance

    Hello All,
    I am trying to customize/recreate the trial balance insert statement in the XLA_TB-AP_REPORT_PVT package (R12.1.3). However, I am not able to figure out how the insert statement is constructed in the package (frankly not able to locate where it is).
    Can any one help me find it?
    Cheers,
    Monkey

    I ran the "Accounts Payable Trial Balance" detail report with the layout as: "Accounts Payable Trial Balance - Group by Account". The request completed ok...but there is no output file. Any one know why it does not produce an out put? In the log it says, that it inserted 1794278 rows in the GT table. However, when I look in the table xla_trial_balances_gt, it is empty)
    Pls. help. Totally lost
    Thanks,
    Monkey
    Edited by: OAF_Monkey on Feb 15, 2012 11:26 AM

  • R12(Payments)--Accounts Payable Trial Balance Report, Need Info.

    Hi All,
    We are trying to use the report Accounts Payable Trial Balance Report.
    This is an XML Report in R12 now and has 4 different RTF Templates.
    Can you please explain me how this report can be used in R12 and how does it selects the RTF template( from 4 different templates present) at run time.?
    Thanks,

    Hi,
    In 11i we use to have a parameter to give the report in Summary or Detail
    In R12 we have 4 options in templates to have Summary by Account, Summary by Supplier, Detail by Account and Detail by Supplier.
    Report will not select the template automatically. The user needs to select the template before submitting the report.
    Hope it helps
    Regards,
    Sridhar

  • GL Trial Balance Report Query with date Effectivity

    We have a requirement to show the GL Trial Balance report with Effective dates as Parameters.
    Current Analysis:
    The Journals get updated with corresponding CCID in GL_BALANCES table when the Journal is posted. GL_BALANCE is SOB specific, if the SOB has month as period then the balances in GL_BALANCES would get updated against the month(period).
    To overcome the period problem, we explored the option of using a View based on GL_JE_HEADERS and GL_JE_LINES for 'Posted' Journal Batches of a SOB. We are checking whether the GL_JE_HEADERS.default_effective_date lies between the :p_from_date and :p_to_date which is sent to the Report as a parameter. The above idea does not return expected data when the custom Trial Balance Report is run.
    Following is the Query we have written for it:
    SELECT cc.segment4 ACCOUNT, bal.code_combination_id,
    bal.begin_balance_dr
    + SUM (NVL (gljel.accounted_dr, 0)) opening_bal_dr,
    bal.begin_balance_cr
    + SUM (NVL (gljel.accounted_cr, 0)) opening_bal_cr,
    ffv.description,
    (SELECT SUM (NVL (gljel.accounted_dr, 0))
    FROM gl_je_headers gljeh,
    gl_je_lines gljel,
    gl_code_combinations gcc
    WHERE gljeh.default_effective_date BETWEEN :p_from_date
    AND :p_to_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.code_combination_id = gcc.code_combination_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND gljeh.actual_flag = 'A'
    --AND gljel.code_combination_id =
    -- bal.code_combination_id
    AND gcc.segment4 = cc.segment4
    GROUP BY gcc.segment4) c_dr,
    (SELECT SUM (NVL (gljel.accounted_cr, 0))
    FROM gl_je_headers gljeh,
    gl_je_lines gljel,
    gl_code_combinations gcc
    WHERE gljeh.default_effective_date BETWEEN :p_from_date
    AND :p_to_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.code_combination_id = gcc.code_combination_id
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND gljeh.actual_flag = 'A'
    AND gcc.segment4 = cc.segment4
    GROUP BY gcc.segment4) c_cr
    FROM gl_period_statuses per,
    gl_code_combinations cc,
    gl_balances bal,
    gl_je_headers gljeh,
    gl_je_lines gljel,
    fnd_flex_values_vl ffv,
    fnd_flex_value_sets ffvs
    WHERE cc.chart_of_accounts_id = :p_chart_of_accts_id
    AND bal.currency_code = :p_currency
    AND bal.actual_flag = 'A'
    AND bal.period_name = per.period_name
    AND cc.template_id IS NULL
    AND cc.code_combination_id = bal.code_combination_id
    AND per.set_of_books_id = :p_set_of_books_id
    AND per.application_id = 101
    AND :p_from_date BETWEEN per.start_date AND per.end_date
    AND gljeh.period_name = per.period_name
    AND gljeh.default_effective_date <= :p_from_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND ffv.flex_value_set_id = ffvs.flex_value_set_id
    AND ffvs.flex_value_set_name = 'JSWEL_ACCOUNT'
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND cc.summary_flag = ffv.summary_flag
    AND cc.segment4 = ffv.flex_value
    AND gljeh.actual_flag = 'A'
    AND gljel.code_combination_id = bal.code_combination_id
    GROUP BY bal.begin_balance_dr,
    bal.begin_balance_cr,
    cc.segment4,
    ffv.description,
    bal.code_combination_id
    The problem is that not all expected columns are being queried. Kindly advise as appropriate.
    Note: I have also posted this thread on the Financials forum. Posting here to present the query to a larger audience with the expectation that my query would be answered.
    Thanks & Regards
    Sumit

    suggest to create customize TB report.

  • AP Trial Balance R12

    Hi,
    We are using Automatic Offset option set to Natural Account.
    In R12 for AP Trial balance open balances template definition we need to give the liability account combinations. But, when we are using Automatic Offset we will be using new natural accounts every time. So, will these new Combinations will be automatically added to Open balances template or we need to add it manually.
    Or will these new account combinations will appear on Trial balance by default.
    Thank You,
    Ramana.

    Hi Ramana
    Although the account code combination will be different but the natual account for liability will be fixed. As such the best option is to define by segment and not by accounting flexfield. So you select the type as Segment and select the segment as natural account. Then specify the liability accounts for which the trial balance is required.
    In case if at any point in time, a new natural account for liability is added to your chart of account segment value, then you need to come back to the defintion and update the same. Then rebuild the trial balance. But these scenarios are very rare to occur.
    Hope this helps.
    Thanks
    Vinit

  • Query YTD Trial Balance

    Hello
    can any body help me in this query i need to get Ytd trial Balance
    /* Formatted on 2011/10/31 12:59 (Formatter Plus v4.8.8) */
    SELECT ACCOUNT, descacc, NVL (SUM (opening_balance), 0) opening_balance,
    NVL (SUM (debit), 0) debit, NVL (SUM (credit), 0) credit,
    NVL (SUM (ending_balance), 0) ending_balance, parent1, parent2,
    parent3, parent4, parent5, :from_date,:chartid,:TO_DATE
    FROM (SELECT m.segment5 ACCOUNT, w.description descacc,
    (NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
    ) opening_balance,
    NULL debit, NULL credit, NULL ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date < :from_date
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description
    UNION ALL
    (SELECT m.segment5 ACCOUNT, w.description descacc,
    NULL opening_balance, NVL (SUM (l.entered_dr), 0) debit,
    NVL (SUM (l.entered_cr), 0) credit, NULL ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date BETWEEN :from_date AND :TO_DATE
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description)
    UNION ALL
    (SELECT m.segment5 ACCOUNT, w.description descacc,
    NULL opening_balance, NULL debit, NULL credit,
    (NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
    ) ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date <= :TO_DATE
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description))
    GROUP BY ACCOUNT, descacc, parent1, parent2, parent3, parent4, parent5
    ORDER BY ACCOUNT,parent5
    thanks

    Kamlesh,
    Please note that this is a public forum and if members have something to share they would certainly reply your post.  Gordon has nothing to do with this.  If he has time like he usually does he may reply you with the query
    But I would think that you need to make an attempt and then post to the forum if you have questions.
    Good luck
    Suda

  • How can Get YTD in Trial Balance Custome In my query

    Hello
    can any body help me in this query i need to get Ytd trial Balance
    /* Formatted on 2011/10/31 12:59 (Formatter Plus v4.8.8) */
    SELECT ACCOUNT, descacc, NVL (SUM (opening_balance), 0) opening_balance,
    NVL (SUM (debit), 0) debit, NVL (SUM (credit), 0) credit,
    NVL (SUM (ending_balance), 0) ending_balance, parent1, parent2,
    parent3, parent4, parent5, :from_date,:chartid,:TO_DATE
    FROM (SELECT m.segment5 ACCOUNT, w.description descacc,
    (NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
    ) opening_balance,
    NULL debit, NULL credit, NULL ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date < :from_date
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description
    UNION ALL
    (SELECT m.segment5 ACCOUNT, w.description descacc,
    NULL opening_balance, NVL (SUM (l.entered_dr), 0) debit,
    NVL (SUM (l.entered_cr), 0) credit, NULL ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date BETWEEN :from_date AND :TO_DATE
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description)
    UNION ALL
    (SELECT m.segment5 ACCOUNT, w.description descacc,
    NULL opening_balance, NULL debit, NULL credit,
    (NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
    ) ending_balance,
    SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
    SUBSTR (m.segment5, 1, 2) || '000000' parent2,
    SUBSTR (m.segment5, 1, 3) || '00000' parent3,
    SUBSTR (m.segment5, 1, 4) || '0000' parent4,
    SUBSTR (m.segment5, 1, 5) || '000' parent5
    FROM gl_code_combinations m,
    gl_je_batches c,
    gl_je_categories n,
    gl_je_headers h,
    gl_je_lines l,
    gl_ledgers t,
    fnd_flex_values_vl w
    WHERE h.default_effective_date <= :TO_DATE
    AND m.chart_of_accounts_id = :chartid
    AND h.je_header_id = l.je_header_id
    AND h.je_batch_id = c.je_batch_id
    AND l.code_combination_id = m.code_combination_id
    AND m.chart_of_accounts_id = t.chart_of_accounts_id
    AND h.currency_code IN 'SAR'
    AND l.ledger_id = t.ledger_id
    AND h.je_category = n.je_category_name
    AND h.status = 'P'
    AND w.flex_value = m.segment5
    AND w.flex_value_set_id = 1014551
    GROUP BY m.segment5, w.description))
    GROUP BY ACCOUNT, descacc, parent1, parent2, parent3, parent4, parent5
    ORDER BY ACCOUNT,parent5
    thanks

    Thanks a lot for your reply.
    I think I should have a database as a service trial.
    I can't find service instance in my service.
    I want to connect it by java application, but I can't get the service instance name.
    Could you please tell me how to get the service instance?
    Thanks a lot,
    Amanda

  • AP Trial Balance Report Query

    Hi - We use the AP Trial Balance Report as a supporting schedule to reconcile our General Ledger AP Creditor Control Account against.
    Ordinarily we would use the total remaining amount at the end of the report (which has historically balanced to the GL).
    The value in the remaining amount column has always equalled the value in the amount column.
    However, during P12 when we have generated the report we have identified several transactions that have an amount appearing in the 'remaining amount' column but no corresponding entry in the 'amount' column.
    We're not sure what the 2 column represent and why this would be the case.
    Consequently by using the 'Remaining Amount' total and comparing it to the GL balance we are out by the amounts that are only appearing on one side of the AP Trial Balance.
    I've looked at the accounting postings on the AP for some of the particualr records and can see that there is a debit and credit posting to expenditure that net off and and also a debit and credit posting to the AP Creditor Control Account that also net off
    Can anyone provide us with an explantion please?

    Hi,
    Please check note:553484.1, there are some queries provided to check the TB data like queries to compare XLA and GL data.
    Hope it helps

Maybe you are looking for