Gl_je_lines and mtl_transaction_accounts

Hi,
Can somebody help me out making joins between the following 3 tables:
gl_je_lines
, mtl_transaction_accounts
, mtl_material_transactions
Basically, I want to track back from gl_je_lines to mtl_material_transactions
How does gl_je_lines.code_combination_id join with mtl_material_transactions ?
is the following join proper?
gjl.code_combination_id = mta.reference_account
Thanks.
P.S. do I need to used gl_import_references table for joining them?
Message was edited by:
Devang Thakkar

First, you need to look at the mapplets/mappings (or DAC) to see source tables (usually a mapplet with a "mplt_BC" prefix). In this case, it extracts for several tables. In R1212 Adaptor it includes the following: RA_SALESREPS_ALL, OE_ORDER_LINES_ALL, OE_ORDER_HEADERS_ALL, MTL_TRANSACTION_ACCOUNTS, MTL_MATERIAL_TRANSACTIONS, HZ_CUST_SITE_USES_ALL, and GL_LEDGERS.
With regard to why it uses both MTL_MATERIAL_TRANSACTIONS and MTL_TRANSACTION_ACCOUNTS tables...the TRANSACTION table holds the accounting details for each transaction in MATERIAL. This accounting detail is used to form the joins to the associated accounting dimensions such as W_GL_ACCOUNT_D etc.
if this helps, please mark as correct or helpful.

