select
x.*
from
(
select
null action_,
null status_,
null message_,
null request_id_,
to_char(null) row_id,
to_char(null) request_id,
:p_upload_mode upload_mode,
to_char(null) source_code,
to_char(null) replace_forecast,
--
mp.organization_code,
mfds.forecast_set,
mfds.forecast_designator forecast,
mfds.description forecast_description,
msiv.concatenated_segments item,
msiv.description item_description,
msiv.primary_uom_code uom,
msiv.planner_code planner,
mfd.forecast_date forecast_date,
mfd.rate_end_date forecast_end_date,
mfd.current_forecast_quantity quantity,
mfd.comments,
xxen_util.meaning(mfd.bucket_type,'MRP_BUCKET_TYPE',700) bucket_type,
to_char(null) workday_control,
mfd.confidence_percentage,
nvl(
(select ppa.segment1 project_number from pa_projects_all ppa where ppa.project_id = mfd.project_id),
(select psm.project_number from pjm_seiban_numbers psm where psm.project_id = mfd.project_id)
) project,
(select pt.task_number from pa_tasks pt where pt.task_id = mfd.task_id) task,
(select wl.line_code from wip_lines wl where wl.line_id = mfd.line_id and wl.organization_id = mfd.organization_id) wip_line_code,
mfd.attribute_category,
mfd.attribute1,
mfd.attribute2,
mfd.attribute3,
mfd.attribute4,
mfd.attribute5,
mfd.attribute6,
mfd.attribute7,
mfd.attribute8,
mfd.attribute9,
mfd.attribute10,
mfd.attribute11,
mfd.attribute12,
mfd.attribute13,
mfd.attribute14,
mfd.attribute15,
mfd.transaction_id
from
mtl_parameters mp,
mrp_forecast_designators mfds,
mrp_forecast_items_v mfiv,
mrp_forecast_dates mfd,
mtl_system_items_vl msiv
where
mfds.organization_id = mp.organization_id and
mfds.organization_id = mfiv.organization_id and
mfds.forecast_designator = mfiv.forecast_designator and
mfiv.organization_id = mfd.organization_id and
mfiv.forecast_designator = mfd.forecast_designator and
mfiv.inventory_item_id = mfd.inventory_item_id and
mfiv.organization_id = msiv.organization_id and
mfiv.inventory_item_id = msiv.inventory_item_id and
--
mfds.forecast_set = nvl(:p_forecast_set,mfds.forecast_set) and
1=1
¬_use_first_block
&report_table_select
&report_table_name &report_table_where_clause
&processed_run
) x
order by
x.forecast,
x.item,
x.forecast_date asc |