64: x_change_notice VARCHAR2)
65: IS
66: BEGIN
67:
68: delete from MTL_ITEM_REVISIONS_TL
69: where revision_id IN (SELECT revision_id
70: FROM MTL_ITEM_REVISIONS_B
71: WHERE organization_id = x_organization_id
72: and inventory_item_id = x_revised_item_id
66: BEGIN
67:
68: delete from MTL_ITEM_REVISIONS_TL
69: where revision_id IN (SELECT revision_id
70: FROM MTL_ITEM_REVISIONS_B
71: WHERE organization_id = x_organization_id
72: and inventory_item_id = x_revised_item_id
73: and revised_item_sequence_Id = x_revised_item_sequence_id
74: and change_notice = x_change_notice
73: and revised_item_sequence_Id = x_revised_item_sequence_id
74: and change_notice = x_change_notice
75: and implementation_date is null);
76:
77: delete from MTL_ITEM_REVISIONS_B
78: where organization_id = x_organization_id
79: and inventory_item_id = x_revised_item_id
80: and revised_item_sequence_Id = x_revised_item_sequence_id
81: and change_notice = x_change_notice
304: from eng_engineering_changes
305: where change_notice = x_change_notice
306: and organization_id = x_organization_id) and --change_id is required for index
307: revised_item_sequence_id = x_revised_item_sequence_id and
308: entity_name = 'MTL_ITEM_REVISIONS' and
309: pk3_value IN (select revision_id
310: from MTL_ITEM_REVISIONS_B
311: where organization_id = x_organization_id
312: and inventory_item_id = x_inventory_item_id
306: and organization_id = x_organization_id) and --change_id is required for index
307: revised_item_sequence_id = x_revised_item_sequence_id and
308: entity_name = 'MTL_ITEM_REVISIONS' and
309: pk3_value IN (select revision_id
310: from MTL_ITEM_REVISIONS_B
311: where organization_id = x_organization_id
312: and inventory_item_id = x_inventory_item_id
313: and revised_item_sequence_Id = x_revised_item_sequence_id
314: and change_notice = x_change_notice
315: and implementation_date is null);
316:
317:
318:
319: delete from MTL_ITEM_REVISIONS_TL
320: where revision_id IN (select revision_id
321: from MTL_ITEM_REVISIONS_B
322: where organization_id = x_organization_id
323: and inventory_item_id = x_inventory_item_id
317:
318:
319: delete from MTL_ITEM_REVISIONS_TL
320: where revision_id IN (select revision_id
321: from MTL_ITEM_REVISIONS_B
322: where organization_id = x_organization_id
323: and inventory_item_id = x_inventory_item_id
324: and revised_item_sequence_Id = x_revised_item_sequence_id
325: and change_notice = x_change_notice
324: and revised_item_sequence_Id = x_revised_item_sequence_id
325: and change_notice = x_change_notice
326: and implementation_date is null);
327:
328: delete from MTL_ITEM_REVISIONS_B
329: where organization_id = x_organization_id
330: and inventory_item_id =x_inventory_item_id
331: and revised_item_sequence_Id = x_revised_item_sequence_id
332: and change_notice = x_change_notice
389:
390:
391: BEGIN
392: IF (Bom_globals.Get_Caller_Type <> BOM_GLOBALS.G_MASS_CHANGE) THEN -- added for bug 3534567
393: insert into MTL_ITEM_REVISIONS_B (
394: inventory_item_id,
395: organization_id,
396: revision,
397: revision_label,
423: x_change_notice,
424: sysdate,
425: decode(x_scheduled_date, trunc(sysdate), sysdate, x_scheduled_date),
426: x_revised_item_sequence_id,
427: mtl_item_revisions_b_s.NEXTVAL,
428: 1,
429: decode(x_revision_description,FND_API.G_MISS_CHAR,NULL,x_revision_description),
430: decode(p_new_revision_reason_code, FND_API.G_MISS_CHAR, NULL, p_new_revision_reason_code)
431: )RETURNING revision_id INTO l_revision_id;
430: decode(p_new_revision_reason_code, FND_API.G_MISS_CHAR, NULL, p_new_revision_reason_code)
431: )RETURNING revision_id INTO l_revision_id;
432:
433: SELECT userenv('LANG') INTO l_language_code FROM dual;
434: -- description is stored in MTL_ITEM_REVISIONS_TL
435: insert into MTL_ITEM_REVISIONS_TL (
436: inventory_item_id,
437: organization_id,
438: revision_id,
431: )RETURNING revision_id INTO l_revision_id;
432:
433: SELECT userenv('LANG') INTO l_language_code FROM dual;
434: -- description is stored in MTL_ITEM_REVISIONS_TL
435: insert into MTL_ITEM_REVISIONS_TL (
436: inventory_item_id,
437: organization_id,
438: revision_id,
439: language,
459: FROM FND_LANGUAGES lang
460: where lang.INSTALLED_FLAG in ('I', 'B')
461: and not exists
462: (select NULL
463: from MTL_ITEM_REVISIONS_TL T
464: where T.INVENTORY_ITEM_ID = x_inventory_item_id
465: and T.ORGANIZATION_ID = x_organization_id
466: and T.REVISION_ID = l_revision_id
467: and T.LANGUAGE = lang.LANGUAGE_CODE);
544: l_login_id NUMBER := FND_GLOBAL.Login_Id;
545:
546: BEGIN
547:
548: update MTL_ITEM_REVISIONS_B
549: set revision = x_revision,
550: revision_label = x_revision, -- Bug No:3612330 added by sseraphi to update rev label along with rev code.
551: effectivity_date = decode(x_scheduled_date, trunc(sysdate), sysdate, x_scheduled_date),
552: last_update_date = SYSDATE,
559: RETURNING revision_id INTO l_revision_id;
560:
561: SELECT userenv('LANG') INTO l_language_code FROM dual;
562:
563: update MTL_ITEM_REVISIONS_TL
564: set
565: last_update_date = SYSDATE, --who column
566: last_update_login = l_login_id, --who column
567: last_updated_by = l_user_id, --who column
669: * API Name : UPDATE_REVISION_CHANGE_NOTICE
670: * Parameters IN : p_revision_id, p_change_notice
671: * Parameters OUT: None
672: * Purpose : Updates the value of change_notice in the
673: * mtl_item_revisions_b/_tl table with the value passed as parameter
674: * for the row specified.
675: *********************************************************************/
676: PROCEDURE UPDATE_REVISION_CHANGE_NOTICE ( p_revision_id IN NUMBER
677: , p_change_notice IN VARCHAR2
681: l_user_id NUMBER := FND_GLOBAL.User_Id;
682: l_login_id NUMBER := FND_GLOBAL.Login_Id;
683: BEGIN
684:
685: UPDATE MTL_ITEM_REVISIONS_B
686: SET change_notice = p_change_notice,
687: last_update_date = SYSDATE,
688: last_update_login = l_login_id,
689: last_updated_by = l_user_id
692: SELECT userenv('LANG')
693: INTO l_language_code
694: FROM dual;
695:
696: UPDATE MTL_ITEM_REVISIONS_TL
697: SET last_update_date = SYSDATE, --who column
698: last_update_login = l_login_id, --who column
699: last_updated_by = l_user_id, --who column
700: source_lang = l_language_code
719: )
720: IS
721: CURSOR c_check_revision_id IS
722: SELECT 1
723: FROM mtl_item_revisions
724: WHERE revision_id = p_revision_id
725: AND inventory_item_id = p_revised_item_id
726: AND organization_id = p_organization_id;
727: