DBA Data[Home] [Help]

APPS.AHL_MC_ITEM_COMP_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 10

PROCEDURE Update_Line_Item (p_item_composition_id IN NUMBER,
	p_x_comp_det_rec IN OUT NOCOPY AHL_MC_ITEM_COMP_PVT.Detail_Rec_Type
);
Line: 14

PROCEDURE Delete_Line_Item (p_item_composition_id IN NUMBER,
	p_x_comp_det_rec IN OUT NOCOPY AHL_MC_ITEM_COMP_PVT.Detail_Rec_Type
);
Line: 27

     SELECT NVL(comms_nl_trackable_flag,'N'), concatenated_segments,
            SERIAL_NBR_CNTRL_CODE,revision_qty_cntrl_code
     FROM  ahl_mtl_items_non_ou_v
     WHERE inventory_item_id = p_inventory_item_id
     AND   inventory_org_id = p_inventory_org_id;
Line: 35

     SELECT organization_code,
            master_organization_id
     FROM mtl_parameters
     WHERE organization_id = p_inventory_org_id;
Line: 117

select uom_code
from   mtl_units_of_measure_vl
where  uom_code = p_uom_code;
Line: 208

SELECT 'x'
FROM   ahl_item_groups_vl
WHERE  item_group_id = p_item_group_id
AND    name = p_item_group_name
AND    type_code = 'NON-TRACKED'
AND    status_code = 'COMPLETE';
Line: 218

SELECT 'x'
FROM AHL_ITEM_COMP_DETAILS
WHERE ITEM_GROUP_ID = p_item_group_id
AND ITEM_COMPOSITION_ID= p_item_composition_id
AND EFFECTIVE_END_DATE is null;
Line: 228

SELECT 'x'
FROM AHL_ITEM_COMP_DETAILS
WHERE INVENTORY_ITEM_ID = p_inventory_item_id
AND INVENTORY_MASTER_ORG_ID = 	p_inventory_master_org_id
AND ITEM_COMPOSITION_ID= p_item_composition_id
AND EFFECTIVE_END_DATE is null;
Line: 239

SELECT 'x'
FROM AHL_ITEM_COMP_DETAILS
WHERE item_comp_detail_id = p_item_comp_detail_id
AND item_composition_id= p_item_composition_id;
Line: 412

 SELECT 'x'
   FROM AHL_ITEM_COMPOSITIONS
   WHERE INVENTORY_ITEM_ID = p_inventory_item_id
   AND  INVENTORY_MASTER_ORG_ID = p_master_org_id;
Line: 464

  Select AHL_ITEM_COMPOSITIONS_S.NEXTVAL
  INTO l_item_composition_id
  FROM DUAL;
Line: 470

INSERT INTO AHL_ITEM_COMPOSITIONS(
	ITEM_COMPOSITION_ID    ,
	INVENTORY_ITEM_ID      ,
	INVENTORY_MASTER_ORG_ID,
	DRAFT_FLAG             ,
	APPROVAL_STATUS_CODE   ,
	EFFECTIVE_END_DATE     ,
	LINK_COMP_ID           ,
	LAST_UPDATE_DATE       ,
	LAST_UPDATED_BY        ,
	CREATION_DATE          ,
	CREATED_BY             ,
	LAST_UPDATE_LOGIN      ,
	OBJECT_VERSION_NUMBER  ,
	SECURITY_GROUP_ID      ,
	ATTRIBUTE_CATEGORY     ,
	ATTRIBUTE1             ,
	ATTRIBUTE2             ,
	ATTRIBUTE3             ,
	ATTRIBUTE4             ,
	ATTRIBUTE5             ,
	ATTRIBUTE6             ,
	ATTRIBUTE7             ,
	ATTRIBUTE8             ,
	ATTRIBUTE9             ,
	ATTRIBUTE10            ,
	ATTRIBUTE11            ,
	ATTRIBUTE12            ,
	ATTRIBUTE13            ,
	ATTRIBUTE14            ,
	ATTRIBUTE15            )

	VALUES
	(
	 l_item_composition_id,
	 p_x_ic_header_rec.INVENTORY_ITEM_ID  ,
	 p_x_ic_header_rec.INVENTORY_MASTER_ORG_ID,
	 'N',
	 'DRAFT',
	 NULL,
	 NULL,
	 sysdate,
	 l_user_id,
	 sysdate,
	 l_user_id ,
	 to_number(fnd_global.LOGIN_ID) ,
	 1	,
	 NULL,
	 p_x_ic_header_rec.ATTRIBUTE_CATEGORY,
	 p_x_ic_header_rec.ATTRIBUTE1,
	 p_x_ic_header_rec.ATTRIBUTE2,
	 p_x_ic_header_rec.ATTRIBUTE3,
	 p_x_ic_header_rec.ATTRIBUTE4,
	 p_x_ic_header_rec.ATTRIBUTE5,
	 p_x_ic_header_rec.ATTRIBUTE6,
	 p_x_ic_header_rec.ATTRIBUTE7,
	 p_x_ic_header_rec.ATTRIBUTE8,
	 p_x_ic_header_rec.ATTRIBUTE9,
	 p_x_ic_header_rec.ATTRIBUTE10,
	 p_x_ic_header_rec.ATTRIBUTE11,
	 p_x_ic_header_rec.ATTRIBUTE12,
	 p_x_ic_header_rec.ATTRIBUTE13,
	 p_x_ic_header_rec.ATTRIBUTE14,
	 p_x_ic_header_rec.ATTRIBUTE15);
Line: 678

 SELECT
	item_composition_id    ,
	inventory_item_id      ,
	inventory_master_org_id,
	draft_flag             ,
	approval_status_code   ,
	effective_end_date     ,
	link_comp_id           ,
	last_update_date       ,
	last_updated_by        ,
	creation_date          ,
	created_by             ,
	last_update_login      ,
	object_version_number  ,
	security_group_id      ,
        sourced_from_enigma_flag,
	attribute_category     ,
	attribute1             ,
	attribute2             ,
	attribute3             ,
	attribute4             ,
	attribute5             ,
	attribute6             ,
	attribute7             ,
	attribute8             ,
	attribute9             ,
	attribute10            ,
	attribute11            ,
	attribute12            ,
	attribute13            ,
	attribute14            ,
	attribute15
   FROM AHL_ITEM_COMPOSITIONS
   WHERE ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 776

UPDATE AHL_ITEM_COMPOSITIONS
SET
	APPROVAL_STATUS_CODE  = l_item_composition_rec.approval_status_code ,
	LAST_UPDATE_DATE      = sysdate,
	LAST_UPDATED_BY        = to_number(fnd_global.USER_ID),
	LAST_UPDATE_LOGIN     =to_number(fnd_global.LOGIN_ID) ,
	OBJECT_VERSION_NUMBER  = OBJECT_VERSION_NUMBER+1,
	SECURITY_GROUP_ID      =NULL,
	ATTRIBUTE_CATEGORY     = p_x_ic_header_rec.ATTRIBUTE_CATEGORY,
	ATTRIBUTE1             = p_x_ic_header_rec.ATTRIBUTE1,
	ATTRIBUTE2             = p_x_ic_header_rec.ATTRIBUTE2,
	ATTRIBUTE3             = p_x_ic_header_rec.ATTRIBUTE3,
	ATTRIBUTE4             = p_x_ic_header_rec.ATTRIBUTE4,
	ATTRIBUTE5             = p_x_ic_header_rec.ATTRIBUTE5,
	ATTRIBUTE6             = p_x_ic_header_rec.ATTRIBUTE6,
	ATTRIBUTE7             = p_x_ic_header_rec.ATTRIBUTE7,
	ATTRIBUTE8             = p_x_ic_header_rec.ATTRIBUTE8,
	ATTRIBUTE9             = p_x_ic_header_rec.ATTRIBUTE9,
	ATTRIBUTE10            = p_x_ic_header_rec.ATTRIBUTE10,
	ATTRIBUTE11            = p_x_ic_header_rec.ATTRIBUTE11,
	ATTRIBUTE12            = p_x_ic_header_rec.ATTRIBUTE12,
	ATTRIBUTE13            = p_x_ic_header_rec.ATTRIBUTE13,
	ATTRIBUTE14            = p_x_ic_header_rec.ATTRIBUTE14,
	ATTRIBUTE15            = p_x_ic_header_rec.ATTRIBUTE15
  WHERE  ITEM_COMPOSITION_ID = 	 p_x_ic_header_rec.ITEM_COMPOSITION_ID
  AND OBJECT_VERSION_NUMBER =  	 p_x_ic_header_rec.object_version_number;
Line: 826

	Update_Line_Item (p_item_composition_id => p_x_ic_header_rec.ITEM_COMPOSITION_ID,
			p_x_comp_det_rec => p_x_det_tbl(I)
	);
Line: 833

	Delete_Line_Item (p_item_composition_id => p_x_ic_header_rec.ITEM_COMPOSITION_ID,
			p_x_comp_det_rec => p_x_det_tbl(I)
	);
Line: 932

