DBA Data[Home] [Help]

APPS.MSC_CL_PRE_PROCESS dependencies on MSC_ST_WO_TASK_HIERARCHY

Line 14209: lv_batch_id msc_st_wo_task_hierarchy.batch_id%TYPE;

14205: lv_error_text VARCHAR2(250);
14206: lv_where_str VARCHAR2(5000);
14207: lv_sql_stmt VARCHAR2(5000);
14208: lv_column_names VARCHAR2(5000); --stores concatenated column names
14209: lv_batch_id msc_st_wo_task_hierarchy.batch_id%TYPE;
14210: lv_message_text msc_errors.error_text%TYPE;
14211:
14212: ex_logging_err EXCEPTION;
14213:

Line 14216: FROM msc_st_wo_task_hierarchy

14212: ex_logging_err EXCEPTION;
14213:
14214: CURSOR c1(p_batch_id NUMBER) IS
14215: SELECT rowid
14216: FROM msc_st_wo_task_hierarchy
14217: WHERE process_flag IN (G_IN_PROCESS,G_ERROR_FLG)
14218: AND batch_id = p_batch_id
14219: AND sr_instance_code = v_instance_code;
14220:

Line 14234: --Validation check for the table msc_st_wo_task_hierarchy

14230: IF lv_return <> 0 THEN
14231: RAISE ex_logging_err;
14232: END IF;
14233:
14234: --Validation check for the table msc_st_wo_task_hierarchy
14235:
14236: --Duplicate records check for the records whose source is other than XML
14237: --Different SQL is used because in XML we can identify the latest records
14238: --whereas in batch load we cannot.

Line 14242: 'UPDATE msc_st_wo_task_hierarchy mswth1 '

14238: --whereas in batch load we cannot.
14239:
14240: v_sql_stmt := 01;
14241: lv_sql_stmt :=
14242: 'UPDATE msc_st_wo_task_hierarchy mswth1 '
14243: ||' SET process_flag = '||G_ERROR_FLG||','
14244: ||' error_text = '||''''||lv_message_text||''''
14245: ||' WHERE EXISTS ( SELECT 1 FROM msc_st_wo_task_hierarchy mswth2 '
14246: ||' WHERE mswth2.sr_instance_code = mswth1.sr_instance_code'

Line 14245: ||' WHERE EXISTS ( SELECT 1 FROM msc_st_wo_task_hierarchy mswth2 '

14241: lv_sql_stmt :=
14242: 'UPDATE msc_st_wo_task_hierarchy mswth1 '
14243: ||' SET process_flag = '||G_ERROR_FLG||','
14244: ||' error_text = '||''''||lv_message_text||''''
14245: ||' WHERE EXISTS ( SELECT 1 FROM msc_st_wo_task_hierarchy mswth2 '
14246: ||' WHERE mswth2.sr_instance_code = mswth1.sr_instance_code'
14247: ||' AND mswth2.organization_code = mswth1.organization_code'
14248: ||' AND mswth2.curr_wip_entity_code = mswth1.curr_wip_entity_code'
14249: ||' AND mswth2.next_wip_entity_code = mswth1.next_wip_entity_code'

Line 14270: 'UPDATE msc_st_wo_task_hierarchy mswth1 '

14266:
14267: --Duplicate records check for the records whose source is XML
14268: v_sql_stmt := 02;
14269: lv_sql_stmt :=
14270: 'UPDATE msc_st_wo_task_hierarchy mswth1 '
14271: ||' SET process_flag = '||G_ERROR_FLG||','
14272: ||' error_text = '||''''||lv_message_text||''''
14273: ||' WHERE message_id < ( SELECT max(message_id) '
14274: ||' FROM msc_st_wo_task_hierarchy mswth2'

Line 14274: ||' FROM msc_st_wo_task_hierarchy mswth2'

