DBA Data[Home] [Help]

APPS.CSM_ITEM_INSTANCE_EVENT_PKG dependencies on CSM_ITEM_INSTANCES_ACC

Line 15: g_acc_table_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC';

11: -- --------- ------ ------------------------------------------
12: -- Enter procedure, function bodies as shown below
13:
14: g_table_name1 CONSTANT VARCHAR2(30) := 'CSI_ITEM_INSTANCES';
15: g_acc_table_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC';
16: g_acc_sequence_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC_S';
17: g_publication_item_name1 CONSTANT CSM_ACC_PKG.t_publication_item_list :=
18: CSM_ACC_PKG.t_publication_item_list('CSF_M_ITEM_INSTANCES');
19: g_pk1_name1 CONSTANT VARCHAR2(30) := 'INSTANCE_ID';

Line 16: g_acc_sequence_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC_S';

12: -- Enter procedure, function bodies as shown below
13:
14: g_table_name1 CONSTANT VARCHAR2(30) := 'CSI_ITEM_INSTANCES';
15: g_acc_table_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC';
16: g_acc_sequence_name1 CONSTANT VARCHAR2(30) := 'CSM_ITEM_INSTANCES_ACC_S';
17: g_publication_item_name1 CONSTANT CSM_ACC_PKG.t_publication_item_list :=
18: CSM_ACC_PKG.t_publication_item_list('CSF_M_ITEM_INSTANCES');
19: g_pk1_name1 CONSTANT VARCHAR2(30) := 'INSTANCE_ID';
20: g_pub_item CONSTANT VARCHAR2(30) := 'CSF_M_ITEM_INSTANCES';

Line 34: cursor l_instance_users_csr (p_instance_id csm_item_instances_acc.instance_id%TYPE) is

30: PROCEDURE ITEM_INSTANCE_MDIRTY_U_ECHUSER(p_instance_id IN NUMBER,
31: p_error_msg OUT NOCOPY VARCHAR2,
32: x_return_status IN OUT NOCOPY VARCHAR2)
33: IS
34: cursor l_instance_users_csr (p_instance_id csm_item_instances_acc.instance_id%TYPE) is
35: SELECT access_id, user_id
36: FROM csm_item_instances_acc
37: WHERE instance_id = p_instance_id;
38:

Line 36: FROM csm_item_instances_acc

32: x_return_status IN OUT NOCOPY VARCHAR2)
33: IS
34: cursor l_instance_users_csr (p_instance_id csm_item_instances_acc.instance_id%TYPE) is
35: SELECT access_id, user_id
36: FROM csm_item_instances_acc
37: WHERE instance_id = p_instance_id;
38:
39: BEGIN
40: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 160: UPDATE csm_item_instances_acc

156: OPEN c_parent_instance(p_instance_id );
157: FETCH c_parent_instance INTO l_parent_ins;
158: CLOSE c_parent_instance;
159:
160: UPDATE csm_item_instances_acc
161: SET PARENT_INSTANCE_ID = l_parent_ins,
162: VERSION_LABEL = l_label
163: WHERE USER_ID = p_user_id
164: AND INSTANCE_ID = p_instance_id;

Line 222: CURSOR l_check_instance_ref(l_instance_id csm_item_instances_acc.instance_id%TYPE,

218: IS
219: l_ref_exists NUMBER := 0 ;
220:
221: /** Check if any other SR refers given instance and user*/
222: CURSOR l_check_instance_ref(l_instance_id csm_item_instances_acc.instance_id%TYPE,
223: l_user_id csm_item_instances_acc.user_id%TYPE)
224: IS
225: SELECT 1
226: FROM csm_item_instances_acc a,

Line 223: l_user_id csm_item_instances_acc.user_id%TYPE)

219: l_ref_exists NUMBER := 0 ;
220:
221: /** Check if any other SR refers given instance and user*/
222: CURSOR l_check_instance_ref(l_instance_id csm_item_instances_acc.instance_id%TYPE,
223: l_user_id csm_item_instances_acc.user_id%TYPE)
224: IS
225: SELECT 1
226: FROM csm_item_instances_acc a,
227: cs_incidents_all_b b,

Line 226: FROM csm_item_instances_acc a,

222: CURSOR l_check_instance_ref(l_instance_id csm_item_instances_acc.instance_id%TYPE,
223: l_user_id csm_item_instances_acc.user_id%TYPE)
224: IS
225: SELECT 1
226: FROM csm_item_instances_acc a,
227: cs_incidents_all_b b,
228: csm_incidents_all_acc c
229: WHERE a.instance_id = l_instance_id
230: AND a.user_id = l_user_id