PROCEDURE Delete_Item_Composition (
	p_api_version         IN NUMBER,
	p_init_msg_list       IN VARCHAR2  := FND_API.G_FALSE,
	p_commit              IN VARCHAR2  := FND_API.G_FALSE,
	p_validation_level    IN NUMBER    := FND_API.G_VALID_LEVEL_FULL,
	x_return_status       OUT NOCOPY        VARCHAR2,
	x_msg_count           OUT NOCOPY        NUMBER,
	x_msg_data            OUT NOCOPY        VARCHAR2,
	p_item_composition_ID IN NUMBER ,
	p_object_version_number IN NUMBER
)

AS

CURSOR item_composition_det(p_item_composition_id IN NUMBER)
IS
 SELECT
	item_composition_id    ,
	inventory_item_id      ,
	inventory_master_org_id,
	draft_flag             ,
	approval_status_code   ,
	effective_end_date     ,
	link_comp_id           ,
	last_update_date       ,
	last_updated_by        ,
	creation_date          ,
	created_by             ,
	last_update_login      ,
	object_version_number  ,
	security_group_id      ,
	attribute_category     ,
	attribute1             ,
	attribute2             ,
	attribute3             ,
	attribute4             ,
	attribute5             ,
	attribute6             ,
	attribute7             ,
	attribute8             ,
	attribute9             ,
	attribute10            ,
	attribute11            ,
	attribute12            ,
	attribute13            ,
	attribute14            ,
	attribute15
   FROM AHL_ITEM_COMPOSITIONS
   WHERE ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 988

 SELECT 'x'
  FROM ahl_route_effectivities re, AHL_ITEM_COMP_V icd
 WHERE icd.ITEM_COMPOSITION_ID = p_item_composition_id
   AND re.inventory_item_id = ICD.inventory_item_id
   AND re.INVENTORY_MASTER_ORG_ID = ICD.INVENTORY_MASTER_ORG_ID
   AND ICD.APPROVAL_STATUS_CODE = 'COMPLETE';
Line: 997

   SELECT item_composition_id
   FROM   AHL_ITEM_COMPOSITIONS
   WHERE  link_comp_id = p_item_composition_id;
Line: 1009

       SAVEPOINT  Delete_Item_Composition;
Line: 1025

     	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', 'Begin of Delete_Item_Composition');
Line: 1049

        FND_MESSAGE.Set_Name('AHL','AHL_MC_COMP_STATUS_NO_DELETE');
Line: 1087

        FND_MESSAGE.Set_Name('AHL','AHL_MC_COMP_STATUS_NO_DELETE');
Line: 1094

UPDATE AHL_ITEM_COMPOSITIONS
SET
	LAST_UPDATE_DATE      = sysdate,
	LAST_UPDATED_BY        = to_number(fnd_global.USER_ID),
	LAST_UPDATE_LOGIN     =to_number(fnd_global.LOGIN_ID) ,
	OBJECT_VERSION_NUMBER  = OBJECT_VERSION_NUMBER+1,
	SECURITY_GROUP_ID      =NULL,
        EFFECTIVE_END_DATE     = sysdate -1
  WHERE  ITEM_COMPOSITION_ID = 	 p_item_composition_ID
  AND OBJECT_VERSION_NUMBER =  	 p_object_version_number;
Line: 1109

DELETE FROM AHL_ITEM_COMP_DETAILS
WHERE ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 1112

DELETE FROM AHL_ITEM_COMPOSITIONS
WHERE ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 1122

     	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', 'End of Delete_Item_Composition');
Line: 1128

    Rollback to Delete_Item_Composition;
Line: 1136

      	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', 'Error in Delete_Item_Composition');
Line: 1142

    Rollback to Delete_Item_Composition;
Line: 1150

      	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', 'Unexpected Error in Delete_Item_Composition');
Line: 1155

     Rollback to Delete_Item_Composition;
Line: 1158

                                p_procedure_name => 'Delete_Item_Composition',
                                p_error_text     => SUBSTR(SQLERRM,1,240));
Line: 1168

      	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', 'Unknown Error in Delete_Item_Composition');
Line: 1170

      	     'ahl.plsql.'||G_PKG_NAME||'.Delete_Item_Composition', SQLERRM);
Line: 1175