14270: 'UPDATE msc_st_wo_task_hierarchy mswth1 '
14271: ||' SET process_flag = '||G_ERROR_FLG||','
14272: ||' error_text = '||''''||lv_message_text||''''
14273: ||' WHERE message_id < ( SELECT max(message_id) '
14274: ||' FROM msc_st_wo_task_hierarchy mswth2'
14275: ||' WHERE mswth2.sr_instance_code = mswth1.sr_instance_code'
14276: ||' AND mswth2.curr_wip_entity_code = mswth1.curr_wip_entity_code'
14277: ||' AND mswth2.next_wip_entity_code = mswth1.next_wip_entity_code'
14278: ||' AND mswth2.process_flag = mswth1.process_flag'

Line 14313: 'UPDATE msc_st_wo_task_hierarchy '

14309: FROM dual;
14310:
14311: v_sql_stmt := 04;
14312: lv_sql_stmt :=
14313: 'UPDATE msc_st_wo_task_hierarchy '
14314: ||' SET batch_id = :lv_batch_id'
14315: ||' WHERE process_flag IN ('||G_IN_PROCESS||','||G_ERROR_FLG||')'
14316: ||' AND sr_instance_code = :v_instance_code'
14317: ||' AND NVL(batch_id,'||NULL_VALUE||') = '||NULL_VALUE

Line 14333: UPDATE msc_st_wo_task_hierarchy

14329: FETCH c1 BULK COLLECT INTO lb_rowid;
14330: CLOSE c1;
14331:
14332: FORALL j IN lb_rowid.FIRST..lb_rowid.LAST
14333: UPDATE msc_st_wo_task_hierarchy
14334: SET st_transaction_id = msc_st_wo_task_hierarchy_s.nextval,
14335: refresh_id = v_refresh_id,
14336: last_update_date = v_current_date,
14337: last_updated_by = v_current_user,

Line 14334: SET st_transaction_id = msc_st_wo_task_hierarchy_s.nextval,

14330: CLOSE c1;
14331:
14332: FORALL j IN lb_rowid.FIRST..lb_rowid.LAST
14333: UPDATE msc_st_wo_task_hierarchy
14334: SET st_transaction_id = msc_st_wo_task_hierarchy_s.nextval,
14335: refresh_id = v_refresh_id,
14336: last_update_date = v_current_date,
14337: last_updated_by = v_current_user,
14338: creation_date = v_current_date,

Line 14363: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',

14359: ||' NOT IN(1,2)';
14360: --Log a warning for those records where the deleted_flag has a value other
14361: --than SYS_NO
14362: lv_return := MSC_ST_UTIL.LOG_ERROR
14363: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',
14364: p_instance_code => v_instance_code,
14365: p_row => lv_column_names,
14366: p_severity => G_SEV_WARNING,
14367: p_message_text => lv_message_text,

Line 14395: 'UPDATE msc_st_wo_task_hierarchy'

14391:
14392: -- Error out records where NEXT_WIP_ENTITY_CODE or CURR_WIP_ENTITY_CODE is NULL
14393: v_sql_stmt := 06;
14394: lv_sql_stmt :=
14395: 'UPDATE msc_st_wo_task_hierarchy'
14396: ||' SET process_flag = '||G_ERROR_FLG||','
14397: ||' error_text = '||''''||lv_message_text||''''
14398: ||' WHERE ( CURR_WIP_ENTITY_CODE IS NULL'
14399: ||' OR NEXT_WIP_ENTITY_CODE IS NULL )'

Line 14431: 'UPDATE msc_st_wo_task_hierarchy'

14427: -- validate time unit
14428:
14429: v_sql_stmt := 07;
14430: lv_sql_stmt :=
14431: 'UPDATE msc_st_wo_task_hierarchy'
14432: ||' SET process_flag = '||G_ERROR_FLG||','
14433: ||' error_text = '||''''||lv_message_text||''''
14434: ||' WHERE upper(MIN_SEP_TIME_UNIT) NOT IN (''S'',''M'',''H'',''D'',''W'') '
14435: ||' AND process_flag = '||G_IN_PROCESS