Line 252: -- delete from csm_item_instances_acc

248: END IF ;
249: CLOSE l_check_instance_ref ;
250:
251: IF L_REF_EXISTS <> 1 THEN
252: -- delete from csm_item_instances_acc
253: CSM_ACC_PKG.Delete_Acc
254: ( P_PUBLICATION_ITEM_NAMES => g_publication_item_name1
255: ,P_ACC_TABLE_NAME => g_acc_table_name1
256: ,P_PK1_NAME => g_pk1_name1

Line 309: FROM csm_item_instances_acc acc

305: IS
306: SELECT acc.access_id,
307: acc.user_ID
308: --acc.INSTANCE_ID
309: FROM csm_item_instances_acc acc
310: , csi_item_instances cii
311: , csi_instance_statuses iis
312: , asg_user asg
313: WHERE cii.instance_id = acc.instance_id

Line 329: FROM csm_item_instances_acc acc

325: IS
326: SELECT acc.access_id,
327: acc.user_ID,
328: acc.INSTANCE_ID
329: FROM csm_item_instances_acc acc
330: , csi_item_instances cii
331: , asg_user asg
332: WHERE cii.instance_id = acc.instance_id
333: AND cii.location_type_code = 'INVENTORY'

Line 354: SELECT /* index (acc CSM_ITEM_INSTANCES_ACC_U1) */

350: ;
351: --bug 5184539
352: CURSOR l_iteminstances_upd_csr(p_last_run_date DATE)
353: IS
354: SELECT /* index (acc CSM_ITEM_INSTANCES_ACC_U1) */
355: acc.user_id,
356: --acc.instance_id,
357: acc.access_id
358: FROM csm_item_instances_acc acc,

Line 358: FROM csm_item_instances_acc acc,

354: SELECT /* index (acc CSM_ITEM_INSTANCES_ACC_U1) */
355: acc.user_id,
356: --acc.instance_id,
357: acc.access_id
358: FROM csm_item_instances_acc acc,
359: csi_item_instances cii,
360: asg_user asg
361: WHERE cii.instance_id = acc.instance_id
362: AND asg.user_id = asg.owner_id

Line 370: SELECT CSM_ITEM_INSTANCES_ACC_S.NEXTVAL as access_id,

366:
367: -- get all the trackable items that exists in the csm_mtl_onhand_acc table
368: CURSOR l_ins_item_instances_csr
369: IS
370: SELECT CSM_ITEM_INSTANCES_ACC_S.NEXTVAL as access_id,
371: cqa.user_id,
372: cii.instance_id,
373: civ.version_label,
374: CIR.OBJECT_ID

Line 407: FROM csm_item_instances_acc cia

403: AND (TRUNC(SYSDATE) BETWEEN TRUNC(NVL(CIR.active_start_date,SYSDATE))
404: AND TRUNC(NVL(CIR.active_end_date,SYSDATE)))
405: AND NOT EXISTS
406: ( SELECT 1
407: FROM csm_item_instances_acc cia
408: WHERE cia.user_id = cqa.user_id
409: AND cia.instance_id = cii.instance_id
410: );
411:

Line 423: FROM csm_item_instances_acc ins_acc

419: csi_ii_relationships cii
420: WHERE cii.relationship_id = acc.relationship_id
421: AND NOT EXISTS
422: (SELECT 1
423: FROM csm_item_instances_acc ins_acc
424: WHERE ins_acc.user_id = acc.user_id
425: AND (ins_acc.instance_id = cii.object_id OR ins_acc.instance_id = cii.subject_id)
426: );
427:

Line 461: csm_item_instances_acc iacc

457: cii.relationship_id,
458: cii.subject_id,
459: cii.object_id
460: FROM csi_ii_relationships cii,
461: csm_item_instances_acc iacc
462: WHERE cii.relationship_type_code = 'COMPONENT-OF'
463: AND cii.object_id = iacc.instance_id
464: AND SYSDATE BETWEEN NVL(cii.active_start_date, SYSDATE) AND NVL(cii.active_end_date, SYSDATE)
465: AND NOT EXISTS (SELECT 1 FROM CSM_II_RELATIONSHIPS_ACC ACC

Line 470: TYPE instance_idTab IS TABLE OF csm_item_instances_acc.instance_id%TYPE INDEX BY BINARY_INTEGER;

466: WHERE ACC.user_id = iacc.user_id
467: AND ACC.relationship_id = cii.relationship_id);
468:
469:
470: TYPE instance_idTab IS TABLE OF csm_item_instances_acc.instance_id%TYPE INDEX BY BINARY_INTEGER;
471: TYPE rel_idTab IS TABLE OF csm_ii_relationships_acc.relationship_id%TYPE INDEX BY BINARY_INTEGER;
472: TYPE ver_lab_Tab IS TABLE OF csi_i_version_labels.version_label%TYPE INDEX BY BINARY_INTEGER;
473: l_rel_id_lst rel_idTab;
474: l_user_id_lst asg_download.user_list;

Line 514: DELETE FROM CSM_ITEM_INSTANCES_ACC WHERE ACCESS_ID = l_acc_id_lst(i);

510: );
511:
512: -- do a bulk delete
513: FORALL i IN l_acc_id_lst.FIRST..l_acc_id_lst.LAST
514: DELETE FROM CSM_ITEM_INSTANCES_ACC WHERE ACCESS_ID = l_acc_id_lst(i);
515:
516: COMMIT;--IB Deletes are commited
517: END LOOP;
518: CLOSE l_expiredinstances_del_csr;

Line 556: INSERT INTO CSM_ITEM_INSTANCES_ACC (ACCESS_ID, USER_ID, INSTANCE_ID,

552: CLOSE l_ins_item_instances_csr;
553:
554: IF l_acc_id_lst.COUNT > 0 THEN
555: FORALL i IN l_acc_id_lst.FIRST..l_acc_id_lst.LAST
556: INSERT INTO CSM_ITEM_INSTANCES_ACC (ACCESS_ID, USER_ID, INSTANCE_ID,
557: COUNTER,CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE,
558: LAST_UPDATE_LOGIN,VERSION_LABEL, PARENT_INSTANCE_ID)
559: VALUES (l_acc_id_lst(i), l_user_id_lst(i), l_instance_id_lst(i),
560: 1, 1, l_current_run_date,1,l_current_run_date,

Line 635: UPDATE csm_item_instances_acc

631: l_user_id2_lst.DELETE;
632:
633: --If the relationship are updated then the instance should be updated with the correct parent
634: FORALL i in l_instance_id_lst.FIRST..l_instance_id_lst.LAST
635: UPDATE csm_item_instances_acc
636: SET PARENT_INSTANCE_ID = NULL
637: WHERE USER_ID = l_user_id_lst(i)
638: AND INSTANCE_ID = l_instance_id_lst(i)
639: RETURNING access_id,user_id BULK COLLECT INTO l_acc_id_lst,l_user_id2_lst ; --Bug 14345675

Line 682: UPDATE csm_item_instances_acc

678:
679:
680: --If the relationship are updated then the instance should be updated with the correct parent
681: FORALL i in l_parent_inst_id_lst.FIRST..l_parent_inst_id_lst.LAST
682: UPDATE csm_item_instances_acc
683: SET PARENT_INSTANCE_ID = l_parent_inst_id_lst(i)
684: WHERE USER_ID = l_user_id_lst(i)
685: AND INSTANCE_ID = l_instance_id_lst(i)
686: RETURNING access_id,user_id BULK COLLECT INTO l_acc_id_lst,l_user_id2_lst ; --Bug 14345675

Line 737: UPDATE csm_item_instances_acc

733:
734:
735: --If the relationship are updated then the instance should be updated with the correct parent
736: FORALL i in l_parent_inst_id_lst.FIRST..l_parent_inst_id_lst.LAST
737: UPDATE csm_item_instances_acc
738: SET PARENT_INSTANCE_ID = l_parent_inst_id_lst(i)
739: WHERE USER_ID = l_user_id_lst(i)
740: AND INSTANCE_ID = l_instance_id_lst(i)
741: RETURNING access_id,user_id BULK COLLECT INTO l_acc_id_lst,l_user_id2_lst ; --Bug 14345675

Line 812: FROM CSM_ITEM_INSTANCES_ACC acc, CSI_ITEM_INSTANCES cii

808: p_parent_instance_id NUMBER )
809: IS
810: SELECT acc.instance_id,cii.inventory_item_id inv_item_id ,
811: NVL(cii.LAST_VLD_ORGANIZATION_ID,cii.inv_master_organization_id) org_id
812: FROM CSM_ITEM_INSTANCES_ACC acc, CSI_ITEM_INSTANCES cii
813: WHERE acc.instance_id = cii.instance_id
814: AND acc.user_id = p_user_id
815: AND owner_party_id = p_party_id
816: AND ( ( cii.location_id = p_party_site_id

Line 826: FROM CSM_ITEM_INSTANCES_ACC acc

822: )
823: AND acc.instance_id NOT IN
824: (
825: SELECT acc.instance_id
826: FROM CSM_ITEM_INSTANCES_ACC acc
827: WHERE acc.user_id = p_user_id
828: AND acc.instance_id IN (p_instance_id, p_parent_instance_id)
829: UNION
830: SELECT acc.instance_id

Line 831: FROM CSM_ITEM_INSTANCES_ACC acc

827: WHERE acc.user_id = p_user_id
828: AND acc.instance_id IN (p_instance_id, p_parent_instance_id)
829: UNION
830: SELECT acc.instance_id
831: FROM CSM_ITEM_INSTANCES_ACC acc
832: WHERE acc.user_id = p_user_id
833: AND acc.instance_id IN
834: (
835: SELECT subject_id

Line 858: ( SELECT acc.instance_id FROM CSM_ITEM_INSTANCES_ACC acc

854: WHERE si.inventory_item_id = cii.inventory_item_id
855: AND si.organization_id = NVL( cii.LAST_VLD_ORGANIZATION_ID,
856: cii.inv_master_organization_id )
857: AND cii.instance_id NOT IN
858: ( SELECT acc.instance_id FROM CSM_ITEM_INSTANCES_ACC acc
859: WHERE acc.user_id = p_user_id
860: )
861: AND owner_party_id = p_party_id
862: AND ( ( cii.location_id = p_party_site_id

Line 984: FROM csm_item_instances_acc acc

980: AND cntr_grps.counter_group_id = cntrs.counter_group_id
981: AND cntrs.TYPE = 'REGULAR'
982: -- get only records for the instance belonging to the user
983: AND EXISTS (SELECT 1
984: FROM csm_item_instances_acc acc
985: WHERE acc.user_id = p_user_id
986: AND acc.instance_id = cntr_grps.source_object_id) ;
987:
988: BEGIN

Line 1031: FROM CSM_ITEM_INSTANCES_ACC acc, CSI_ITEM_INSTANCES cii,

1027: p_location_id NUMBER,
1028: p_party_id NUMBER,
1029: p_incident_id NUMBER ) IS
1030: SELECT acc.instance_id
1031: FROM CSM_ITEM_INSTANCES_ACC acc, CSI_ITEM_INSTANCES cii,
1032: csm_incidents_all_acc iacc, cs_incidents_all_b cia
1033: WHERE acc.instance_id = cii.instance_id
1034: AND acc.user_id = p_user_id
1035: AND acc.counter <> 1 -- do not delete if there is just 1 instance of the IB item

Line 1142: TYPE instance_idTab IS TABLE OF csm_item_instances_acc.instance_id%TYPE INDEX BY BINARY_INTEGER;

1138: l_sqlerrmsg VARCHAR2(4000);
1139: l_error_msg VARCHAR2(4000);
1140: l_dummy BOOLEAN;
1141:
1142: TYPE instance_idTab IS TABLE OF csm_item_instances_acc.instance_id%TYPE INDEX BY BINARY_INTEGER;
1143: l_instance_id_lst instance_idTab;
1144: l_user_id_lst asg_download.user_list;
1145: l_acc_id_lst asg_download.access_list;
1146:

Line 1153: FROM csm_item_instances_acc acc

1149: IS
1150: SELECT acc.access_id,
1151: acc.user_ID,
1152: acc.INSTANCE_ID
1153: FROM csm_item_instances_acc acc
1154: , csi_item_instances cii
1155: WHERE cii.instance_id = acc.instance_id
1156: AND cii.location_type_code = 'INVENTORY'
1157: AND cii.inventory_item_id = p_inv_item_id

Line 1194: DELETE CSM_ITEM_INSTANCES_ACC WHERE ACCESS_ID = l_acc_id_lst(i);

1190: );
1191:
1192: -- do a bulk delete
1193: FORALL i IN l_acc_id_lst.FIRST..l_acc_id_lst.LAST
1194: DELETE CSM_ITEM_INSTANCES_ACC WHERE ACCESS_ID = l_acc_id_lst(i);
1195: END IF;
1196:
1197: CSM_UTIL_PKG.LOG('Leaving CSM_ITEM_INSTANCE_EVENT_PKG.DELETE_IB_NOTIN_INV ',
1198: 'CSM_ITEM_INSTANCE_EVENT_PKG.DELETE_IB_NOTIN_INV',FND_LOG.LEVEL_PROCEDURE);