END Delete_Item_Composition;
Line: 1217

 SELECT
	item_composition_id    ,
	inventory_item_id      ,
	inventory_master_org_id,
	draft_flag             ,
	approval_status_code   ,
	effective_end_date     ,
	link_comp_id           ,
	last_update_date       ,
	last_updated_by        ,
	creation_date          ,
	created_by             ,
	last_update_login      ,
	object_version_number  ,
	security_group_id      ,
	attribute_category     ,
	attribute1             ,
	attribute2             ,
	attribute3             ,
	attribute4             ,
	attribute5             ,
	attribute6             ,
	attribute7             ,
	attribute8             ,
	attribute9             ,
	attribute10            ,
	attribute11            ,
	attribute12            ,
	attribute13            ,
	attribute14            ,
	attribute15
   FROM AHL_ITEM_COMPOSITIONS
   WHERE ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 1255

   SELECT 'x'
   FROM   AHL_ITEM_COMPOSITIONS
   WHERE inventory_item_id = p_inv_item_id
   AND   inventory_master_org_id = p_inv_master_org_id
   AND TRUNC(NVL(EFFECTIVE_END_DATE,sysdate)) >= TRUNC(sysdate);
Line: 1335

UPDATE AHL_ITEM_COMPOSITIONS
SET
	LAST_UPDATE_DATE      = sysdate,
	LAST_UPDATED_BY        = to_number(fnd_global.USER_ID),
	LAST_UPDATE_LOGIN     =to_number(fnd_global.LOGIN_ID) ,
	OBJECT_VERSION_NUMBER  = OBJECT_VERSION_NUMBER+1,
	SECURITY_GROUP_ID      =NULL,
        EFFECTIVE_END_DATE     = null
  WHERE  ITEM_COMPOSITION_ID = 	 p_item_composition_ID
  AND OBJECT_VERSION_NUMBER =  	 p_object_version_number;
Line: 1417

SELECT AHL_ITEM_COMP_DETAILS_S.NEXTVAL
INTO  l_item_comp_detail_id
FROM DUAL;
Line: 1425

	INSERT INTO AHL_ITEM_COMP_DETAILS(
		ITEM_COMP_DETAIL_ID    ,
		ITEM_COMPOSITION_ID    ,
		ITEM_GROUP_ID          ,
		INVENTORY_ITEM_ID      ,
		INVENTORY_MASTER_ORG_ID,
		UOM_CODE                    ,
		QUANTITY               ,
		EFFECTIVE_END_DATE     ,
		LINK_COMP_DETL_ID      ,
		LAST_UPDATE_DATE       ,
		LAST_UPDATED_BY        ,
		CREATION_DATE          ,
		CREATED_BY             ,
		LAST_UPDATE_LOGIN      ,
		OBJECT_VERSION_NUMBER  ,
		SECURITY_GROUP_ID      ,
		ATTRIBUTE_CATEGORY     ,
		ATTRIBUTE1             ,
		ATTRIBUTE2             ,
		ATTRIBUTE3             ,
		ATTRIBUTE4             ,
		ATTRIBUTE5             ,
		ATTRIBUTE6             ,
		ATTRIBUTE7             ,
		ATTRIBUTE8             ,
		ATTRIBUTE9             ,
		ATTRIBUTE10            ,
		ATTRIBUTE11            ,
		ATTRIBUTE12            ,
		ATTRIBUTE13            ,
		ATTRIBUTE14            ,
		ATTRIBUTE15            )

	VALUES
	(
		l_item_comp_detail_id  ,
		p_item_composition_id ,
		p_x_comp_det_rec.ITEM_GROUP_ID  ,
		p_x_comp_det_rec.INVENTORY_ITEM_ID  ,
		p_x_comp_det_rec.INVENTORY_MASTER_ORG_ID,
		p_x_comp_det_rec.UOM_CODE                    ,
		p_x_comp_det_rec.QUANTITY               ,
		NULL ,
		NULL,
		sysdate,
		l_user_id        ,
		sysdate,
		l_user_id,
		to_number(fnd_global.LOGIN_ID),
		1,
		NULL,
		p_x_comp_det_rec.ATTRIBUTE_CATEGORY     ,
		p_x_comp_det_rec.ATTRIBUTE1             ,
		p_x_comp_det_rec.ATTRIBUTE2             ,
		p_x_comp_det_rec.ATTRIBUTE3             ,
		p_x_comp_det_rec.ATTRIBUTE4             ,
		p_x_comp_det_rec.ATTRIBUTE5             ,
		p_x_comp_det_rec.ATTRIBUTE6             ,
		p_x_comp_det_rec.ATTRIBUTE7             ,
		p_x_comp_det_rec.ATTRIBUTE8             ,
		p_x_comp_det_rec.ATTRIBUTE9             ,
		p_x_comp_det_rec.ATTRIBUTE10            ,
		p_x_comp_det_rec.ATTRIBUTE11            ,
		p_x_comp_det_rec.ATTRIBUTE12            ,
		p_x_comp_det_rec.ATTRIBUTE13            ,
		p_x_comp_det_rec.ATTRIBUTE14            ,
		p_x_comp_det_rec.ATTRIBUTE15
	) RETURNING
		ITEM_COMP_DETAIL_ID    ,
		ITEM_COMPOSITION_ID
	  INTO
	        p_x_comp_det_rec.ITEM_COMP_DETAIL_ID,
	        p_x_comp_det_rec.ITEM_COMPOSITION_ID
	  ;
