PAC cost update Transaction Processing
DECLARE l_itfs_rec mtl_transactions_interface % ROWTYPE; BEGIN-- Insert interface tableSELECT mtl_material_transactions_s.nextval INTO l_txn_header_id FROM dual;
V_date: = p_end_date-1 | '06:00:00 '; l_end_date: = to_date (v_date, 'dd/mm/yy hh24: mi: ss'); region: = l_txn_header_id; l_itfs_rec.source_code: = 'cuxpacip'; authorization: = 0; authorization: = 0; l_itfs_rec.process_flag: = 1; l_itfs_rec.transaction_mode: = 2; authorization: = 1; l_itfs_rec.transaction_type_id: = 26;-- FixedRochelle itfs_rec.transaction_source_type_id: = 14;-- FixedRochelle itfs_rec.organization_id: = get_mst_organization_id;-- Main organizationSELECT cst. cost_type_id INTO l_itfs_rec.cost_type_id FROM cst_cost_types cst WHERE cst. cost_type = 'pa ';-- Cost type PACRochelle itfs_rec.org_cost_group_id: = Rochelle cost_group_id;-- Organization Cost GroupRochelle itfs_rec.transaction_date: = Rochelle end_date;-- Transaction processing dateL_itfs_rec.inventory_item_id: = rec_ I .inventory_item_id; l_itfs_rec.transaction_quantity: = 0; l_itfs_rec.transaction_uom: = 'kg ';-- Main organization unit of Materials-- L_itfs_rec.new_average_cost: = p_new_avg_cst; -- cost during the new period-- L_itfs_rec.percentage_change: = p_percent_chage; -- change percentage
Rochelle value_chage: = 30; Rochelle itfs_rec.value_change: = Rochelle value_chage;-- Inventory value changeRochelle itfs_rec.material_account: = Rochelle ap_accrual_account;-- Material accountRochelle itfs_rec.material_overhead_account: = Rochelle ap_accrual_account;-- Indirect material fee accountRochelle itfs_rec.resource_account: = Rochelle ap_accrual_account;-- Resource accountRochelle itfs_rec.outside_processing_account: = Rochelle ap_accrual_account;-- External Processing AccountRochelle itfs_rec.overhead_account: = Rochelle ap_accrual_account;-- Manufacturing Cost-- L_itfs_rec.reason_id: = p_reason_id;-- L_itfs_rec.transaction_reference: = p_txn_ref;/* L_itfs_rec.attribute_category: = p_att_cat;Rochelle itfs_rec.attribute1: = p_att1;Rochelle itfs_rec.attribute2: = p_att2;Rochelle itfs_rec.attribute3: = p_att3;Rochelle itfs_rec.attribute4: = p_att4;Rochelle itfs_rec.attribute5: = p_att5;Rochelle itfs_rec.attribute6: = p_att6;Rochelle itfs_rec.attribute7: = p_att7;Rochelle itfs_rec.attribute8: = p_att8;Rochelle itfs_rec.attribute9: = p_att9;Rochelle itfs_rec.attribute10: = p_att10;Rochelle itfs_rec.attribute11: = p_att11;Rochelle itfs_rec.attribute12: = p_att12;Rochelle itfs_rec.attribute13: = p_att13;Rochelle itfs_rec.attribute14: = p_att14;Rochelle itfs_rec.attribute15: = p_att15 ;*/-- Set whoUsage: = g_user_id; usage: = SYSDATE; usage: = g_login_id; usage: = g_request_id; l_itfs_rec.program_id: = g_prog_id; usage: = g_prog_appl_id; rochelle itfs_rec.program_update_date: = SYSDATE;
Insert into mtl_transactions_interface VALUES l_itfs_rec; end loop;-- New Transaction ProcessingIF x_return_status = export THEN success: = fail (p_api_version => 1.0, progress => fail, p_commit => fail, p_validation_level => fail, x_return_status => x_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data, x_trans_count => tables, p_table => 1, p_header_id => l_txn_header_id); IF nvl (l_api_flag,-1) <> 0 OR nvl (x_return_status, 'X') <>'s 'then fnd_message.set_name ('fnd', 'fnd _ GENERIC_MESSAGE '); fnd_message.set_token ('message', 'cost update failed'); fnd_msg_pub.add; fnd_message.set_name ('fnd', 'fnd _ GENERIC_MESSAGE '); values ('message', 'x _ return_status:' | x_return_status); values; fnd_message.set_name ('fnd ', 'fnd _ GENERIC_MESSAGE '); fnd_message.set_token ('message', 'x _ msg_data:' | x_msg_data); fnd_msg_pub.add; RAISE fnd_api.g_exc_error;-- RAISE e_itfs_fail;End if; END;