Line 14448: 'UPDATE msc_st_wo_task_hierarchy'

14444: USING lv_batch_id,v_instance_code;
14445:
14446: v_sql_stmt := 8;
14447: lv_sql_stmt :=
14448: 'UPDATE msc_st_wo_task_hierarchy'
14449: ||' SET MIN_SEP_TIME_UNIT = (select meaning from fnd_lookup_values lv'
14450: ||' WHERE LV.LANGUAGE = userenv(''lang'') '
14451: ||' AND LV.ENABLED_FLAG = ''Y'''
14452: ||' and lookup_type = ''MSC_TIME_UNIT'''

Line 14483: 'UPDATE msc_st_wo_task_hierarchy'

14479:
14480:
14481: v_sql_stmt := 09;
14482: lv_sql_stmt :=
14483: 'UPDATE msc_st_wo_task_hierarchy'
14484: ||' SET process_flag = '||G_ERROR_FLG||','
14485: ||' error_text = '||''''||lv_message_text||''''
14486: ||' WHERE upper(MAX_SEP_TIME_UNIT) NOT IN (''S'',''M'',''H'',''D'',''W'') '
14487: ||' AND process_flag = '||G_IN_PROCESS

Line 14501: 'UPDATE msc_st_wo_task_hierarchy'

14497: USING lv_batch_id,v_instance_code;
14498:
14499: v_sql_stmt := 10;
14500: lv_sql_stmt :=
14501: 'UPDATE msc_st_wo_task_hierarchy'
14502: ||' SET MAX_SEP_TIME_UNIT = (select meaning from fnd_lookup_values lv'
14503: ||' WHERE LV.LANGUAGE = userenv(''lang'') '
14504: ||' AND LV.ENABLED_FLAG = ''Y'''
14505: ||' and lookup_type = ''MSC_TIME_UNIT'''

Line 14542: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',

14538: lv_where_str := ' AND NVL(PRECEDENCE_CONSTRAINT,'||NULL_VALUE||') '
14539: ||' NOT IN(1,2,3)';
14540:
14541: lv_return := MSC_ST_UTIL.LOG_ERROR
14542: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',
14543: p_instance_code => v_instance_code,
14544: p_row => lv_column_names,
14545: p_severity => G_SEV_WARNING,
14546: p_message_text => lv_message_text,

Line 14560: 'UPDATE msc_st_wo_task_hierarchy'

14556: END IF;
14557:
14558: v_sql_stmt := 11;
14559: lv_sql_stmt :=
14560: 'UPDATE msc_st_wo_task_hierarchy'
14561: ||' SET PRECEDENCE_CONSTRAINT = (select meaning from fnd_lookup_values lv'
14562: ||' WHERE LV.LANGUAGE = userenv(''lang'') '
14563: ||' AND LV.ENABLED_FLAG = ''Y'''
14564: ||' and lookup_type = ''MSC_PRECEDENCE_CONSTRAINT'''

Line 14581: 'UPDATE msc_st_wo_task_hierarchy mswth'

14577:
14578: --Deriving supply_id
14579: v_sql_stmt := 12;
14580: lv_sql_stmt :=
14581: 'UPDATE msc_st_wo_task_hierarchy mswth'
14582: ||' SET curr_supply_id = (SELECT transaction_id'
14583: ||' FROM msc_supplies ms'
14584: ||' WHERE ms.sr_instance_id = :v_instance_id'
14585: ||' AND ms.order_number = mswth.curr_wip_entity_code'

Line 14609: 'UPDATE msc_st_wo_task_hierarchy '