Line: 1508

PROCEDURE Update_Line_Item (p_item_composition_id IN NUMBER,
	p_x_comp_det_rec IN OUT NOCOPY AHL_MC_ITEM_COMP_PVT.Detail_Rec_Type
)

AS

BEGIN

	UPDATE AHL_ITEM_COMP_DETAILS
	SET
		ITEM_GROUP_ID           =p_x_comp_det_rec.ITEM_GROUP_ID,
		INVENTORY_ITEM_ID       =p_x_comp_det_rec.INVENTORY_ITEM_ID,
		INVENTORY_MASTER_ORG_ID = p_x_comp_det_rec.INVENTORY_MASTER_ORG_ID,
		UOM_CODE                =p_x_comp_det_rec.UOM_CODE    ,
		QUANTITY                =p_x_comp_det_rec.QUANTITY,
		LAST_UPDATE_DATE       =sysdate,
		LAST_UPDATED_BY        = to_number(fnd_global.USER_ID),
		LAST_UPDATE_LOGIN      = to_number(fnd_global.LOGIN_ID),
		OBJECT_VERSION_NUMBER  =object_version_number+1,
		SECURITY_GROUP_ID      =NULL,
		ATTRIBUTE_CATEGORY     =p_x_comp_det_rec.ATTRIBUTE_CATEGORY,
		ATTRIBUTE1             =p_x_comp_det_rec.ATTRIBUTE1,
		ATTRIBUTE2             =p_x_comp_det_rec.ATTRIBUTE2,
		ATTRIBUTE3             =p_x_comp_det_rec.ATTRIBUTE3,
		ATTRIBUTE4             =p_x_comp_det_rec.ATTRIBUTE4,
		ATTRIBUTE5             =p_x_comp_det_rec.ATTRIBUTE5,
		ATTRIBUTE6             =p_x_comp_det_rec.ATTRIBUTE6,
		ATTRIBUTE7             =p_x_comp_det_rec.ATTRIBUTE7,
		ATTRIBUTE8             =p_x_comp_det_rec.ATTRIBUTE8,
		ATTRIBUTE9             =p_x_comp_det_rec.ATTRIBUTE9,
		ATTRIBUTE10            =p_x_comp_det_rec.ATTRIBUTE10,
		ATTRIBUTE11            =p_x_comp_det_rec.ATTRIBUTE11,
		ATTRIBUTE12            =p_x_comp_det_rec.ATTRIBUTE12,
		ATTRIBUTE13            =p_x_comp_det_rec.ATTRIBUTE13,
		ATTRIBUTE14            =p_x_comp_det_rec.ATTRIBUTE14,
		ATTRIBUTE15            =p_x_comp_det_rec.ATTRIBUTE15
		WHERE
		ITEM_COMP_DETAIL_ID  =  p_x_comp_det_rec.item_comp_detail_id
		AND ITEM_COMPOSITION_ID  =  p_item_composition_id ;
Line: 1549

END Update_Line_Item;
Line: 1553

PROCEDURE Delete_Line_Item (p_item_composition_id IN NUMBER,
	p_x_comp_det_rec IN OUT NOCOPY AHL_MC_ITEM_COMP_PVT.Detail_Rec_Type
)

AS

BEGIN

DELETE FROM AHL_ITEM_COMP_DETAILS
WHERE ITEM_COMP_DETAIL_ID = p_x_comp_det_rec.item_comp_detail_id
AND ITEM_COMPOSITION_ID = p_item_composition_id;
Line: 1566

END Delete_Line_Item;
Line: 1636

 Select item_composition_id,
 	approval_status_code,
	object_version_number,
	concatenated_segments
 From   ahl_item_comp_v
 Where  item_composition_id = c_item_comp_id;
Line: 1685

        Select count(*)
          into l_count
          from ahl_item_comp_details
         where item_composition_id = p_Item_Composition_id;
Line: 1708

		select count(*)
		  into l_count
	          from ahl_item_comp_details
	         where item_composition_id = p_Item_Composition_id;
Line: 1754

               Update  ahl_item_compositions
               Set APPROVAL_STATUS_CODE=l_upd_status,
               OBJECT_VERSION_NUMBER=OBJECT_VERSION_NUMBER+1
               Where ITEM_COMPOSITION_ID = p_Item_Composition_id
               and OBJECT_VERSION_NUMBER=p_object_Version_number;
