Showing posts with label Query to get ship to location in oracle fusion. Show all posts
Showing posts with label Query to get ship to location in oracle fusion. Show all posts

Tuesday, 24 March 2026

Query to get ship to location in oracle fusion

 select 
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1)||'-'|| hut.bu_name||'-'||loc.location_id AP_External_Key__c,
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1) Source_System,
(select 'Oracle-'||instance_name from gv$instance  where INSTANCE_NUMBER =1)||'-'|| to_char(sysdate,'yyyymmddhhmmss') Batch_Id,
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1)||'-'|| hut.bu_name Company_Code_Unique_Key, 
hut.bu_name Company_Code,
lot.location_code Ship_to_Location_Code,
lot.description Description,
decode(loc.ACTIVE_STATUS,'A','Y','I','N','Y') Active_Status,
to_char(loc.last_update_Date,'yyyy-MM-dd HH:mm:ss') last_update_Date,
null Temp_1,
null Temp_2,
null Temp_3,
null Temp_4,
null Temp_5,
null Temp_6,
null Temp_7,
null Temp_8,
null Temp_9,
null Temp_10 
from per_location_details_f loc,
     per_location_details_f_tl lot, 
     FUN_ALL_BUSINESS_UNITS_V  hut
where loc.location_details_id = lot.location_details_id
AND lot.language = userenv('LANG')
AND loc.effective_start_date = lot.effective_Start_date
AND loc.effective_end_date = lot.effective_end_date
AND trunc(sysdate) BETWEEN loc.effective_start_date and loc.effective_end_date
and loc.location_id=hut.location_id
and loc.ship_to_Site_flag ='Y'
AND trunc(LOC.LAST_UPDATE_DATE) BETWEEN NVL(:P_FROM_DATE,trunc(LOC.LAST_UPDATE_DATE)) AND NVL(:P_END_DATE,trunc(LOC.LAST_UPDATE_DATE))
union all
select 
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1)||'-'|| hut.name||'-'||loc.location_id AP_External_Key__c,
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1) Source_System,
(select 'Oracle-'||instance_name from gv$instance  where INSTANCE_NUMBER =1)||'-'|| to_char(sysdate,'yyyymmddhhmmss') Batch_Id,
(select 'Oracle-'||INSTANCE_NAME from gv$instance  where INSTANCE_NUMBER =1)||'-'|| hut.name Company_Code_Unique_Key, 
hut.name Company_Code,
lot.location_code Ship_to_Location_Code,
lot.description Description,
decode(loc.ACTIVE_STATUS,'A','Y','I','N','Y') Active_Status,
to_char(loc.last_update_Date,'yyyy-MM-dd HH:mm:ss') last_update_Date,
null Temp_1,
null Temp_2,
null Temp_3,
null Temp_4,
null Temp_5,
null Temp_6,
null Temp_7,
null Temp_8,
null Temp_9,
null Temp_10 
from per_location_details_f loc,
     per_location_details_f_tl lot, 
     inv_org_parameters iop, 
     hr_organization_units_f_tl hut
where 1=1
and loc.location_details_id = lot.location_details_id
AND lot.language = userenv('LANG')
AND loc.effective_start_date = lot.effective_Start_date
AND loc.effective_end_date = lot.effective_end_date
AND trunc(sysdate) BETWEEN loc.effective_start_date and loc.effective_end_date
and loc.INVENTORY_ORGANIZATION_ID =  iop.ORGANIZATION_ID
and iop.BUSINESS_UNIT_ID= hut.ORGANIZATION_ID
and loc.ship_to_Site_flag ='Y'
and hut.LANGUAGE = USERENV('LANG')
AND trunc(LOC.LAST_UPDATE_DATE) BETWEEN NVL(:P_FROM_DATE,trunc(LOC.LAST_UPDATE_DATE)) AND NVL(:P_END_DATE,trunc(LOC.LAST_UPDATE_DATE))

Interview Question in Oracle OTBI Report

What is Subject Area In OTBI, a Subject Area is a logical view of business data. Under a Subject Area, we have multiple folders , which are...