123:
124: -- Find out if there are any standard costing orgs
125: select nvl(max(1),0)
126: into l_exists_sc_orgs
127: from sys.dual
128: where exists (
129: select 'There are standard costing orgs'
130: from mtl_parameters
131: where primary_cost_method = 1
133:
134: -- Find out if there are any Avg/LIFO/FIFO orgs
135: select nvl(max(1),0)
136: into l_exists_ac_orgs
137: from sys.dual
138: where exists (
139: select 'There are Avg/LIFO/FIFO costing orgs'
140: from mtl_parameters
141: where primary_cost_method <> 1
142: );
143:
144: select FND_GLOBAL.USER_ID
145: into l_application_user_id
146: from sys.dual;
147:
148: -- Get the cost history for standard costing orgs from cst_elemental_costs
149: if (l_exists_sc_orgs = 1) then
150: eni_dbi_util_pkg.log('There are Standard Costing orgs, hence starting initial cost collection into stage table for them');
599: --eni_dbi_util_pkg.log('End Period of last cost collection was ' || to_char(l_last_run_to_date));
600: --eni_dbi_util_pkg.log('Incremental cost collection will collect records on and after the above date');
601: select FND_GLOBAL.USER_ID
602: into l_application_user_id
603: from sys.dual;
604:
605: select FND_GLOBAL.LOGiN_ID
606: into l_login_id
607: from sys.dual;
603: from sys.dual;
604:
605: select FND_GLOBAL.LOGiN_ID
606: into l_login_id
607: from sys.dual;
608:
609: select NVL(max(1),0)
610: into rows_in_stage
611: from eni_dbi_item_cost_stg;
688:
689: -- Find out if there are any standard costing orgs
690: select nvl(max(1),0)
691: into l_exists_sc_orgs
692: from sys.dual
693: where exists (
694: select 'There are standard costing orgs'
695: from mtl_parameters
696: where primary_cost_method = 1
698:
699: -- Find out if there are any Avg/LIFO/FIFO orgs
700: select nvl(max(1),0)
701: into l_exists_ac_orgs
702: from sys.dual
703: where exists (
704: select 'There are Avg/LIFO/FIFO costing orgs'
705: from mtl_parameters
706: where primary_cost_method <> 1