Line: 1931

 Select
        item_composition_id,
        approval_status_code,
        draft_flag,
        inventory_item_id,
	inventory_master_org_id,
        effective_end_date,
        object_version_number
 from   ahl_item_compositions
 Where item_composition_id = c_item_comp_id;
Line: 1947

 Select 'x'
 from   ahl_item_compositions
 where  link_comp_id = c_item_comp_id;
Line: 1955

	l_last_update_login NUMBER;
Line: 1956

	l_last_updated_by   NUMBER;
Line: 2030

 l_last_updated_by := to_number(fnd_global.USER_ID);
Line: 2031

 l_last_update_login := to_number(fnd_global.LOGIN_ID);
Line: 2035

  Select AHL_ITEM_COMPOSITIONS_S.NEXTVAL
  INTO l_item_composition_id
  FROM DUAL;
Line: 2040

INSERT INTO AHL_ITEM_COMPOSITIONS(
	ITEM_COMPOSITION_ID    ,
	INVENTORY_ITEM_ID      ,
	INVENTORY_MASTER_ORG_ID,
	DRAFT_FLAG             ,
	APPROVAL_STATUS_CODE   ,
	EFFECTIVE_END_DATE     ,
	LINK_COMP_ID           ,
	LAST_UPDATE_DATE       ,
	LAST_UPDATED_BY        ,
	CREATION_DATE          ,
	CREATED_BY             ,
	LAST_UPDATE_LOGIN      ,
	OBJECT_VERSION_NUMBER  ,
	SECURITY_GROUP_ID      ,
	ATTRIBUTE_CATEGORY     ,
	ATTRIBUTE1             ,
	ATTRIBUTE2             ,
	ATTRIBUTE3             ,
	ATTRIBUTE4             ,
	ATTRIBUTE5             ,
	ATTRIBUTE6             ,
	ATTRIBUTE7             ,
	ATTRIBUTE8             ,
	ATTRIBUTE9             ,
	ATTRIBUTE10            ,
	ATTRIBUTE11            ,
	ATTRIBUTE12            ,
	ATTRIBUTE13            ,
	ATTRIBUTE14            ,
	ATTRIBUTE15            )

SELECT l_item_composition_id,
	inventory_item_id      ,
	inventory_master_org_id,
	draft_flag             ,
	'DRAFT'   ,
	effective_end_date     ,
	p_Item_comp_id           ,
	sysdate       ,
	l_last_updated_by        ,
	sysdate          ,
	l_created_by             ,
	l_last_update_login      ,
	1  ,
	security_group_id      ,
	attribute_category     ,
	attribute1             ,
	attribute2             ,
	attribute3             ,
	attribute4             ,
	attribute5             ,
	attribute6             ,
	attribute7             ,
	attribute8             ,
	attribute9             ,
	attribute10            ,
	attribute11            ,
	attribute12            ,
	attribute13            ,
	attribute14            ,
	attribute15
FROM   ahl_item_compositions
WHERE item_composition_id = p_Item_comp_id
AND   object_version_number = p_object_version_number
AND   effective_end_date is null;
Line: 2116

	INSERT INTO AHL_ITEM_COMP_DETAILS(
		ITEM_COMP_DETAIL_ID    ,
		ITEM_COMPOSITION_ID    ,
		ITEM_GROUP_ID          ,
		INVENTORY_ITEM_ID      ,
		INVENTORY_MASTER_ORG_ID,
		UOM_CODE                    ,
		QUANTITY               ,
		EFFECTIVE_END_DATE     ,
		LINK_COMP_DETL_ID      ,
		LAST_UPDATE_DATE       ,
		LAST_UPDATED_BY        ,
		CREATION_DATE          ,
		CREATED_BY             ,
		LAST_UPDATE_LOGIN      ,
		OBJECT_VERSION_NUMBER  ,
		SECURITY_GROUP_ID      ,
		ATTRIBUTE_CATEGORY     ,
		ATTRIBUTE1             ,
		ATTRIBUTE2             ,
		ATTRIBUTE3             ,
		ATTRIBUTE4             ,
		ATTRIBUTE5             ,
		ATTRIBUTE6             ,
		ATTRIBUTE7             ,
		ATTRIBUTE8             ,
		ATTRIBUTE9             ,
		ATTRIBUTE10            ,
		ATTRIBUTE11            ,
		ATTRIBUTE12            ,
		ATTRIBUTE13            ,
		ATTRIBUTE14            ,
		ATTRIBUTE15            )

 SELECT       	AHL_ITEM_COMP_DETAILS_S.NEXTVAL ,
		l_item_composition_id    ,
		item_group_id          ,
		inventory_item_id      ,
		inventory_master_org_id,
		uom_code                    ,
		quantity               ,
		effective_end_date     ,
		item_comp_detail_id      ,
		sysdate       ,
		l_last_updated_by        ,
		sysdate          ,
		l_created_by             ,
		l_last_update_login      ,
		1  ,
		security_group_id      ,
		attribute_category     ,
		attribute1             ,
		attribute2             ,
		attribute3             ,
		attribute4             ,
		attribute5             ,
		attribute6             ,
		attribute7             ,
		attribute8             ,
		attribute9             ,
		attribute10            ,
		attribute11            ,
		attribute12            ,
		attribute13            ,
		attribute14            ,
		attribute15
FROM ahl_item_comp_details
WHERE item_composition_id = p_Item_comp_id
AND   effective_end_date is null;
Line: 2188

	UPDATE ahl_item_compositions
	SET 	DRAFT_FLAG = 'Y',
		LAST_UPDATE_DATE      = sysdate,
		LAST_UPDATED_BY       = to_number(fnd_global.USER_ID),
		LAST_UPDATE_LOGIN     =to_number(fnd_global.LOGIN_ID),
		OBJECT_VERSION_NUMBER = OBJECT_VERSION_NUMBER+1,
		SECURITY_GROUP_ID     =NULL
	WHERE item_composition_id = p_Item_comp_id
	AND   object_version_number = p_object_version_number;
Line: 2314

   Is  Select
        item_composition_id,
        approval_status_code,
        draft_flag,
        link_comp_id,
        inventory_item_id,
	inventory_master_org_id,
        effective_end_date,
        object_version_number ,
	-- manisaga added the following code for DFF implemenataion on 19-Feb-2010  -- start
	attribute_category,
        attribute1,
        attribute2,
        attribute3,
        attribute4,
        attribute5,
        attribute6,
        attribute7,
        attribute8,
        attribute9,
        attribute10,
        attribute11,
        attribute12,
        attribute13,
        attribute14,
        attribute15
     -- manisaga added the following code for DFF implemenataion on 19-Feb-2010  -- End

 from   ahl_item_compositions
 Where item_composition_id = c_item_comp_id;
Line: 2446

	        -- Insert record into histroy table.



         IF l_item_comp_det.link_comp_id IS NULL THEN

		 IF ( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL )
			   THEN
			     FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
			     'ahl.plsql.ahl_mc_itemgroup_pvt.Approve_Item_Composiiton', 'link_comp_id is null');
Line: 2459

             update  ahl_item_compositions
	        set approval_status_code=l_status,
	            object_version_number = object_version_number+1
	      where item_composition_id=l_item_comp_det.item_composition_id
	        and object_version_number = l_item_comp_det.object_version_number;
Line: 2477

		select
			item_group_id          ,
			inventory_item_id      ,
			inventory_master_org_id,
			uom_code               ,
			quantity               ,
			link_comp_detl_id      ,
			object_version_number  ,
			 -- manisaga added these attributes for DFF implementation om 22-Feb-2010  -- Start
			attribute_category     ,
                        attribute1             ,
                        attribute2             ,
                        attribute3             ,
                        attribute4             ,
                        attribute5             ,
                        attribute6             ,
                        attribute7             ,
                        attribute8             ,
                        attribute9             ,
                        attribute10            ,
                        attribute11            ,
                        attribute12            ,
                        attribute13            ,
                        attribute14            ,
                        attribute15
		     -- manisaga added these attributes for DFF implementation om 22-Feb-2010  -- End

		bulk collect
		into
			l_item_group_id          ,
			l_inventory_item_id      ,
			l_inventory_master_org_id,
			l_uom_code               ,
			l_quantity               ,
			l_link_comp_detl_id      ,
			l_object_version_number  ,
			  -- manisaga added these attributes for DFF implementation om 22-Feb-2010  -- Start
		        l_attribute_category     ,
                        l_attribute1             ,
                        l_attribute2             ,
                        l_attribute3             ,
                        l_attribute4             ,
                        l_attribute5             ,
                        l_attribute6             ,
                        l_attribute7             ,
                        l_attribute8             ,
                        l_attribute9             ,
                        l_attribute10            ,
                        l_attribute11            ,
                        l_attribute12            ,
                        l_attribute13            ,
                        l_attribute14            ,
                        l_attribute15
		     -- manisaga added these attributes for DFF implementation om 22-Feb-2010  -- End

		from   ahl_item_comp_details
		where item_composition_id =  l_item_comp_det.item_composition_id
		and  link_comp_detl_id is not null
		and effective_end_date is null;
