Professional Documents
Culture Documents
==============================
Data Conversion:
================
select * from apps.GETS_CST_ITEM_COST_CONV_STG where branch_plant='LHL' and
process_flag='E';
select user_name,
description,
employee_id,
start_date,
end_date,
user_id
from
apps.fnd_user
where
user_id in (
select user_id from apps.FND_USER_RESP_GROUPS_DIRECT where responsibility_id=57280)
and end_date is null;
Query to find out the status of the Interco in Material Txns table
==================================================================
select * from apps.oe_order_headers_all where order_number='91637213';
select
rcta.trx_number,
rcta.interface_header_context,
rcta.interface_header_attribute1,
rcta.interface_header_attribute3,
rcta.interface_header_attribute14,
rcta.*
from
apps.ra_customer_trx_all rcta
where
interface_header_attribute1 ='11776559';
--interface_header_attribute3 like '%55640059%' -- Original Delivery
--interface_header_attribute14 like '%55640059%';-- Intercompany Inv
select ril.Interface_line_context,
ril.interface_line_attribute1,
ril.purchase_order,
ril.*
from apps.ra_interface_lines_all ril where to_date(creation_date) >
to_date(sysdate-2)
and interface_line_context='GLOBAL_PROCUREMENT';
--Interface_line_attribute1 is PO Number
UPDATE apps.OE_HEADERS_IFACE_ALL
SET ERROR_FLAG = NULL, REQUEST_ID = NULLL
where org_id = 2609 and orig_sys_document_ref = 11904594;
Select
Ship_organization_name FROM_OU,
Sell_organization_name TO_OU,
CUSTOMER_NAME,
CUSTOMER_NUMBER,
Location,
ATTRIBUTE_CATEGORY,
SUPPLIER_NAME,
VENDOR_SITE,
attribute5 "Bypass Flag"
from apps.MTL_INTERCOMPANY_PARAMETERS_V
where
Ship_organization_name= :p_ship_org
and Sell_organization_name=:p_sell_org;
select a.PROGRAM_SHORT_NAME,
to_char(a.REQUESTED_START_DATE,'DD-MON-YYYY HH24:MI:SS')REQUESTED_START_DATE,
to_char(a.ACTUAL_START_DATE,'DD-MON-YYYY HH24:MI:SS')ACTUAL_START_DATE,
to_char(a.ACTUAL_COMPLETION_DATE,'DD-MON-YYYY HH24:MI:SS')ACTUAL_COMPLETION_DATE,
--REQUESTED_START_DATE,ACTUAL_START_DATE,ACTUAL_COMPLETION_DATE
to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')systime,
a.requestor,
a.argument_text
from apps.fnd_conc_req_summary_v a
where a.PROGRAM_SHORT_NAME = 'REQIMPORT'
and responsibility_id = 20707
and argument_text like '%ORDER%ENTRY%'
order by a.request_date desc;
PO Related Tables:
==================
SELECT a.object_type_code,
a.action_code,
a.action_date,
a.employee_id,
b.name hierarchy_name,
d.full_name,
d.employee_number,
d.email_address
FROM apps.po_action_history a ,
apps.per_position_structures b ,
apps.po_headers_all c ,
apps.per_all_people_f d
WHERE a.object_id = c.po_header_id
AND c.segment1 = '533000007'--po_number
AND a.approval_path_id= b.position_structure_id
AND d.person_id = a.employee_id;
From the below Query we can find to which customer it has been linked:
----------------------------------------------------------------------
select * from apps.po_Location_Associations_All where location_id=1989 and
org_id=2329;
Not Needed (((((from the above query get the CUST_ACCT_SITE_ID and apply in thsi
query:
-----------------------------------------------------------------------
select * from apps.HZ_CUST_ACCT_SITES_ALL where cust_acct_site_id=807904 and
org_id=2329;
From the above Query we will get the CUST_ACCOUNT_ID then apply in this query:
-----------------------------------------------------------------------------
select * from apps.HZ_CUST_ACCOUNTS_all where cust_account_id=24240;
From the above query we will get PARTY_ID ,ACCOUNT_NUMBER then apply here to get
CUSTOMER_NAME:
-----------------------------------------------------------------------------------
------------
select * from apps.HZ_PARTIES where party_id='8977'; --'Industrea Mining Equipment
Pty Ltd.'; --party_id=823612))))))))
--
SELECT
gio.short_name ou_name,
----------------------
--Customer Information
----------------------
hp.party_name "CUSTOMER_NAME",
hca.account_number,
hps.party_site_number,
hcsu.site_use_code,
hl.country,
hl.address1,
hl.address2,
hl.address3,
hl.address4,
hl.city,
hl.state,
hl.postal_code,
hl.province,
hl.county,
hl.address_style,
hsuv.location,
hsuv.payment_term_name,
hsuv.primary_salesrep_name,
hsuv.order_type_name,
hsuv.price_list_name,
hsuv.date_type_preference,
hsuv.freight_term,
hsuv.demand_class_code,
hsuv.inventory_location_code,
hsuv.inventory_organization_name,
---------------------------
--Customer Site Information
---------------------------
hp.party_id,
hca.cust_account_id,
hcas.cust_acct_site_id,
hcsu.site_use_id,
hcsu.primary_flag,
-----------------------
--Customer Site Address
-----------------------
--Site level details
hsuv.site_use_code,
hsuv.primary_flag,
hsuv.status,
hsuv.contact_id,
hsuv.contact_name,
hsuv.orig_system_reference,
hsuv.sic_code,
hsuv.payment_term_id,
hsuv.gsa_indicator,
hsuv.ship_partial,
hsuv.ship_via,
hsuv.fob_point,
hsuv.order_type_id,
hsuv.price_list_id,
hsuv.warehouse_id,
hsuv.warehouse_name,
hsuv.tax_reference,
hsuv.tax_code,
hp.tax_reference tax_code,
hcsu.tax_reference tax_code_site,
hcas.org_id,
hp.party_type,
hsuv.inventory_location_id,
hsuv.inventory_organization_id,
hsuv.tax_classification,
hsuv.tax_header_level_flag,
hsuv.tax_rounding_rule,
hsuv.primary_salesrep_id
FROM
apps.hz_parties hp,
apps.hz_party_sites hps,
apps.hz_cust_accounts_all hca,
apps.hz_cust_acct_sites_all hcas,
apps.hz_cust_site_uses_all hcsu,
apps.hz_locations hl,
apps.gets_inv_op_unit_info gio,
apps.hz_site_uses_v hsuv
WHERE
1 = 1
AND hp.party_id = hca.party_id
AND hca.cust_account_id = hcas.cust_account_id (+)
AND hps.party_site_id (+) = hcas.party_site_id
AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
--
AND hps.location_id = hl.location_id (+)
--
--AND hp.party_type = 'ORGANIZATION' -- only ORGANIZATION Party types
AND hp.status = 'A' -- only Active Parties/Customers
--AND upper(gio.short_name) = 'GEENR'
AND hca.account_number = nvl(:cust_account_number, hca.account_number)
AND hcas.org_id = gio.org_id
AND hsuv.site_use_id = hcsu.site_use_id
ORDER BY
1;
select
hr.location_id,hr.location_code,hr.description,rsua.site_use_id,rsua.site_use_code,
rsua.address_id,rsua.status,rsua.location,rsua.bill_to_site_use_id,rsua.orig_system
_reference,ac.customer_id,rsua.org_id,
ac.customer_name,ac.customer_number,ac.orig_system_reference
from hr_locations hr, GETS_HZ_CUST_SITE_USES_V rsua, po_location_associations_all
pla,ar_customers ac
where pla.organization_id = 2629
and pla.site_use_id = rsua.site_use_id
and rsua.status = 'A'
and pla.location_id = hr.location_id
and ac.customer_id = pla.customer_id
order by hr.location_code;
select
msi.segment1,
br.resource_code,
cic.Item_cost,
cic.cost_type_id,
cic.cost_element_id
from
apps.cst_item_cost_details cic,
apps.BOM_RESOURCES_V br,
apps.mtl_system_items_b msi
where
cic.resource_id=br.resource_id
and cic.inventory_item_id=msi.inventory_item_id
and cic.organization_id=msi.organization_id
and to_date(cic.creation_date) > to_date(sysdate-1)
and cic.organization_id=3858;