[Home] [Help]
784: l_eam_op_rec.wip_entity_id := opRow.Wip_Entity_Id;
785: l_eam_op_rec.operation_seq_num := opRow.Operation_Seq_Num;
786: l_eam_op_rec.organization_id := opRow.Organization_Id;
787: l_eam_op_rec.operation_sequence_id := opRow.Operation_Sequence_Id;
788: /* l_eam_op_rec.standard_operation_id := opRow.Standard_Operation_Id; do not handover std op, commented for bug14032750 */
789: l_eam_op_rec.department_id := opRow.Department_Id;
790: l_eam_op_rec.description := opRow.Description;
791: l_eam_op_rec.start_date := opRow.First_Unit_Start_Date;
792: l_eam_op_rec.completion_date := opRow.Last_Unit_Completion_Date;
1538: l_eam_res_rec.firm_flag := newRow.firm_flag;
1539: l_eam_res_rec.assigned_units := newRow.assigned_units;
1540: l_eam_res_rec.maximum_assigned_units := newRow.maximum_assigned_units;
1541: l_eam_res_rec.autocharge_type := newRow.autocharge_type;
1542: l_eam_res_rec.standard_rate_flag := newRow.standard_rate_flag;
1543: l_eam_res_rec.applied_resource_units := newRow.applied_resource_units;
1544: l_eam_res_rec.applied_resource_value := newRow.applied_resource_value;
1545: l_eam_res_rec.start_date := newRow.start_date;
1546: l_eam_res_rec.completion_date := newRow.completion_date;
1955:
1956: EAM_WORKORDER_UTIL_PKG.log_path(l_output_dir);
1957:
1958:
1959: -- Standard Start of API savepoint
1960: l_stmt_num := 10;
1961: SAVEPOINT get_insert_into_wor_pvt;
1962:
1963: l_stmt_num := 20;
1960: l_stmt_num := 10;
1961: SAVEPOINT get_insert_into_wor_pvt;
1962:
1963: l_stmt_num := 20;
1964: -- Standard call to check for call compatibility.
1965: IF NOT fnd_api.compatible_api_call(
1966: l_api_version
1967: ,p_api_version
1968: ,l_api_name
2057: l_eam_res_rec.scheduled_flag := p_scheduled_flag;
2058: l_eam_res_rec.assigned_units := p_assigned_units;
2059: l_eam_res_rec.autocharge_type := p_charge_type;
2060: if ( p_std_rate = 'Y') then
2061: l_eam_res_rec.standard_rate_flag := 1;
2062: else
2063: l_eam_res_rec.standard_rate_flag := 2;
2064: end if;
2065: l_eam_res_rec.start_date := p_start_date;
2059: l_eam_res_rec.autocharge_type := p_charge_type;
2060: if ( p_std_rate = 'Y') then
2061: l_eam_res_rec.standard_rate_flag := 1;
2062: else
2063: l_eam_res_rec.standard_rate_flag := 2;
2064: end if;
2065: l_eam_res_rec.start_date := p_start_date;
2066: l_eam_res_rec.completion_date := p_end_date;
2067: l_eam_res_rec.schedule_seq_num := p_schedule_sequence;
2139: l_eam_res_rec.scheduled_flag := p_scheduled_flag;
2140: l_eam_res_rec.assigned_units := p_assigned_units;
2141: l_eam_res_rec.autocharge_type := p_charge_type;
2142: if ( p_std_rate = 'Y') then
2143: l_eam_res_rec.standard_rate_flag := 1;
2144: else
2145: l_eam_res_rec.standard_rate_flag := 2;
2146: end if;
2147: l_eam_res_rec.start_date := p_start_date;
2141: l_eam_res_rec.autocharge_type := p_charge_type;
2142: if ( p_std_rate = 'Y') then
2143: l_eam_res_rec.standard_rate_flag := 1;
2144: else
2145: l_eam_res_rec.standard_rate_flag := 2;
2146: end if;
2147: l_eam_res_rec.start_date := p_start_date;
2148: l_eam_res_rec.completion_date := p_end_date;
2149: l_eam_res_rec.schedule_seq_num := p_schedule_sequence;
2205: x_update_status := l_update_status;
2206:
2207:
2208: -- End of API body.
2209: -- Standard check of p_commit.
2210: IF fnd_api.to_boolean(p_commit)
2211: and x_return_status = 'S' THEN
2212: COMMIT WORK;
2213: END IF;
2217: END IF;
2218:
2219:
2220: l_stmt_num := 999;
2221: -- Standard call to get message count and if count is 1, get message info.
2222: fnd_msg_pub.count_and_get(
2223: p_count => x_msg_count
2224: ,p_data => x_msg_data);
2225: EXCEPTION
2571:
2572: l_output_dir VARCHAR2(512);
2573:
2574: BEGIN
2575: -- Standard Start of API savepoint
2576: l_stmt_num := 10;
2577: SAVEPOINT get_insert_into_wro_pvt;
2578:
2579: l_stmt_num := 20;
2576: l_stmt_num := 10;
2577: SAVEPOINT get_insert_into_wro_pvt;
2578:
2579: l_stmt_num := 20;
2580: -- Standard call to check for call compatibility.
2581: IF NOT fnd_api.compatible_api_call(
2582: l_api_version
2583: ,p_api_version
2584: ,l_api_name
2869: x_update_status := l_update_status;
2870:
2871:
2872: -- End of API body.
2873: -- Standard check of p_commit.
2874: IF fnd_api.to_boolean(p_commit)
2875: and x_return_status = 'S' THEN
2876: COMMIT WORK;
2877: END IF;
2880: ROLLBACK TO get_insert_into_wro_pvt;
2881: END IF;
2882:
2883: l_stmt_num := 999;
2884: -- Standard call to get message count and if count is 1, get message info.
2885: fnd_msg_pub.count_and_get(
2886: p_count => x_msg_count
2887: ,p_data => x_msg_data);
2888: EXCEPTION
3039: l_output_dir VARCHAR2(512);
3040:
3041: BEGIN
3042:
3043: -- Standard Start of API savepoint
3044: l_stmt_num := 10;
3045: SAVEPOINT get_insert_into_wro_pvt;
3046:
3047: l_stmt_num := 20;
3044: l_stmt_num := 10;
3045: SAVEPOINT get_insert_into_wro_pvt;
3046:
3047: l_stmt_num := 20;
3048: -- Standard call to check for call compatibility.
3049: IF NOT fnd_api.compatible_api_call(
3050: l_api_version
3051: ,p_api_version
3052: ,l_api_name
3378: x_update_status := l_update_status;
3379:
3380:
3381: -- End of API body.
3382: -- Standard check of p_commit.
3383: IF fnd_api.to_boolean(p_commit)
3384: and x_return_status = 'S' THEN
3385: COMMIT WORK;
3386: END IF;
3389: ROLLBACK TO get_insert_into_wro_pvt;
3390: END IF;
3391:
3392: l_stmt_num := 999;
3393: -- Standard call to get message count and if count is 1, get message info.
3394: fnd_msg_pub.count_and_get(
3395: p_count => x_msg_count
3396: ,p_data => x_msg_data);
3397: EXCEPTION
3500:
3501: l_output_dir VARCHAR2(512);
3502:
3503: BEGIN
3504: -- Standard Start of API savepoint
3505: l_stmt_num := 10;
3506: SAVEPOINT get_delete_resources_pvt;
3507:
3508: l_stmt_num := 20;
3505: l_stmt_num := 10;
3506: SAVEPOINT get_delete_resources_pvt;
3507:
3508: l_stmt_num := 20;
3509: -- Standard call to check for call compatibility.
3510: IF NOT fnd_api.compatible_api_call(
3511: l_api_version
3512: ,p_api_version
3513: ,l_api_name
3660:
3661:
3662:
3663: -- End of API body.
3664: -- Standard check of p_commit.
3665: IF fnd_api.to_boolean(p_commit)
3666: and x_return_status = 'S' THEN
3667: COMMIT WORK;
3668: END IF;
3672: END IF;
3673:
3674: l_stmt_num := 999;
3675:
3676: -- Standard call to get message count and if count is 1, get message info.
3677: fnd_msg_pub.count_and_get(
3678: p_count => x_msg_count
3679: ,p_data => x_msg_data);
3680:
3796:
3797:
3798:
3799: --------------------------------------------------------------------------
3800: -- Procedure to validate standard operation
3801: -- Used in Operations Page
3802: -- Author : rethakur
3803: --------------------------------------------------------------------------
3804:
3803: --------------------------------------------------------------------------
3804:
3805: procedure validate_std_operation ( p_organization_id IN NUMBER
3806: ,p_operation_code IN VARCHAR2
3807: ,x_standard_operation_id OUT NOCOPY NUMBER
3808: ,x_department_id OUT NOCOPY NUMBER
3809: ,x_shutdown_type OUT NOCOPY VARCHAR2
3810: ,x_return_status OUT NOCOPY NUMBER) IS
3811:
3808: ,x_department_id OUT NOCOPY NUMBER
3809: ,x_shutdown_type OUT NOCOPY VARCHAR2
3810: ,x_return_status OUT NOCOPY NUMBER) IS
3811:
3812: l_standard_operation_id NUMBER := null;
3813: l_department_id NUMBER := null;
3814: l_shutdown_type VARCHAR2(10);
3815: l_return_status NUMBER := 0;
3816:
3815: l_return_status NUMBER := 0;
3816:
3817: BEGIN
3818:
3819: SELECT bdp.department_id, bso.standard_operation_id,
3820: bso.shutdown_type
3821: INTO l_department_id, l_standard_operation_id,
3822: l_shutdown_type
3823: FROM BOM_DEPARTMENTS bdp,
3817: BEGIN
3818:
3819: SELECT bdp.department_id, bso.standard_operation_id,
3820: bso.shutdown_type
3821: INTO l_department_id, l_standard_operation_id,
3822: l_shutdown_type
3823: FROM BOM_DEPARTMENTS bdp,
3824: BOM_STANDARD_OPERATIONS bso
3825: WHERE bso.organization_id = p_organization_id
3820: bso.shutdown_type
3821: INTO l_department_id, l_standard_operation_id,
3822: l_shutdown_type
3823: FROM BOM_DEPARTMENTS bdp,
3824: BOM_STANDARD_OPERATIONS bso
3825: WHERE bso.organization_id = p_organization_id
3826: AND bso.operation_code = p_operation_code
3827: AND bso.line_id IS NULL
3828: AND NVL ( bso.operation_type, 1) = 1
3831: AND NVL ( bdp.disable_date, sysdate + 2) > sysdate ;
3832:
3833: x_return_status := l_return_status;
3834: x_department_id := l_department_id;
3835: x_standard_operation_id := l_standard_operation_id;
3836: x_shutdown_type := l_shutdown_type;
3837:
3838: EXCEPTION
3839: WHEN NO_DATA_FOUND THEN
3839: WHEN NO_DATA_FOUND THEN
3840: l_return_status := 1;
3841: x_return_status := l_return_status ;
3842: x_department_id := null;
3843: x_standard_operation_id := null;
3844: x_shutdown_type := null;
3845: END validate_std_operation;
3846:
3847: --------------------------------------------------------------------------
3850: -- Author : rethakur
3851: --------------------------------------------------------------------------
3852: procedure insert_into_wo ( p_wip_entity_id IN NUMBER
3853: ,p_operation_seq_num IN NUMBER
3854: ,p_standard_operation_id IN NUMBER
3855: ,p_organization_id IN NUMBER
3856: ,p_description IN VARCHAR2
3857: ,p_department_id IN NUMBER
3858: ,p_shutdown_type IN VARCHAR2
3915: invalid_autochrg_exp EXCEPTION;
3916:
3917: CURSOR chk_autocharge IS
3918: SELECT 1
3919: FROM bom_standard_operations bso,
3920: bom_std_op_resources bsor
3921: WHERE bso.standard_operation_id = bsor.standard_operation_id
3922: AND bsor.standard_operation_id = p_standard_operation_id
3923: AND bso.organization_id = p_organization_id
3917: CURSOR chk_autocharge IS
3918: SELECT 1
3919: FROM bom_standard_operations bso,
3920: bom_std_op_resources bsor
3921: WHERE bso.standard_operation_id = bsor.standard_operation_id
3922: AND bsor.standard_operation_id = p_standard_operation_id
3923: AND bso.organization_id = p_organization_id
3924: AND bsor.autocharge_type NOT IN (2,3);
3925:
3918: SELECT 1
3919: FROM bom_standard_operations bso,
3920: bom_std_op_resources bsor
3921: WHERE bso.standard_operation_id = bsor.standard_operation_id
3922: AND bsor.standard_operation_id = p_standard_operation_id
3923: AND bso.organization_id = p_organization_id
3924: AND bsor.autocharge_type NOT IN (2,3);
3925:
3926: BEGIN
3950: l_eam_op_rec.long_description := p_long_description;
3951: l_eam_op_rec.shutdown_type := p_shutdown_type;
3952: l_eam_op_rec.start_date := l_first_unit_start_date;
3953: l_eam_op_rec.completion_date := l_last_unit_completion_date;
3954: if ( nvl(p_standard_operation_id,0)= 0 ) then -- added OR clause for bug#3541316
3955: l_eam_op_rec.standard_operation_id := null ;
3956: else -- added else clause for bug#3518663
3957: l_eam_op_rec.standard_operation_id := p_standard_operation_id;
3958: end if;
3951: l_eam_op_rec.shutdown_type := p_shutdown_type;
3952: l_eam_op_rec.start_date := l_first_unit_start_date;
3953: l_eam_op_rec.completion_date := l_last_unit_completion_date;
3954: if ( nvl(p_standard_operation_id,0)= 0 ) then -- added OR clause for bug#3541316
3955: l_eam_op_rec.standard_operation_id := null ;
3956: else -- added else clause for bug#3518663
3957: l_eam_op_rec.standard_operation_id := p_standard_operation_id;
3958: end if;
3959: l_eam_op_rec.department_id := p_department_id;
3953: l_eam_op_rec.completion_date := l_last_unit_completion_date;
3954: if ( nvl(p_standard_operation_id,0)= 0 ) then -- added OR clause for bug#3541316
3955: l_eam_op_rec.standard_operation_id := null ;
3956: else -- added else clause for bug#3518663
3957: l_eam_op_rec.standard_operation_id := p_standard_operation_id;
3958: end if;
3959: l_eam_op_rec.department_id := p_department_id;
3960:
3961: l_eam_op_tbl(1) := l_eam_op_rec ;
5332: IF(x_return_status <>'S') THEN
5333: ROLLBACK TO update_wro;
5334: END IF;
5335:
5336: -- Standard check of p_commit.
5337: IF fnd_api.to_boolean(p_commit)
5338: and x_return_status = 'S' THEN
5339: COMMIT WORK;
5340: END IF;
5414:
5415: l_output_dir VARCHAR2(512);
5416:
5417: BEGIN
5418: -- Standard Start of API savepoint
5419: l_stmt_num := 10;
5420: SAVEPOINT delete_instance_pvt;
5421:
5422: l_stmt_num := 20;
5419: l_stmt_num := 10;
5420: SAVEPOINT delete_instance_pvt;
5421:
5422: l_stmt_num := 20;
5423: -- Standard call to check for call compatibility.
5424: IF NOT fnd_api.compatible_api_call(
5425: l_api_version
5426: ,p_api_version
5427: ,l_api_name
5504: );
5505:
5506:
5507: -- End of API body.
5508: -- Standard check of p_commit.
5509: IF fnd_api.to_boolean(p_commit)
5510: and x_return_status = 'S' THEN
5511: COMMIT WORK;
5512: END IF;
5516: END IF;
5517:
5518: l_stmt_num := 999;
5519:
5520: -- Standard call to get message count and if count is 1, get message info.
5521: fnd_msg_pub.count_and_get(
5522: p_count => x_msg_count
5523: ,p_data => x_msg_data);
5524: