Monday, 31 July 2023

Oracle EBS - SQL Query to Get Material Transaction Open Interface Errored Transaction Details

Subject: SQL Query to Get Material Transaction Open Interface Errored Transaction Details


SQL Query:

SELECT 

    mtiv.transaction_interface_id,

    mtiv.transaction_type_name,

    msib.segment1                 item,

    mtiv.item_description,

    mtiv.primary_quantity         qty,

    mtiv.organization_code        org,

    milk.concatenated_segments    location,

    mtiv.creation_date,

    mtiv.last_update_date,

    mtiv.error_explanation,

    mtiv.error_code

FROM

    apps.mtl_transactions_interface_v    mtiv,

    apps.mtl_system_items_b              msib,

    apps.mtl_item_locations_kfv          milk

WHERE

        msib.inventory_item_id = mtiv.inventory_item_id

    AND msib.organization_id = mtiv.organization_id

    AND mtiv.locator_id = milk.inventory_location_id

    AND mtiv.organization_id = milk.organization_id

    AND msib.organization_id = (

        SELECT

            organization_id

        FROM

            apps.mtl_parameters

        WHERE

            organization_code = 'CCI' --Need to Enter Organization Code 

    );


Monday, 17 July 2023

EBS - Program - Daily Rates Import and Calculation program Error: Duplicate Row or Overlapping Date Range found

 

Problem Summary:

Program - Daily Rates Import and Calculation program failing while importing daily gl rates.

Program: Program - Daily Rates Import and Calculation


Error Log:

Error: Duplicate Row or Overlapping Date Range found.


 

Resolution:

After Investigation come to know that program failing due to duplicate data entry exists in interface table due to that it’s failing.

After Running the Below Provided Delete Duplication Transaction Script, program Run Normally.


 

SQL Query to find Duplicate Entry:

SELECT

    *

FROM

    gl_daily_rates_interface t1

WHERE

    ( t1.from_currency, t1.to_currency, t1.user_conversion_type, t1.from_conversion_date, t1.to_conversion_date ) IN (

        SELECT /*+ NO_MERGE */ t2.from_currency,

            t2.to_currency,

            t2.user_conversion_type,

            t2.from_conversion_date,

            t2.to_conversion_date

        FROM

            gl_daily_rates_interface t2

        WHERE

            mode_flag IN ( 'I', 'D', 'T', 'N' )

        GROUP BY

            t2.from_currency,

            t2.to_currency,

            t2.user_conversion_type,

            t2.from_conversion_date,

            t2.to_conversion_date

        HAVING

            COUNT(*) > 1

    )

    AND mode_flag IN ( 'I', 'D', 'T', 'N' )

    AND t1.batch_number IS NULL

ORDER BY

    1,

    2,

    3;

 

DELETE Script for Deleting Duplicate Entry From Table:

DELETE FROM gl_daily_rates_interface t1

WHERE

    ( t1.from_currency, t1.to_currency, t1.user_conversion_type, t1.from_conversion_date, t1.to_conversion_date ) IN (

        SELECT /*+ NO_MERGE */ t2.from_currency,

            t2.to_currency,

            t2.user_conversion_type,

            t2.from_conversion_date,

            t2.to_conversion_date

        FROM

            gl_daily_rates_interface t2

        WHERE

            mode_flag IN ( 'I', 'D', 'T', 'N' )

        GROUP BY

            t2.from_currency,

            t2.to_currency,

            t2.user_conversion_type,

            t2.from_conversion_date,

            t2.to_conversion_date

        HAVING

            COUNT(*) > 1

    )

    AND mode_flag IN ( 'I', 'D', 'T', 'N' )

    AND t1.batch_number IS NULL

;