Line: 2539

      update ahl_item_comp_details set
      			uom_code               	=l_uom_code(I),
      			quantity               	=l_quantity(I),
      			last_update_date        = sysdate,
      			last_updated_by         = to_number(fnd_global.user_id),
      			last_update_login       = to_number(fnd_global.login_id),
      			object_version_number  	=l_object_version_number(I)+1 ,
			   -- manisaga added attributes for DFF implementation on 22-Feb-2010  -- Start
			attribute_category      = l_attribute_category(I),
                        attribute1              = l_attribute1(I),
                        attribute2              = l_attribute2(I),
                        attribute3              = l_attribute3(I),
                        attribute4              = l_attribute4(I),
                        attribute5              = l_attribute5(I),
                        attribute6              = l_attribute6(I),
                        attribute7              = l_attribute7(I),
                        attribute8              = l_attribute8(I),
                        attribute9              = l_attribute9(I),
                        attribute10             = l_attribute10(I),
                        attribute11             = l_attribute11(I),
                        attribute12             = l_attribute12(I),
                        attribute13             = l_attribute13(I),
                        attribute14             = l_attribute14(I),
                        attribute15             = l_attribute15(I)
                     -- manisaga added attributes for DFF implementation on 22-Feb-2010  -- End

	where ITEM_COMP_DETAIL_ID  = l_link_comp_detl_id(I)
	and   item_composition_id =   l_item_comp_det.LINK_COMP_ID
	and NVL(item_group_id,-3)   = NVL(l_item_group_id(I),-3)
	and NVL(inventory_item_id,-3) = NVL(l_inventory_item_id(I),-3)
	and NVL(inventory_master_org_id,-3)= NVL(l_inventory_master_org_id(I),-3)
	and effective_end_date is null;
Line: 2573

	Update ahl_item_comp_details
		   Set  effective_end_date = sysdate-1,
			last_update_date       =sysdate,
			last_updated_by        = to_number(fnd_global.user_id),
			last_update_login      = to_number(fnd_global.login_id),
			object_version_number  =object_version_number+1
		Where  item_composition_id=l_item_comp_det.link_comp_id
		and   effective_end_date is null
		and   ITEM_COMP_DETAIL_ID  not in (
		      Select link_comp_detl_id
		      from ahl_item_comp_details
		      where item_composition_id = l_item_comp_det.item_composition_id
		      and link_comp_detl_id is not null);
Line: 2588

		Update ahl_item_comp_details
		   Set item_composition_id = l_item_comp_det.link_comp_id,
			last_update_date       =sysdate,
			last_updated_by        = to_number(fnd_global.user_id),
			last_update_login      = to_number(fnd_global.login_id),
			object_version_number  =object_version_number+1
		Where  item_composition_id=l_item_comp_det.item_composition_id
		and   link_comp_detl_id is null;
Line: 2598

        Update ahl_item_compositions
           Set 	last_update_date       =sysdate,
		last_updated_by        = to_number(fnd_global.user_id),
		last_update_login      = to_number(fnd_global.login_id),
		object_version_number  =object_version_number+1 ,
		        -- manisaga added attributes for DFF implementation on 22-Feb-2010  -- Start
		attribute_category     = l_item_comp_det.attribute_category,
		attribute1             = l_item_comp_det.attribute1,
		attribute2             = l_item_comp_det.attribute2,
		attribute3             = l_item_comp_det.attribute3,
		attribute4             = l_item_comp_det.attribute4,
		attribute5             = l_item_comp_det.attribute5,
		attribute6             = l_item_comp_det.attribute6,
		attribute7             = l_item_comp_det.attribute7,
		attribute8             = l_item_comp_det.attribute8,
		attribute9             = l_item_comp_det.attribute9,
		attribute10            = l_item_comp_det.attribute10,
		attribute11            = l_item_comp_det.attribute11,
		attribute12            = l_item_comp_det.attribute12,
		attribute13            = l_item_comp_det.attribute13,
		attribute14            = l_item_comp_det.attribute14,
		attribute15            = l_item_comp_det.attribute15
	     -- manisaga added attributes for DFF implementation on 22-Feb-2010  -- End

        Where  item_composition_id=l_item_comp_det.link_comp_id;
Line: 2624

        Delete from ahl_item_comp_details
	where item_composition_id = l_item_comp_det.item_composition_id;
Line: 2627

        Delete from ahl_item_compositions
         Where item_composition_id=l_item_comp_det.item_composition_id;
Line: 2645

             update  ahl_item_compositions
	        set approval_status_code=l_status,
	            object_version_number = object_version_number+1
	      where item_composition_id=l_item_comp_det.item_composition_id
	        and object_version_number = l_item_comp_det.object_version_number;