14605: p_token_value1 => 'CURR_WIP_ENTITY_CODE');
14606:
14607: v_sql_stmt := 13;
14608: lv_sql_stmt :=
14609: 'UPDATE msc_st_wo_task_hierarchy '
14610: ||' SET process_flag = '||G_ERROR_FLG||','
14611: ||' error_text = '||''''||lv_message_text||''''
14612: ||' WHERE CURR_SUPPLY_ID IS NULL'
14613: ||' AND process_flag = '||G_IN_PROCESS

Line 14629: 'UPDATE msc_st_wo_task_hierarchy mswth'

14625:
14626: --Deriving supply_id
14627: v_sql_stmt := 14;
14628: lv_sql_stmt :=
14629: 'UPDATE msc_st_wo_task_hierarchy mswth'
14630: ||' SET next_supply_id = (SELECT transaction_id'
14631: ||' FROM msc_supplies ms'
14632: ||' WHERE ms.sr_instance_id = :v_instance_id'
14633: ||' AND ms.order_number = mswth.next_wip_entity_code'

Line 14657: 'UPDATE msc_st_wo_task_hierarchy '

14653: p_token_value1 => 'NEXT_WIP_ENTITY_CODE');
14654:
14655: v_sql_stmt := 15;
14656: lv_sql_stmt :=
14657: 'UPDATE msc_st_wo_task_hierarchy '
14658: ||' SET process_flag = '||G_ERROR_FLG||','
14659: ||' error_text = '||''''||lv_message_text||''''
14660: ||' WHERE NEXT_SUPPLY_ID IS NULL'
14661: ||' AND process_flag = '||G_IN_PROCESS

Line 14689: MSC_ST_UTIL.DERIVE_PARTNER_ORG_ID(p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',

14685:
14686: -- Populate organization id
14687:
14688: lv_return :=
14689: MSC_ST_UTIL.DERIVE_PARTNER_ORG_ID(p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',
14690: p_org_partner_name => 'ORGANIZATION_CODE',
14691: p_org_partner_id => 'ORGANIZATION_ID',
14692: p_instance_code => v_instance_code,
14693: p_partner_type => G_ORGANIZATION,

Line 14711: pEntityName => 'MSC_ST_WO_TASK_HIERARCHY',

14707: (ERRBUF => lv_error_text,
14708: RETCODE => lv_return,
14709: pBatchID => NULL,
14710: pInstanceCode => v_instance_code,
14711: pEntityName => 'MSC_ST_WO_TASK_HIERARCHY',
14712: pInstanceID => v_instance_id);
14713:
14714: IF NVL(lv_return,0) <> 0 THEN
14715: RAISE ex_logging_err;

Line 14719: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',

14715: RAISE ex_logging_err;
14716: END IF;
14717: -- Set the process flag as Valid and populate instance_id
14718: lv_return := MSC_ST_UTIL.SET_PROCESS_FLAG
14719: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',
14720: p_instance_id => v_instance_id,
14721: p_instance_code => v_instance_code,
14722: p_process_flag => G_VALID,
14723: p_error_text => lv_error_text,

Line 14734: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',

14730: -- At the end calling the LOG_ERROR for logging all
14731: -- errored out records.
14732:
14733: lv_return := MSC_ST_UTIL.LOG_ERROR
14734: (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY',
14735: p_instance_code => v_instance_code,
14736: p_row => lv_column_names,
14737: p_severity => G_SEV_ERROR,
14738: p_message_text => NULL,

Line 56099: lv_count:= SET_IN_PROCESS (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY', p_company_name_col => FALSE, p_erp_enabled => 'Y');

56095: IF lv_count > 0 Then
56096: prec.CMRO_flag:= SYS_YES;
56097: End IF;
56098:
56099: lv_count:= SET_IN_PROCESS (p_table_name => 'MSC_ST_WO_TASK_HIERARCHY', p_company_name_col => FALSE, p_erp_enabled => 'Y');
56100: IF lv_count > 0 Then
56101: prec.CMRO_flag:= SYS_YES;
56102: End IF;
56103: