The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'Primary not Exists'
FROM bom_operational_routings
WHERE assembly_item_id = p_revised_item_id
AND organization_id = p_organization_id
AND NVL(alternate_routing_designator, 'NONE') = 'NONE' ;
SELECT 'Rev Comp referencing Seq Num exists'
FROM SYS.DUAL
WHERE EXISTS (SELECT NULL
FROM BOM_INVENTORY_COMPONENTS bic
, ENG_REVISED_ITEMS eri
WHERE TRUNC(bic.effectivity_date) >= TRUNC(p_start_effective_date)
AND bic.implementation_date IS NULL
AND bic.operation_seq_num = p_operation_seq_num
AND bic.bill_sequence_id = eri.bill_sequence_id
AND eri.revised_item_sequence_id = p_rev_item_seq_id
) ;
SELECT 'Op Seq does not exist'
FROM SYS.DUAL
WHERE EXISTS (SELECT NULL
FROM WIP_DISCRETE_JOBS wdj
WHERE (wdj.status_type <> 1
OR
NOT EXISTS(SELECT NULL
FROM WIP_OPERATIONS wo
WHERE operation_seq_num = p_operation_seq_num
AND wip_entity_id = wdj.wip_entity_id)
)
AND wdj.lot_number = p_lot_number
AND wdj.organization_id = p_organization_id
AND wdj.primary_item_id = p_rev_item_id
) ;
SELECT 'Op Seq does not exist'
FROM SYS.DUAL
WHERE EXISTS (SELECT NULL
FROM WIP_DISCRETE_JOBS wdj
, WIP_ENTITIES we
, WIP_ENTITIES we1
, WIP_ENTITIES we2
WHERE (wdj.status_type <> 1
OR
NOT EXISTS (SELECT NULL
FROM WIP_OPERATIONS wo
WHERE operation_seq_num = p_operation_seq_num
AND wip_entity_id = wdj.wip_entity_id )
)
AND wdj.wip_entity_id = we.wip_entity_id
AND we.organization_Id = p_organization_id
AND we.wip_entity_name >= we1.wip_entity_name
AND we.wip_entity_name <= we2.wip_entity_name
AND we1.wip_entity_id = p_from_wip_entity_id
AND we2.wip_entity_id = NVL(p_to_wip_entity_id, p_from_wip_entity_id)
) ;
SELECT 'Op Seq does not exist'
FROM SYS.DUAL
WHERE EXISTS (SELECT NULL
FROM WIP_DISCRETE_JOBS wdj
WHERE (wdj.status_type <> 1
OR
NOT EXISTS(SELECT NULL
FROM WIP_OPERATIONS wo
WHERE operation_seq_num = p_operation_seq_num
AND wip_entity_id = wdj.wip_entity_id )
)
AND wdj.wip_entity_id = p_from_wip_entity_id
) ;
SELECT 'Resource Exist'
FROM DUAL
WHERE EXISTS ( SELECT NULL
FROM BOM_OPERATION_RESOURCES
WHERE operation_sequence_id = p_op_seq_id
) ;
* error if the operation is UPDATE and record DOES NOT
* EXIST.
* In case of UPDATE if record exists, then the procedure
* will return old record in the old entity parameters
* with a success status.
*********************************************************************/
PROCEDURE Check_Existence
( p_com_operation_rec IN Bom_Rtg_Pub.Com_Operation_Rec_Type
, p_com_op_unexp_rec IN Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
, x_old_com_operation_rec IN OUT NOCOPY Bom_Rtg_Pub.Com_Operation_Rec_Type
, x_old_com_op_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
, x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_return_status IN OUT NOCOPY VARCHAR2
)
IS
l_token_tbl Error_Handler.Token_Tbl_Type;
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE, BOM_Rtg_Globals.G_OPR_CANCEL)
THEN
Error_Handler.Add_Error_Token
( x_Mesg_token_tbl => l_Mesg_Token_Tbl
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_message_name => 'BOM_OP_DOESNOT_EXIST'
, p_token_tbl => l_token_tbl
) ;
SELECT revised_item_sequence_id
FROM BOM_OPERATION_SEQUENCES
WHERE NVL(OPERATION_TYPE, 1) = NVL(p_operation_type , 1)
AND OPERATION_SEQ_NUM = p_operation_sequence_number
AND EFFECTIVITY_DATE = p_effectivity_date -- Changed for bug 2647027
-- AND TRUNC(EFFECTIVITY_DATE) = TRUNC(p_effectivity_date)
AND routing_sequence_id = p_routing_sequence_id
;
SELECT 'common exists'
FROM bom_operational_routings
WHERE common_routing_sequence_id <> routing_sequence_id
AND routing_sequence_id = p_routing_sequence_id ;
* Procedure : Check_Attribute (Validation) for CREATE and UPDATE
* internally called by RTG BO and ECO BO
* Parameters IN : Common Operation exposed column record
* Common Operation unexposed column record
* Parameters out: Return Status
* Message Token Table
* Purpose : Attribute validation procedure will validate each
* attribute of operation in its entirety. If
* the validation of a column requires looking at some
* other columns value then the validation is done at
* the Entity level instead.
* All errors in the attribute validation are accumulated
* before the procedure returns with a Return_Status
* of 'E'.
*********************************************************************/
PROCEDURE Check_Attributes
( p_com_operation_rec IN Bom_Rtg_Pub.Com_Operation_Rec_Type
, p_com_op_unexp_rec IN Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
, x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_return_status IN OUT NOCOPY VARCHAR2
)
IS
l_return_status VARCHAR2(1);
IF p_com_operation_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
THEN
IF Bom_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
('Operation Attr Validation: Missing Value. . . ' || l_return_status) ;
l_token_tbl.DELETE(2) ;
l_token_tbl.DELETE(2) ;
l_token_tbl.DELETE(2) ;
SELECT 'Resource Exist'
FROM DUAL
WHERE EXISTS ( SELECT NULL
FROM BOM_OPERATION_RESOURCES
WHERE operation_sequence_id = p_op_seq_id
) ;
SELECT 'Sub Resources Exist'
FROM DUAL
WHERE EXISTS (SELECT NULL
FROM BOM_STD_SUB_OP_RESOURCES
WHERE standard_operation_id = p_std_op_id
AND Schedule_Seq_Num IS NULL); -- Bug 7370692
SELECT 'Std Op Invalid'
FROM DUAL
WHERE NOT EXISTS (SELECT NULL
FROM BOM_STANDARD_OPERATIONS bso
, bom_operational_routings bor
WHERE NVL(bso.operation_type,1 )
= DECODE( p_op_type, FND_API.G_MISS_NUM, 1
, NVL(p_op_type, 1))
AND NVL(bso.line_id, FND_API.G_MISS_NUM)
= NVL(bor.line_id, FND_API.G_MISS_NUM)
AND bor.routing_sequence_id = p_rtg_seq_id
AND bso.department_id = p_dept_id
AND bso.organization_id = p_org_id
AND bso.standard_operation_id = p_std_op_id
UNION
SELECT NULL
FROM BOM_STANDARD_OPERATIONS bso
, ENG_REVISED_ITEMS eri
WHERE NVL(bso.operation_type, 1)
= DECODE( p_op_type, FND_API.G_MISS_NUM, 1
, NVL(p_op_type, 1 ) )
-- AND NVL(bso.line_id, FND_API.G_MISS_NUM)
-- = NVL(eri.line_id, FND_API.G_MISS_NUM)
-- AND BOM_Rtg_Globals.Get_Routing_Sequence_Id IS NULL
AND NOT EXISTS -- Added for bug 3578057, to check if it is a new routing being created through the ECO
(SELECT 1 FROM BOM_OPERATIONAL_ROUTINGS
WHERE routing_sequence_id = p_rtg_seq_id)
AND eri.revised_item_sequence_id = p_rit_seq_id
AND bso.department_id = p_dept_id
AND bso.organization_id = p_org_id
AND bso.standard_operation_id = p_std_op_id
) ;
IF ( l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_UPDATE
OR ( l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_CREATE
AND l_com_operation_rec.acd_type = l_ACD_CHANGE )
)
AND ( NVL(p_old_com_op_unexp_rec.standard_operation_id, FND_API.G_MISS_NUM ) <>
NVL(l_com_op_unexp_rec.standard_operation_id, FND_API.G_MISS_NUM )
)
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_OP_STD_OP_NOTUPDATABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_Token_Tbl => l_Token_Tbl
) ;
IF ( l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_UPDATE
OR ( l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_CREATE
AND l_com_operation_rec.acd_type = l_ACD_CHANGE )
)
AND ( l_com_operation_rec.reference_flag = 1
)
THEN
IF (nvl(p_old_com_operation_rec.Minimum_Transfer_Quantity,-1) <>
nvl(l_com_operation_rec.Minimum_Transfer_Quantity,-1))
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_STD_MTQ_NOT_UPDATABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_Token_Tbl => l_Token_Tbl
) ;
SELECT bom_item_type
, pick_components_flag
, bom_enabled_flag
, eng_item_flag
FROM MTL_SYSTEM_ITEMS
WHERE organization_id = p_org_id
AND inventory_item_id = p_item_id
;
SELECT 'implemented'
FROM BOM_OPERATION_SEQUENCES
WHERE implementation_date IS NULL
AND operation_sequence_id = p_old_op_seq_id
;
SELECT 'implemented'
FROM DUAL
WHERE EXISTS ( SELECT NULL
FROM bom_operational_routings
WHERE common_routing_sequence_id <> p_rtg_seq_id
) ;
SELECT 'resources exist' dummy
FROM BOM_OPERATION_RESOURCES
WHERE operation_sequence_id = p_parent_seq_id ;
SELECT 'Duplicate Operation'
FROM DUAL
WHERE EXISTS (SELECT NULL
FROM BOM_OPERATION_SEQUENCES
WHERE ( ( effectivity_date = p_start_effective_date -- Changed for bug 2647027
-- WHERE ( ( TRUNC(effectivity_date) = TRUNC(p_start_effective_date)
AND operation_type = l_EVENT )
OR p_op_type <> l_EVENT
)
AND NVL(operation_type, l_EVENT) = NVL(p_op_type, l_EVENT)
-- AND implementation_date IS NOT NULL
AND operation_seq_num = p_op_seq_num
AND operation_sequence_id <> p_op_seq_id
AND routing_sequence_id = p_rtg_seq_id
) ;
SELECT 'Overlapping'
FROM DUAL
WHERE EXISTS (SELECT NULL
FROM BOM_OPERATION_SEQUENCES
WHERE NVL(operation_type, l_EVENT) = NVL(p_op_type, l_EVENT)
AND ((effectivity_date <
NVL(p_disable_date, p_start_effective_date + 1)
AND NVL(disable_date, p_start_effective_date + 1)
>= p_start_effective_date)
OR
( p_start_effective_date <
NVL(disable_date, effectivity_date + 1)
AND NVL(p_disable_date, effectivity_date+ 1)
>= effectivity_date)
/** Changed for bug 2647027 AND ((TRUNC(effectivity_date) <
NVL(TRUNC(p_disable_date), TRUNC(p_start_effective_date + 1))
AND NVL(TRUNC(disable_date), TRUNC(p_start_effective_date) + 1)
>= TRUNC(p_start_effective_date))
OR
( TRUNC(p_start_effective_date) <
NVL(TRUNC(disable_date) , TRUNC(effectivity_date + 1))
AND NVL(TRUNC(p_disable_date) , TRUNC(effectivity_date)+ 1)
>= TRUNC(effectivity_date))
**/ )
AND implementation_date IS NOT NULL
AND routing_sequence_id = p_rtg_seq_id
AND operation_seq_num = p_op_seq_num
AND operation_sequence_id <> p_op_seq_id
) ;
SELECT 'Overlapping'
FROM DUAL
WHERE EXISTS (SELECT NULL
FROM BOM_OPERATION_SEQUENCES
WHERE NVL(operation_type, l_EVENT) = NVL(p_op_type, l_EVENT)
AND ((effectivity_date <
NVL(p_disable_date, p_start_effective_date + 1)
AND NVL(disable_date, p_start_effective_date + 1)
>= p_start_effective_date)
OR
( p_start_effective_date <
NVL(disable_date, effectivity_date + 1)
AND NVL(p_disable_date, effectivity_date+ 1)
>= effectivity_date)
/** Changed for bug 2647027 AND ((TRUNC(effectivity_date) <
NVL(TRUNC(p_disable_date) , TRUNC(p_start_effective_date + 1))
AND NVL(TRUNC(disable_date) , TRUNC(p_start_effective_date) + 1)
>= TRUNC(p_start_effective_date))
OR
( TRUNC(p_start_effective_date) <
NVL(TRUNC(disable_date) , TRUNC(effectivity_date + 1))
AND NVL(TRUNC(p_disable_date) , TRUNC(effectivity_date)+ 1)
>= TRUNC(effectivity_date))
**/ )
AND implementation_date IS NULL
AND NVL(acd_type, l_ACD_ADD) IN (l_ACD_ADD, l_ACD_CHANGE)
AND routing_sequence_id = p_rtg_seq_id
AND operation_seq_num = p_op_seq_num
AND operation_sequence_id <> p_op_seq_id
) ;
SELECT 'Dept is invalid'
FROM DUAL
WHERE NOT EXISTS (SELECT NULL
FROM BOM_DEPARTMENTS bd
WHERE NVL(TRUNC(bd.disable_date) , TRUNC(p_start_effective_date) + 1)
> TRUNC(p_start_effective_date)
AND bd.organization_id = p_organization_id
AND bd.department_id = p_dept_id
) ;
SELECT 'Old Op Seq is invalid'
FROM SYS.DUAL
WHERE NOT EXISTS ( SELECT NULL
FROM BOM_OPERATION_SEQUENCES bos
WHERE routing_sequence_id =
( SELECT common_routing_sequence_id
FROM bom_operational_routings bor
WHERE routing_sequence_id = p_rtg_seq_id
)
AND bos.effectivity_date <= p_effectivity_date
AND NVL(bos.disable_date,p_effectivity_date+1)
> p_effectivity_date
/** Changed for bug 2647027 AND TRUNC(bos.effectivity_date) <=
TRUNC(p_effectivity_date)
AND NVL(bos.disable_date,TRUNC(p_effectivity_date)+1)
> p_effectivity_date
**/ AND NVL(bos.disable_date , SYSDATE + 1) > SYSDATE
AND (( p_eco_for_production = 2
AND NVL(bos.eco_for_production, 2) <> 1
)
OR
( p_eco_for_production = 1
AND bos.implementation_date IS NOT NULL
)
)
AND NVL(bos.revised_item_sequence_id, -999)
<> nvl(p_rev_item_seq_id, -100)
AND NOT EXISTS (SELECT NULL
FROM BOM_OPERATION_SEQUENCES bos2
WHERE bos2.revised_item_sequence_id
= NVL(p_rev_item_seq_id, -888)
AND decode(bos2.implementation_date,
null,
bos2.old_operation_sequence_id,
bos2.operation_sequence_id) =
decode(bos.implementation_date,
null,
bos.old_operation_sequence_id,
bos.operation_sequence_id)
)
AND bos.operation_sequence_id = p_old_op_seq_id
) ;
SELECT serialization_start_op
FROM BOM_OPERATIONAL_ROUTINGS
WHERE routing_sequence_id = p_rtg_seq_id
AND serialization_start_op IS NOT NULL;
IF l_com_operation_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
THEN
--
-- Verify that the user is not trying to update an operation which
-- is Disabled on the ECO
--
IF p_old_com_operation_rec.acd_type = l_ACD_DISABLE
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_OP_DISABLED'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_token_tbl => l_token_tbl
) ;
( p_message_name => 'BOM_OP_ACD_TYPE_NOT_UPDATEABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_token_tbl => l_token_tbl
) ;
( p_message_name => 'BOM_OP_OLDOPSQNM_NT_UPDATEABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_token_tbl => l_token_tbl
) ;
( p_message_name => 'BOM_OP_OLDEFFDT_NOT_UPDATEABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_token_tbl => l_token_tbl
) ;
END IF ; -- Validation for Update Only
,BOM_Rtg_Globals.G_OPR_DELETE )
AND l_com_operation_rec.acd_type = l_ACD_ADD
THEN
IF NOT Check_Ref_Rev_Comp
( p_operation_seq_num => l_com_operation_rec.operation_sequence_number
, p_start_effective_date => l_com_operation_rec.start_effective_date
, p_rev_item_seq_id => l_com_op_unexp_rec.revised_item_sequence_id
)
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_OP_CANNOT_CANCL_FOR_REVCMP'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_Token_Tbl => l_Token_Tbl
) ;
IF l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_UPDATE
OR ( l_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_CREATE
AND l_com_operation_rec.acd_type = l_ACD_CHANGE )
THEN
--
-- If Start Effective Date or New Start Effective Date is past,
-- Effective_Date is not updatable
--
-- Added condition to check start_eff_date <> new_start_eff_date for bug 4666512
IF BOM_Rtg_Globals.Get_Bo_Identifier = BOM_Rtg_Globals.G_RTG_BO
AND l_com_operation_rec.new_start_effective_date IS NOT NULL
AND l_com_operation_rec.new_start_effective_date <> FND_API.G_MISS_DATE
AND l_com_operation_rec.new_start_effective_date <>
l_com_operation_rec.start_effective_date
AND ( l_com_operation_rec.start_effective_date < sysdate
OR l_com_operation_rec.new_start_effective_date < sysdate
/** Changed for bug 2647027
AND ( trunc(l_com_operation_rec.start_effective_date) < trunc(sysdate)
OR trunc(l_com_operation_rec.new_start_effective_date) < trunc(sysdate)
**/ )
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_OP_EFFDATE_NOT_UPDATABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_Token_Tbl => l_Token_Tbl
) ;
AND NOT Bom_Rtg_Eam_Util.Check_UpdateDept
( p_op_seq_id => l_com_op_unexp_rec.operation_sequence_id
, p_org_id => l_com_op_unexp_rec.organization_id
, p_dept_id => l_com_op_unexp_rec.department_id
)
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_EAM_OP_DEPT_NOT_UPDATABLE'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_Token_Tbl => l_Token_Tbl
) ;
END IF ; -- Transation: UPDATE
('End of Validation specific to the Transaction Type of Update : ' || l_return_status) ;
(BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
THEN
IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
('Common Validateion for Transaction Type : Create and Update . . . . ' || l_return_status) ;
END IF ; -- Transaction Type : Create and Update
p_com_operation_rec.transaction_type = BOM_Rtg_Globals.G_OPR_DELETE
THEN
IF p_com_operation_rec.Delete_Group_Name IS NULL OR
p_com_operation_rec.Delete_Group_Name = FND_API.G_MISS_CHAR
THEN
Error_Handler.Add_Error_Token
( p_message_name => 'BOM_DG_NAME_MISSING'
, p_mesg_token_tbl => l_mesg_token_tbl
, x_mesg_token_tbl => l_mesg_token_tbl
);
('Check if Delete Group is missing . . . ' || l_return_status) ;
IF p_com_operation_rec.transaction_type = BOM_Rtg_Globals.G_OPR_DELETE THEN
IF l_com_operation_rec.operation_sequence_number = get_ssos_rec.serialization_start_op THEN
l_token_tbl(1).token_name := 'OP_SEQ_NUMBER';
ELSIF p_com_operation_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE THEN
IF l_com_operation_rec.operation_sequence_number = get_ssos_rec.serialization_start_op AND
l_com_operation_rec.new_operation_sequence_number <> l_com_operation_rec.operation_sequence_number THEN
l_token_tbl(1).token_name := 'OP_SEQ_NUMBER';
IF p_com_operation_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_DELETE
AND BOM_RTG_Globals.Is_Osfm_NW_Calc_Flag
AND
WSMPUTIL.JOBS_WITH_QTY_AT_FROM_OP (x_err_code => l_err_code,
x_err_msg => l_err_text,
p_operation_sequence_id => p_com_op_unexp_rec.Operation_Sequence_Id)
THEN
l_token_tbl(1).token_name := 'OP_SEQ_NUMBER';
SELECT NULL
FROM BOM_OPERATION_SEQUENCES
WHERE NVL(operation_type, 1) = NVL(p_operation_type, 1)
AND effectivity_date = p_effectivity_date -- Changed for bug 2647027
-- AND TRUNC(effectivity_date) = TRUNC(p_effectivity_date)
AND routing_sequence_id = p_routing_sequence_id
AND operation_seq_num = p_operation_seq_num
AND acd_type = 3;