Similar Messages

  • How to make relation between  gl_je_lines  and wip_transaction_accounts

    I try to write script to make relation between GL and WIP, wip_transaction_accounts and mtl_material_transactions
    1.
    SELECT
    (SELECT meaning
    FROM mfg_lookups
    WHERE lookup_type = 'WIP_TRANSACTION_TYPE'
    AND lookup_code =
    (SELECT TRANSACTION_TYPE
    FROM wip_transactions
    WHERE transaction_id = wta.transaction_id
    ) "Transaction Type" ,
    gjb.NAME "Journal Batch Name" ,
    gjh.NAME "Journal Name" ,
    gjh.je_source "JE Source" ,
    gjh.je_category "JE Category" ,
    glp.period_num "GL Month" ,
    glp.period_year "GL Year" ,
    gjh.default_effective_date "GL Date" ,
    NVL(gje.accounted_dr,0) -NVL( gje.accounted_cr,0) "GL Line Amount" ,
    gje.description "GL Line Description" ,
    (SELECT organization_code
    FROM mtl_parameters
    WHERE organization_id = wta.organization_id
    ) "ORG Name" ,
    NULL "Vendor/Customer Name" ,
    NULL "SO/PO Number" ,
    NULL "Reference Number" ,
    NULL "AP/AR Invoice Number" ,
    NULL "Doc Sequence Value" ,
    NULL "Invoice Type Lookup Code" ,
    NULL "Check Number" ,
    NULL "Line Type" ,
    NULL "Category" ,
    NVL (wta.base_transaction_value, 0) "Transaction Amt" ,
    NULL "AR/PO Receipt Number" ,
    NULL "Applied Invoice Number" ,
    (SELECT a.segment1
    FROM mtl_system_items_b a ,
    wip_discrete_jobs b
    WHERE a.inventory_item_id = b.primary_item_id
    AND a.organization_id = b.organization_id
    AND b.wip_entity_id = wta.wip_entity_id
    AND b.organization_id = wta.organization_id
    ) "Item Name" ,
    gcc.segment1 "Company" ,
    gcc.segment2 "Department" ,
    gcc.segment3 "Account" ,
    (SELECT description
    FROM fnd_flex_values_vl fnd
    WHERE flex_value_set_id = 1009707
    AND TO_CHAR (fnd.flex_value) = gcc.segment3
    ) "Account Description" ,
    gcc.segment4 "Intercompany" ,
    NULL "JE Category Description" ,
    NULL "AP Invoice Line Description"
    TRUNC (wta.transaction_date) "JE Creation/Inv Trans Date" ,
    NULL "JE Created By" ,
    NULL "Reversal Flag" ,
    NULL "Reason Code" ,
    NULL "Subinventory Name" ,
    wta.primary_quantity "Quantity" ,
    NVL (wta.base_transaction_value, 0) "Value" ,
    gje.context ,
    gje.attribute1 ,
    gje.attribute2 ,
    gje.attribute3 ,
    gje.attribute4 ,
    gje.attribute5 ,
    DECODE(gjh.status,'P','Posted','U','Unposted','Error') "Post Status"
    FROM gl_je_lines gje ,
    gl_je_headers gjh ,
    gl_je_batches gjb ,
    wip_transaction_accounts wta ,
    gl_code_combinations gcc ,
    gl_periods glp
    WHERE 1 =1
    AND gje.je_header_id = gjh.je_header_id
    AND gjh.je_batch_id = gjb.je_batch_id
    AND UPPER (gjh.je_source) = 'INVENTORY'
    AND gcc.code_combination_id = gje.code_combination_id
    AND wta.reference_account = gje.code_combination_id
    AND TRUNC(wta.transaction_date) BETWEEN glp.START_DATE AND glp.END_DATE
    AND gje.reference_1 = wta.gl_batch_id
    AND gje.gl_sl_link_table = 'WTA'
    AND glp.period_name = gjh.period_name
    AND glp.period_set_name = 'OVT_US_CAL'
    ==
    2.
    SELECT mtt.transaction_type_name "Transaction Type" ,to_char(mmt.transaction_date,'mm/dd/yyyy hh:mi:ss') as teas, mta.transaction_id,mta.organization_id, mmt.organization_id,
    gjb.NAME "Journal Batch Name" ,
    gjh.NAME "Journal Name" ,
    gjh.je_source "JE Source" ,
    gjh.je_category "JE Category" ,
    glp.period_num "GL Month" ,
    glp.period_year "GL Year" ,
    gjh.default_effective_date "GL Date" ,
    NVL(gje.accounted_dr,0) - NVL(gje.accounted_cr,0) "GL Line Amount" ,
    gje.description "GL Line Description" ,
    (SELECT organization_code
    FROM mtl_parameters
    WHERE organization_id = mta.organization_id
    ) "ORG Name" ,
    NULL "Vendor/Customer Name" ,
    NULL "SO/PO Number" ,
    mmt.TRANSACTION_REFERENCE "Reference Number" ,
    NULL "AP/AR Invoice Number" ,
    NULL "Doc Sequence Value" ,
    NULL "Invoice Type Lookup Code" ,
    NULL "Check Number" ,
    NULL "Line Type" ,
    NULL "Category" ,
    NVL (mta.base_transaction_value, 0) "Transaction Amt" ,
    NULL "AR/PO Receipt Number" ,
    NULL "Applied Invoice Number" ,
    (SELECT segment1
    FROM mtl_system_items_b
    WHERE inventory_item_id = mmt.inventory_item_id
    AND organization_id = mmt.organization_id
    ) "Item Name" ,
    gcc.segment1 "Company" ,
    gcc.segment2 "Department" ,
    gcc.segment3 "Account" ,
    (SELECT description
    FROM fnd_flex_values_vl fnd
    WHERE flex_value_set_id = 1009707
    AND TO_CHAR (fnd.flex_value) = gcc.segment3
    ) "Account Description" ,
    gcc.segment4 "Intercompany" ,
    NULL "JE Category Description" ,
    NULL "AP Invoice Line Description"
    TRUNC (mta.transaction_date) "JE Creation/Inv Trans Date" ,
    NULL "JE Created By" ,
    NULL "Reversal Flag" ,
    (SELECT MGD.SEGMENT1
    FROM MTL_GENERIC_DISPOSITIONS MGD,
    MTL_MATERIAL_TRANSACTIONS MMTT
    WHERE MGD.DISPOSITION_ID = MMTT.TRANSACTION_SOURCE_ID
    AND MMTT.TRANSACTION_SOURCE_TYPE_ID = 6
    AND MGD.ORGANIZATION_ID = MMTT.ORGANIZATION_ID
    AND MMTT.TRANSACTION_ID = MMT.TRANSACTION_ID
    ) "Reason Code" ,
    mmt.SUBINVENTORY_CODE "Subinventory Name" ,
    mta.primary_quantity "Quantity" ,
    NVL (mta.base_transaction_value, 0) "Value" ,
    gje.context ,
    gje.attribute1 ,
    gje.attribute2 ,
    gje.attribute3 ,
    gje.attribute4 ,
    gje.attribute5 ,
    DECODE(gjh.status,'P','Posted','U','Unposted','Error') "Post Status" -
    FROM gl_je_lines gje ,
    gl_je_headers gjh ,
    gl_je_batches gjb ,
    mtl_transaction_accounts mta ,
    mtl_material_transactions mmt ,
    mtl_transaction_types mtt ,
    gl_code_combinations gcc ,
    gl_periods glp
    WHERE 1 =1
    AND mta.transaction_id = mmt.transaction_id
    AND gje.je_header_id = gjh.je_header_id
    AND gjh.je_batch_id = gjb.je_batch_id
    AND UPPER (gjh.je_source) = 'INVENTORY'
    AND gcc.code_combination_id = gje.code_combination_id
    AND mta.reference_account = gje.code_combination_id
    AND TRUNC(mta.transaction_date) BETWEEN glp.START_DATE AND glp.END_DATE
    and mta.request_id=mmt.request_id
    and mta.inventory_item_id=mmt.inventory_item_id
    AND gje.reference_1 = mta.gl_batch_id
    AND gje.gl_sl_link_table = 'MTA'
    AND mtt.transaction_type_id = mmt.transaction_type_id
    AND glp.period_name = gjh.period_name
    AND glp.period_set_name = 'OVT_US_CAL'
    When gl_je_lines have multiple line this script on the same transaction_id it will get wrong information. By setup all wip_transaction_accounts.GL_SL_Lind_id and mtl_transaction_accounts.GL_SL_Lind_id is null
    Anyone can help?

    Hello.
    How are you reaching the inconsistencies ? Are you comparing report's results?
    Octavio

  • Best way to link GL and AP tables in R12

    In R11 I can link the gl_je_lines and the PO tables via the ap_invoice_distributions_all, In R12 I apparently need to add an extra step and link the GL tables to the XLA table then the ap_invoice_distributions_all. I have seen many ways to do this on line, are there any guidelines or advice on the best practice most efficient way of performing this join?

    >
    are there any guidelines or advice on the best practice most efficient way of performing this join?
    >
    based on business requirements
    btw used
    invoice->sla->gl for r12
    if you need track for invoice
    Re: how to track invoices transfered to gl - Re: how to track invoices transfered to gl

  • Join between gl_import_references and ap_invoice_distributions_all in R12

    Please advice me how to join gl_import_references and ap_invoices_distribution_all in R12. I have understanding of join between gl_import_references and ap_invoices_all, but I am not clear how to join ap_invoice_distriutions_all to gl_import_references.
    Thanks

    Hi,
    we don't have direct link for GL_JE_LINES and AP_INVOICE_DISTRIBUTIONS_ALL.
    First join AP_INVOICE_DISTRIBUTIONS_ALL and GL_CODE_COMBINATIONS then link to GL_JE_LINES.
    Please see below eg:
    SELECT *
    FROM gl_code_combinations gcc,
    ap_invoice_distributions_all apd,
    gl_je_lines gjl
    WHERE gcc.code_combination_id = apd.dist_code_combination_id
    AND gcc.code_combination_id = gjl.code_combination_id;
    your case use apd.dist_code_combination_id instead of apd.po_distribution_id (>
    and apd.po_distribution_id = GJL.CODE_COMBINATION_ID Add -----------Problem here-----------)
    I hope this will help to you.
    Thanks,
    Prasad Raju

  • Is there way to transfer invoice and supplier number to GL?

    We just upgraded to release 12.1.2. We transfer AP to GL in detail mode. In 11i, system use to store invoice number, supplier info in reference field. Reference fields in R12 store ae_header_id,line number etc. Is there a way to setup SLA to transfer invoice and supplier info to journal line?
    Thanks,
    Anjula

    Hi,
    We would also like to do the same through Discoverer. We have a report which looks at GL_JE_LINES and previously (11i) it used to pick up supplier name but this is no longer the case in R12. Does anyone know which tables would need to be joined in R12 to achieve this?
    Thanks
    Lisa

  • Project ID to GL_JE_Line

    Is there a SQL statement to tie the Project ID to a record in GL_JE_Line.
    Thanks

    Hi,
    he way I reconcile Projects to GL is to write a SQL query using the link between the journal lines table (gl_je_lines) and the cost distribution lines table (pa_cost_distribution_lines). The batch name in the cost dist. table equals reference_1 in the journal lines table. I also link the ccid in the journal lines table to the dr_code_combination_id (for the debit side)in the cost dist. table. This gives me the project, task, expenditure type detail for each journal line in a given journal entry.
    Thanks!

  • Query taking too long to execute after clone

    Hi All,
    We have a query which is working fine in our development environment and taking around 15 secs to execute the query. When we run the same query with same parameters in a recently cloned instance, the query is taking 1200 secs to execute.
    Please help us on this issue.
    Thanks,
    Raghava

    Hi All,
    I have 4 unions in my query. individual sqls are running in very less time. But when i use all of them in UNION then im getting performance issue. Below is my query:
    SELECT /*+ parallel(xla_l) parallel(xla_h) leading(xla_h) */
    XLA_L.code_combination_id,
    gl.name,
    fnd_flex_ext.get_segs('SQLGL', 'GL#', gl.chart_of_accounts_id, xla_l.code_combination_id) ACCOUNT,
    xla_oa_functions_pkg.get_ccid_description (gl.chart_of_accounts_id, xla_l.code_combination_id) account_description ,
    xla_h.accounting_date,
    XLA_L.accounting_class_code,
    NVL(lk7.meaning, xla_l.accounting_class_code) accounting_class,
    xla_h.entity_id,
    xla_h.event_type_code,
    et.event_class_code,
    bud.budget_name,
    xla_h.ledger_id,
    xla_l.entered_dr,
    xla_l.entered_cr,
    te.ledger_id trx_ledger_id,
    te.legal_entity_id,
    et.entity_code,
    te.source_id_int_1,
    te.source_id_int_2,
    te.source_id_int_3,
    te.source_id_int_4,
    te.source_id_char_1,
    te.source_id_char_2,
    te.source_id_char_3,
    te.source_id_char_4,
    te.security_id_int_1,
    te.security_id_int_2,
    te.security_id_int_3,
    te.security_id_char_1,
    te.security_id_char_2,
    te.security_id_char_3,
    te.valuation_method,
    xla_h.application_id,
    xs.drilldown_procedure_name,
    GL_CUSTOM_DRILL_DOWN.get_trx_description(te.source_id_int_1,et.entity_code) description,
    null fleet_number,
    null Vendor_Name,
    xs.je_source_name JournalSource,
    xla_h.je_category_name JournalCategory,
    XLA_L.AE_LINE_NUM Line
    FROM xla.xla_ae_lines XLA_L,
    xla.xla_ae_headers xla_h,
    xla_gl_ledgers_v gl ,
    xla_lookups lk5 ,
    xla_lookups lk7,
    xla.xla_events xla_e ,
    xla.xla_event_types_tl et ,
    xla.xla_event_classes_tl ec ,
    xla.xla_transaction_entities te,
    gl_budget_versions bud ,
    --gl_import_references ir,
    xla.xla_subledgers xs
    --gl_je_lines gl_l
    where
    --ir.gl_sl_link_id=XLA_L.gl_sl_link_id
    --and ir.gl_sl_link_table=XLA_L.gl_sl_link_table
    --and gl.ledger_id       = xla_h.ledger_id
    --AND
    xla_h.ae_header_id = xla_l.ae_header_id
    AND xla_h.application_id = xla_l.application_id
    AND lk7.lookup_code(+) = xla_l.accounting_class_code
    AND lk7.lookup_type(+) = 'XLA_ACCOUNTING_CLASS'
    AND xla_e.event_id = xla_h.event_id
    AND xla_e.application_id = xla_h.application_id
    AND xs.application_id =xla_h.application_id
    AND te.entity_id =xla_h.entity_id
    AND te.application_id =xla_l.application_id --xla_h.application_id
    AND ec.application_id = et.application_id
    AND ec.entity_code = et.entity_code
    AND ec.event_class_code = et.event_class_code
    AND ec.language = USERENV('LANG')
    AND et.application_id = xla_h.application_id
    AND et.event_type_code = xla_h.event_type_code
    AND et.language = USERENV('LANG')
    AND lk5.lookup_code = NVL(xla_h.funds_status_code, 'REQUIRED')
    AND lk5.lookup_type = 'XLA_FUNDS_STATUS'
    AND bud.budget_version_id(+) = xla_h.budget_version_id
    and xs.je_source_name != 'Cost Management'
    and (xla_l.gl_sl_link_id,xla_l.gl_sl_link_table) in (select ir.gl_sl_link_id, ir.gl_sl_link_table from
    gl_import_references ir,
    gl_je_lines gl_l
    where ir.je_header_id = gl_l.je_header_id
    and gl_l.je_line_num=ir.je_line_num
    and gl_l.period_name =NVL(:1,gl_l.period_name)
    and gl_l.code_combination_id =:2)
    UNION
    SELECT
    lines.code_combination_id LINE_CODE_COMBINATION_ID,
    lr.target_ledger_name LEDGER_NAME,
    fnd_flex_ext.get_segs('SQLGL', 'GL#', b.chart_of_accounts_id, lines.code_combination_id) ACCOUNT,
    xla_oa_functions_pkg.get_ccid_description (b.chart_of_accounts_id, lines.code_combination_id) account_description,
    h.date_created,
    null,
    null,
    null,
    null,
    null,
    null,
    h.ledger_id LEDGER_ID,
    lines.entered_dr LINE_ENTERED_DR,
    lines.entered_cr LINE_ENTERED_CR,
    lines.ledger_id LINE_LEDGER_ID,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    lines.description LINE_DESCRIPTION,
    null FLEET_NUMBER,
    null Vendor_Name,
    h.je_source JournalSource,
    h.je_category JournalCategory,
    lines.JE_LINE_NUM Line
    FROM gl_period_statuses ps,
    gl_je_lines lines,
    gl_je_headers h,
    gl_je_batches b,
    gl_ledger_relationships lr
    WHERE lr.source_ledger_id = lr.target_ledger_id
    --AND lr.target_currency_code = DECODE ( GLR03300_pkg.get_ledger_currency, 'ALL123456789012345', lr.target_currency_code, GLR03300_pkg.get_ledger_currency )
    AND lr.application_id = 101
    AND b.average_journal_flag = 'N'
    AND b.je_batch_id = h.je_batch_id
    AND b.actual_flag = 'A'
    AND h.je_header_id = lines.je_header_id
    AND h.currency_code = DECODE ( GLR03300_PKG.get_entered_currency_code, 'ALL123456789012345', h.currency_code, NULL, h.currency_code, GLR03300_pkg.get_entered_currency_code )
    AND h.ledger_id = lr.source_ledger_id
    AND lines.period_name = ps.period_name
    and lines.period_name = NVL(:3,lines.period_name)
    AND ps.ledger_id = lines.ledger_id
    AND ps.application_id = 101
    AND lines.code_combination_id=:4
    AND h.je_source != 'Cost Management'
    UNION
    SELECT /*+ parallel(xla_l) parallel(xla_h) leading(xla_h) */ gl_l.code_combination_id LINE_CODE_COMBINATION_ID,
    gl.name,
    fnd_flex_ext.get_segs('SQLGL', 'GL#', gl.chart_of_accounts_id, xla_l.code_combination_id) ACCOUNT,
    xla_oa_functions_pkg.get_ccid_description (gl.chart_of_accounts_id, xla_l.code_combination_id) account_description,
    xla_h.accounting_date,--gjh.date_created,
    XLA_L.accounting_class_code,
    NVL(lk7.meaning, xla_l.accounting_class_code) accounting_class,
    null,
    null,
    null,
    null,
    xla_h.ledger_id LEDGER_ID,
    NVL(xla_l.entered_dr,0) LINE_ENTERED_DR,
    NVL(xla_l.entered_cr,0) LINE_ENTERED_CR,
    te.ledger_id trx_ledger_id,
    te.legal_entity_id,
    et.entity_code,
    te.source_id_int_1,
    te.source_id_int_2,
    te.source_id_int_3,
    te.source_id_int_4,
    te.source_id_char_1,
    te.source_id_char_2,
    te.source_id_char_3,
    te.source_id_char_4,
    te.security_id_int_1,
    te.security_id_int_2,
    te.security_id_int_3,
    te.security_id_char_1,
    te.security_id_char_2,
    te.security_id_char_3,
    te.valuation_method,
    xla_h.application_id,
    xs.drilldown_procedure_name,
    GL_CUSTOM_DRILL_DOWN.get_trx_description(te.source_id_int_1,et.entity_code) description,-- gl_l.description LINE_DESCRIPTION,
    cii.instance_number FLEET_NUMBER,
    (select a.vendor_name
    from RCV_VRC_TXS_VENDINT_V a
    where a.wip_entity_id = mmt.TRANSACTION_SOURCE_ID
    AND a.organization_id = mmt.organization_id
    and a.item_id = mmt.inventory_item_id) Vendor_Name,
    xs.je_source_name JournalSource,
    xla_h.je_category_name JournalCategory,
    gl_l.JE_LINE_NUM Line
    FROM xla.xla_ae_lines XLA_L,
    xla.xla_ae_headers xla_h,
    xla_gl_ledgers_v gl ,
    xla_lookups lk5,
    xla_lookups lk7,
    xla.xla_events xla_e ,
    xla.xla_event_types_tl et,
    xla.xla_event_classes_tl ec,
    xla.xla_transaction_entities te,
    gl_budget_versions bud,
    gl_import_references ir,
    xla.xla_subledgers xs,
    gl_je_lines gl_l,
    mtl_transaction_accounts mta,
    XLA_TRANSACTION_ENTITIES_upg xte,
    xla_distribution_links xdl,
    mtl_material_transactions mmt,
    WIP_ENTITIES WIE,
    WIP_DISCRETE_JOBS WDJ,
    csi_item_instances CII
    where
    ir.gl_sl_link_id=XLA_L.gl_sl_link_id
    and ir.je_header_id = gl_l.je_header_id
    and gl_l.je_line_num=ir.je_line_num
    and ir.gl_sl_link_table=XLA_L.gl_sl_link_table
    and gl_l.period_name =NVL(:5,gl_l.period_name)
    and gl_l.code_combination_id = :6
    and xla_h.ae_header_id = xla_l.ae_header_id
    AND xla_h.application_id = xla_l.application_id
    AND lk7.lookup_code(+) = xla_l.accounting_class_code
    AND lk7.lookup_type(+) = 'XLA_ACCOUNTING_CLASS'
    AND xla_e.event_id = xla_h.event_id
    AND xla_e.application_id = xla_h.application_id
    AND xs.application_id =xla_h.application_id
    AND te.entity_id =xla_h.entity_id
    AND te.application_id =xla_l.application_id --xla_h.application_id
    AND ec.application_id = et.application_id
    AND ec.entity_code = et.entity_code
    AND ec.event_class_code = et.event_class_code
    AND ec.language = USERENV('LANG')
    AND et.application_id = xla_h.application_id
    AND et.event_type_code = xla_h.event_type_code
    AND et.language = USERENV('LANG')
    AND lk5.lookup_code = NVL(xla_h.funds_status_code, 'REQUIRED')
    AND lk5.lookup_type = 'XLA_FUNDS_STATUS'
    AND bud.budget_version_id(+) = xla_h.budget_version_id
    AND mta.reference_account = gl_l.code_combination_id
    AND mmt.transaction_id = mta.transaction_id
    and mta.transaction_id = xte.source_id_int_1
    AND mta.inventory_item_id =mmt.inventory_item_id
    AND mta.organization_id = mmt.organization_id
    AND mmt.transaction_type_id = 35
    and xte.entity_id = xla_e.entity_id
    and xdl.source_distribution_type = 'MTL_TRANSACTION_ACCOUNTS'
    and xdl.source_distribution_id_num_1 = mta.inv_sub_ledger_id
    and xdl.APPLICATION_ID=707
    and xla_h.ae_header_id = xdl.ae_header_id
    and xdl.ae_header_id = XLA_L.ae_header_id
    and ir.gl_sl_link_table = 'XLAJEL'
    and ir.gl_sl_link_id = XLA_L.gl_sl_link_id
    and gl_l.je_header_id = ir.je_header_id
    and gl_l.je_line_num = ir.je_line_num
    and mmt.TRANSACTION_SOURCE_ID = wie.wip_entity_id
    AND mmt.organization_id = wdj.organization_id
    and wie.wip_entity_id = wdj.wip_entity_id
    and wdj.asset_group_id = cii.inventory_item_id
    and wdj.maintenance_object_id=cii.instance_id
    and xs.je_source_name = 'Cost Management'
    UNION
    SELECT /*+ parallel(XLA_L) parallel(xla_h) leading(xla_h) */ gl_l.code_combination_id LINE_CODE_COMBINATION_ID,
    gl.name,
    fnd_flex_ext.get_segs('SQLGL', 'GL#', gl.chart_of_accounts_id, xla_l.code_combination_id) ACCOUNT,
    xla_oa_functions_pkg.get_ccid_description (gl.chart_of_accounts_id, xla_l.code_combination_id) account_description,
    xla_h.accounting_date,--gjh.date_created,
    XLA_L.accounting_class_code,
    NVL(lk7.meaning, xla_l.accounting_class_code) accounting_class,
    null,
    null,
    null,
    null,
    xla_h.ledger_id LEDGER_ID,
    NVL(xla_l.entered_dr,0) LINE_ENTERED_DR,
    NVL(xla_l.entered_cr,0) LINE_ENTERED_CR,
    te.ledger_id trx_ledger_id,
    te.legal_entity_id,
    et.entity_code,
    te.source_id_int_1,
    te.source_id_int_2,
    te.source_id_int_3,
    te.source_id_int_4,
    te.source_id_char_1,
    te.source_id_char_2,
    te.source_id_char_3,
    te.source_id_char_4,
    te.security_id_int_1,
    te.security_id_int_2,
    te.security_id_int_3,
    te.security_id_char_1,
    te.security_id_char_2,
    te.security_id_char_3,
    te.valuation_method,
    xla_h.application_id,
    xs.drilldown_procedure_name,
    GL_CUSTOM_DRILL_DOWN.get_trx_description(te.source_id_int_1,et.entity_code) description,-- gl_l.description LINE_DESCRIPTION,
    cii.instance_number FLEET_NUMBER,
    (select a.vendor_name
    from RCV_VRC_TXS_VENDINT_V a
    where a.wip_entity_id = wta.wip_entity_id
    AND a.organization_id = wta.organization_id
    and a.item_id = cii.inventory_item_id) Vendor_Name,
    xs.je_source_name JournalSource,
    xla_h.je_category_name JournalCategory,
    gl_l.JE_LINE_NUM Line
    FROM xla.xla_ae_lines XLA_L,
    xla.xla_ae_headers xla_h,
    xla_gl_ledgers_v gl ,
    xla_lookups lk5,
    xla_lookups lk7,
    xla.xla_events xla_e ,
    xla.xla_event_types_tl et,
    xla.xla_event_classes_tl ec,
    xla.xla_transaction_entities te,
    gl_budget_versions bud,
    gl_import_references ir,
    xla.xla_subledgers xs,
    gl_je_lines gl_l,
    wip_transaction_accounts wta,
    XLA_TRANSACTION_ENTITIES_upg xte,
    xla_distribution_links xdl,
    -- mtl_material_transactions mmt,
    WIP_ENTITIES WIE,
    WIP_DISCRETE_JOBS WDJ,
    csi_item_instances CII
    where
    ir.gl_sl_link_table=XLA_L.gl_sl_link_table
    and gl_l.period_name =NVL(:7,gl_l.period_name)
    and gl_l.code_combination_id = :8
    and xla_h.ae_header_id = xla_l.ae_header_id
    AND xla_h.application_id = xla_l.application_id
    AND lk7.lookup_code(+) = xla_l.accounting_class_code
    AND lk7.lookup_type(+) = 'XLA_ACCOUNTING_CLASS'
    AND xla_e.event_id = xla_h.event_id
    AND xla_e.application_id = xla_h.application_id
    AND xs.application_id =xla_h.application_id
    AND te.entity_id =xla_h.entity_id
    AND te.application_id =xla_l.application_id --xla_h.application_id
    AND ec.application_id = et.application_id
    AND ec.entity_code = et.entity_code
    AND ec.event_class_code = et.event_class_code
    AND ec.language = USERENV('LANG')
    AND et.application_id = xla_h.application_id
    AND et.event_type_code = xla_h.event_type_code
    AND et.language = USERENV('LANG')
    AND lk5.lookup_code = NVL(xla_h.funds_status_code, 'REQUIRED')
    AND lk5.lookup_type = 'XLA_FUNDS_STATUS'
    AND bud.budget_version_id(+) = xla_h.budget_version_id
    AND wta.reference_account = gl_l.code_combination_id
    and wta.transaction_id = xte.source_id_int_1(+)
    and xte.entity_id = xla_e.entity_id
    and xdl.source_distribution_type = 'WIP_TRANSACTION_ACCOUNTS'
    and xdl.source_distribution_id_num_1 = wta.wip_sub_ledger_id(+)
    and xdl.APPLICATION_ID=707
    and xla_h.ae_header_id = xdl.ae_header_id
    and xdl.ae_header_id = XLA_L.ae_header_id
    and ir.gl_sl_link_table = 'XLAJEL'
    and ir.gl_sl_link_id = XLA_L.gl_sl_link_id
    and gl_l.je_header_id = ir.je_header_id
    and gl_l.je_line_num = ir.je_line_num
    and wie.wip_entity_id = wta.wip_entity_id
    AND wta.organization_id = wdj.organization_id
    and wie.wip_entity_id = wdj.wip_entity_id
    and wdj.asset_group_id = cii.inventory_item_id
    and wdj.maintenance_object_id=cii.instance_id
    and xs.je_source_name = 'Cost Management'
    Please help me in tuning the above query.
    Thanks
    Raghava

  • URGENT -- Linking GL to AR & AP for custom report

    Hello All,
    I am having trouble linking GL tables to AR and AP tables for a customized Account Analysis report.
    I have an initial query but the values for Accounted_DR/CR and Entered_DR/CR do no seem to be correct, so it is possible that the links I have are possibly wrong.
    Any help would be greatly appreciated.
    Here is my initial query:
    SELECT DISTINCT NVL(src.user_je_source_name, '**********') SOURCE,
    NVL(cat.user_je_category_name, '**********') CATEGORY,
    jeh.NAME JOURNAL_NAME,
    jeb.NAME BATCH_NAME,
    jeh.period_name PERIOD_NAME,
    gcc.segment1 CO,
    gcc.segment2 COST_CENTER,
    gcc.segment3 ACCOUNT,
    gcc.segment4 SECTOR,
    gcc.segment5 AC_TYPE,
    gcc.segment6 PROJ,
    gcc.segment7 FUTURE,
    (gcc.segment1 || '-' || gcc.segment2 || '-' || gcc.segment3 || '-' || gcc.segment4 || '-' || gcc.segment5 || '-' || gcc.segment6 || '-' || gcc.segment7) ACCOUNT1,
    jel.accounted_dr ACCOUNTED_DR,
    jel.accounted_cr ACCOUNTED_CR,
    jel.entered_dr ENTERED_DR,
    jel.entered_cr ENTERED_CR,
    jel.description LINE_DESCRIPTION,
    (SELECT ffv.description
    FROM FND_FLEX_VALUES_VL ffv
    WHERE ffv.flex_value = gcc.segment3) ACCOUNT_DESCRIPTION,
    (SELECT ffv.description
    FROM FND_FLEX_VALUES_VL ffv
    WHERE ffv.flex_value = gcc.segment4) SECTOR_DESCRIPTION,
    ap.vendor_name VENDOR_NAME,
    ca.check_number CHECK_NUMBER,
    ca.check_date CHECK_DATE,
    aia.invoice_num INVOICE_NUM,
    aia.invoice_date INVOICE_DATE,
    jeh.posted_date POSTED_DATE,
    /*(SELECT DISTINCT awt.NAME
    FROM
    ap_invoice_lines_all ail,
    ap_awt_groups awt
    WHERE aia.invoice_id = ail.invoice_id
    AND ail.awt_group_id = awt.group_id
    AND rownum=1) TAX_NAME*/
    FROM gl_je_headers jeh,
    gl_je_lines jel,
    gl_je_batches jeb,
    gl_je_sources src,
    gl_je_categories cat,
    gl_code_combinations gcc,
    fnd_flex_values_vl ffv,
    gl_import_references gli,
    xla.xla_ae_lines xal,
    xla.xla_ae_headers xah,
    xla.xla_events xe,
    xla.xla_transaction_entities xte,
    apps.ap_invoices_all aia,
    ap.ap_suppliers ap,
    ap_invoice_payments_all aipa,
    ap_checks_all ca
    WHERE
    jeh.je_header_id = jel.je_header_id
    AND jeh.je_batch_id = jeb.je_batch_id
    AND jeh.je_source = src.je_source_name
    AND jeh.je_category = cat.je_category_name
    AND jel.code_combination_id = gcc.code_combination_id
    AND gcc.segment4 = ffv.flex_value
    AND jeh.je_batch_id = gli.je_batch_id
    AND jeh.je_header_id = gli.je_header_id
    AND jel.je_line_num = gli.je_line_num
    AND (NVL(gli.reference_9, 1) = 1 OR gli.reference_9 >0)
    AND gcc.code_combination_id = xal.code_combination_id
    AND gli.gl_sl_link_id = xal.gl_sl_link_id
    AND gli.gl_sl_link_table = xal.gl_sl_link_table
    AND xal.application_id = xah.application_id
    AND xal.ae_header_id = xah.ae_header_id
    AND xah.application_id = xe.application_id
    AND xah.event_id = xe.event_id
    AND xe.application_id = xte.application_id
    AND xe.entity_id = xte.entity_id
    AND xte.source_id_int_1 =aia.invoice_id
    AND aia.vendor_id = ap.vendor_id
    AND aia.invoice_id = aipa.invoice_id(+)
    AND aipa.check_id = ca.check_id(+)
    AND jel.status || '' = 'P'
    AND jeb.average_journal_flag = 'N'
    AND jeh.period_name = :P_PERIOD_NAME
    --AND gcc.CODE_COMBINATION_ID=NVL(aia.ACCTS_PAY_CODE_COMBINATION_ID,gcc.CODE_COMBINATION_ID) /*link for GL and AP*/
    --AND gcc.CODE_COMBINATION_ID=NVL(aia.ACCTS_PAY_CODE_COMBINATION_ID,gcc.CODE_COMBINATION_ID) /*link for GL and AP*/
    ORDER BY ACCOUNT1,
    SOURCE ,
    CATEGORY,
    jeb.NAME
    Regards,
    Jovee
    Edited by: JoveeL on May 23, 2012 5:19 PM

    Hello again,
    I am still having trouble linking the data from GL. Specifically GL_JE_LINES and AP/AR values.
    Currently trying to link invoice details to GL details and Accounted CR/DR do not match up with the invoices and are sometimes repeating for different invoices.
    Upon checking, the values for GJ_JE_LINES repeat when I include the invoice details, but if I comment them out, they are okay.
    I suspect that there is something wrong with my link between the XLA and GL tables, but I could not narrow it down.
    I have tried looking it up in Google but there is nothing I found that is remotely helpful.
    Any helpful advice would be greatly appreciated.
    Regards,
    Jovelyn
    Edited by: JoveeL on May 23, 2012 5:15 PM

  • Cash Management query

    Does anyone know how Cash Management flags GL Journal Lines and CE Open Interface payments from external systems, as being no longer available for reconciliation after they have been reconciled? I have looked at the GL_JE_Lines and CE_999_INTERFACE_V tables, but I can't see any column being used for this purpose.
    Thanks

    Hi Brian,
    This is because, one payment/receipt cannot be shared by more than one bank statement line. This is why once payment/receipt is reconciled against a bank statement line, you can view this transaction only from reconciled screen.
    Regards,
    Kiran

  • GL-Account Analysis Report

    Hi
    I have a requirement for a report where they need all the journal details and if its a Purchasing source journal, I need to list the vendor name, the invoice number against that PO, etc.And if its an AR invoice, the customer name , order number,etc.
    Which table can i find all this information and link it to the GL_JE_LINES and GL_JE_HEADERS tables?
    Thanks,
    JA

    Hi
    The standard reports will not display the reference fields which contains the information you are looking for. The GL Drilldown to subledgers work through this reference fields and GL_SL_Link fields
    Refer Metalink note # 1012626.102
    Hope this helps
    Regards
    Sivakumar

  • Unable to query for GL balances

    Hi All,
    I'm using Oracle EBS R12.1.3. I'm unable to find a gl balance for a specific account. I can see there is information about it into the database but i cannot understand why it is not appearing into the application.
    Here are my steps:
    1. Navigate to GL Manager responsibility
    2. Inquiry > Account
    3. Query for specific code combinition
    4. No results
    I tried with another one and I receive data into the application. I tried to compared them in the database tables - gl_balances, gl_je_headers, gl_je_lines and they looks like similar data (flag, status, etc)
    Any ideas?
    Thanks in advance,
    Stoyanov

    Hi,
    Thanks for your reply.
    I ran the account analysis report and i'm able to see the data. Also - I can see this info in the Journals screen in GL. Any ideas why it's not showing in Inquiry > Account?
    Regards,
    Stoyanov

  • MTL_MATERIAL_TRANSACTIONS Table

    Dears
    Good Day
    Can any one guid me about the source of Records that inserted into (MTL_MATERIAL_TRANSACTIONS) Table!!
    Thank you&
    Best Regards

    Hi
    Thank you for reply
    I would like to explain about my case more clearly,
    Actually i have to resolve a Acustom Landed cost with this cycle :
    1- PO Request
    2- Invoice
    3- mapping invoice with the PO
    4- Reciet
    5- Landed Cost
    6- approve for Landed cost :
    7- Recieving : on this step (mtl_material_transactions) and (mtl_transaction_accounts) Tables are filled, but the
    (mtl_transaction_accounts.Base_Transaction_value) column not affected with the new value ( (qty*price) + landed Cost),
    so, on step 6 (approve for Landed cost), wich tables can i update to affect the new value.
    Thanks

  • Updating one Segment Value in GL Code Combinations

    Dear Members,
    We are using Oracle GL in our Organization from past couple of years.
    Our COA consists of 6 Segments (i.e, Company--Organization--Area--Activity--Account--Product)
    Now users are requesting us to change few account combinations for instance
    11-00-00-00-123456-0000 to 11-00-00-00-123456-1000 ie. We have to update all the Posted and Unposted Journals having code combination of 11-00-00-00-123456-0000 to 11-00-00-00-123456-1000.
    Please let me know whether this is a common practice? Are we allowed to do such updates without any adverse effects?
    If we are allowed to update is there any API available?
    Many thanks in advance.
    Best Regards.

    Hi
    If you do this from the backend (i.e. update GL_JE_LINES and GL_BALANCES) it is completely unsupported (for obvious reasons).
    If you want to do it via the frontend the General Ledger Mass Maintenance function will do it (Setup > Other > Mass Maintenance), i.e. it will move the balances from one combination to another. It does not create journals to do so though so it depends on the business requirement as to whether an audit trail is required for the change.
    It's a pretty common practice - finance often want new cost centres, change their minds about cost centres and move balances around. I usually don't use Mass Maintenance as the auditors usually prefer journals but if a mistake was made in the cost centre setup or something then yes, Mass Maintenance works. Give it a shot in your test environment, show finance what results and check that they are happy with that.
    Regards
    Jo

  • How do you query the iTunes database by genre?

    I am trying to enumerate music tracks from the iTunes database by genre.
    I am able to get genre id's from the query
    http://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres
    The description is here:
    http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.htm l
    I can retrieve urls to tracks with something like this
    https://itunes.apple.com/search?term=R+B/Soul&limit=2
    However the search term applies to all fields and I get a mixed collection of results, many of them are wrong.
    I would like to enumerate songs from a specific genre, but I can't figure out how.
    I've tried multiple ways of using the "genreIndex" attribute, but I keep getting 0 results.
    For example I would like to enumerate the first 10 Techno songs. Techno has a genre id=1050
    https://itunes.apple.com/search?term= any ideas??
    Thanks, Ed

    Hi there are mappings for the reference fields from AP and AR, so you can buid up the links there. Just look at the reference fields of gl_je_lines and try to identify which is valuable for you.
    Ugur YILMAZ
    http://oracle-master.com

  • How do you query the journal drilldown data using SQL

    Hi All,
    Appreciate if anybody can assist me into querying the database via SQL query so the journal data includes sub ledger detail.
    I found that I cannot link the GL journal batch id (etc.) with the existing sub ledger (AR and AP). Is there any way to perform this query, if not, how can the drill down works?
    I needed the guidence since there are certain info that is not available in the journal (rct number, PO no, check no etc). I need to ensure that the data I have is tally with GL journals.
    Reasons: doing some recon download to be feeded to a third party system.
    Thanks.

    Hi there are mappings for the reference fields from AP and AR, so you can buid up the links there. Just look at the reference fields of gl_je_lines and try to identify which is valuable for you.
    Ugur YILMAZ
    http://oracle-master.com

Maybe you are looking for

  • Why do I receive an error message while attempting upload pictures from iPhoto '09 to Facebook?

    I currently have iPhoto '09 version 8.1.2. I tried uploading pictures from iPhoto to Facebook but I get the message "An error has occured. Please try again later". File > Export > Login (which brings me to the Login page on Facebook) > I sign in & th

  • Restore from Time Capsule fails

    I'm trying to restore from my Time Capsule backup over ethernet. I've tried with two different cat5e cables, but each time it goes extremely slowly, (it only gets to .4% after an hour and says it'll take 600 hours). After about an hour it fails and t

  • Module Pool Programming using Abap Objects

    Hi gurus., I need to create a module pool program with tabstrips and tablecontrols using Abap objects...plz guide me how i can achieve this... i am very much confused.. i dont know how and where to start .. plz send me documents and sample codes rela

  • MoveRowAtIndexPath called in infinite loop, cancelCellReorder?

    Hi No doubt I've missed something obvious, hopefully someone can give me a hint. I've got a table view that comes up in a popup. Everything displays fine, scrolls fine, and deletes ok as well. However, when I drag a row to a new spot and let go, infi

  • Error in every form 11g

    Hello to all, I'm migrating my forms 6i to 11g. My problem is that every single form has an error when loading. The error is "FRM-40735: ON-ERROR trigger raised unhandled exception ORA-06508." In the beginning there were more errors and by converting