Criar ou Alterar ECO’s

O Oracle EBS dispõe de um módulo aonde pode ser feito alterações individuais ou em massa de Estruturas e Roteiros. O módulo traz grande vantagem, visto que a engenharia consegue trabalhar isoladamente sem afetar possíveis Ordens de produção e rolagens do MRP que estejam em curso.

Cadastro Inicial da ECO.

Sem título

A seguir é necessário informar o(s) item(s) que sofrerão alterações.

Na tela dos Componentes pode ser inserido as mesmas informações que contém no módulo do BOM ( Bills of Materials )Sem título

Na tela das operações, pode-se associar operações padrão, adicionar recursos, etc..Sem título
Sem título

A ECO oferece três tipos de ação de mudança:

Adicionar -> Adicionar componentes, operações ou recursos;

Atualizar -> Atualizar informações de componentes, operações ou recursos já existentes;

Remover -> Remover componentes, operações ou recursos pertencentes ao Item;

A vantagem de trabalhar com as ecos, que independente o tamanho da alteração, a mesma pode passar por fluxo de aprovação, controle de status, controle de revisão, permitindo assim uma gestão eficiente das mudanças.

Além disso como alternativa a oracle proporciona uma API, para poder fazer alterações em massa. Abaixo um exemplo de API para criar ECO, a mesma pode ser usada para qualquer tipo de operação dentro da ECO.

DECLARE
 l_eco_rec Eng_Eco_Pub.Eco_Rec_Type := Eng_Eco_Pub.g_miss_eco_rec;
 l_eco_revision_tbl Eng_Eco_Pub.Eco_Revision_Tbl_Type := Eng_Eco_Pub.g_miss_eco_revision_tbl;
 l_revised_item_tbl Eng_Eco_Pub.Revised_Item_Tbl_Type := Eng_Eco_Pub.g_miss_revised_item_tbl;
 l_rev_component_tbl Bom_Bo_Pub.Rev_Component_Tbl_Type := Eng_Eco_Pub.g_miss_rev_component_tbl;
 l_sub_component_tbl Bom_Bo_Pub.Sub_Component_Tbl_Type:= Eng_Eco_Pub.g_miss_sub_component_tbl;
 l_ref_designator_tbl Bom_Bo_Pub.Ref_Designator_Tbl_Type:= Eng_Eco_Pub.g_miss_ref_designator_tbl;
 l_rev_operation_tbl Bom_Rtg_Pub.Rev_Operation_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_operation_tbl;
 l_rev_op_resource_tbl Bom_Rtg_Pub.Rev_Op_Resource_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_op_resource_tbl;
 l_rev_sub_resource_tbl Bom_Rtg_Pub.Rev_Sub_Resource_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_sub_resource_tbl;
 x_eco_rec Eng_Eco_Pub.Eco_Rec_Type:= Eng_Eco_Pub.g_miss_eco_rec;
 x_eco_revision_tbl Eng_Eco_Pub.Eco_Revision_Tbl_Type:= Eng_Eco_Pub.g_miss_eco_revision_tbl;
 x_revised_item_tbl Eng_Eco_Pub.Revised_Item_Tbl_Type:= Eng_Eco_Pub.g_miss_revised_item_tbl;
 x_rev_component_tbl Bom_Bo_Pub.Rev_Component_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_component_tbl;
 x_sub_component_tbl Bom_Bo_Pub.Sub_Component_Tbl_Type:= Eng_Eco_Pub.g_miss_sub_component_tbl;
 x_ref_designator_tbl Bom_Bo_Pub.Ref_Designator_Tbl_Type:= Eng_Eco_Pub.g_miss_ref_designator_tbl;
 x_rev_operation_tbl Bom_Rtg_Pub.Rev_Operation_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_operation_tbl;
 x_rev_op_resource_tbl Bom_Rtg_Pub.Rev_Op_Resource_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_op_resource_tbl;
 x_rev_sub_resource_tbl Bom_Rtg_Pub.Rev_Sub_Resource_Tbl_Type:= Eng_Eco_Pub.g_miss_rev_sub_resource_tbl;
 l_error_table Error_Handler.Error_Tbl_Type;
 l_return_status VARCHAR2(40);
 l_output_dir VARCHAR2(40);
 l_debug_filename VARCHAR2(40);
 l_msg_count NUMBER;
 l_row_cnt NUMBER := 1;
 i NUMBER;
 
BEGIN
 fnd_global.apps_initialize (user_id => 26300,
 resp_id => 20567,
 resp_appl_id => 703);
 
 FOR C IN (SELECT eri.change_notice, 
 mib.segment1, 
 eri.revised_item_id,
 eri.alternate_bom_designator,
 eri.from_end_item_unit_number,
 mp.organization_code, 
 eri.new_item_revision,
 eri.scheduled_date
 FROM eng_revised_items eri,
 mtl_system_Items_b mib,
 mtl_parameters mp
 WHERE change_notice = pi_change_notice
 AND eri.revised_item_id = mib.inventory_Item_Id
 AND eri.organization_id = mib.organization_id
 AND mib.organization_id = mp.organization_id)
 
 LOOP

l_revised_item_tbl (l_row_cnt).eco_name := c.change_notice;
 l_revised_item_tbl (l_row_cnt).organization_code := c.organization_code;
 l_revised_item_tbl (l_row_cnt).revised_item_name := c.segment1;
 l_revised_item_tbl (l_row_cnt).start_effective_date := c.scheduled_date;
 l_revised_item_tbl (l_row_cnt).from_end_item_unit_number := c.from_end_item_unit_number;
 l_revised_item_tbl (l_row_cnt).new_revised_item_revision := c.new_item_revision;
 l_revised_item_tbl (l_row_cnt).alternate_bom_code := NULL;
 l_revised_item_tbl (l_row_cnt).status_type := 1;
 l_revised_item_tbl (l_row_cnt).transaction_type := 'UPDATE';
 
 FOR b IN (SELECT mib.segment1,
 bcb.item_num,
 bcb.operation_seq_num,
 bcb.component_quantity,
 bcb.mutually_exclusive_options,
 bcb.optional,
 bcb.component_quantity,
 bcb.effectivity_date,
 bsb.alternate_bom_designator
 FROM bom_components_b bcb,
 bom_structures_b bsb,
 mtl_system_items_b mib
 WHERE bsb.bill_sequence_id = bcb.bill_Sequence_id
 AND bcb.disable_date IS NULL
 AND bsb.assembly_item_Id = c.revised_item_id
 AND NVL(bsb.alternate_bom_designator,'1234356789') = NVL(c.alternate_bom_designator,'1234356789')
 AND bcb.from_end_item_unit_number IS NOT NULL
 AND mib.inventory_item_id = bcb.component_item_id
 AND mib.organization_id = bsb.organization_id
 AND from_end_item_unit_number >= pi_from_item_unit_number
 AND from_end_item_unit_number <= pi_to_item_unit_number)
 LOOP
 
 IF pi_action_type = 1 THEN
 
 l_rev_component_tbl (l_row_cnt).eco_name := c.change_notice;
 l_rev_component_tbl (l_row_cnt).organization_code := c.organization_code;
 l_rev_component_tbl (l_row_cnt).revised_item_name := c.segment1;
 l_rev_component_tbl (l_row_cnt).from_end_item_unit_number := c.from_end_item_unit_number;
 l_rev_component_tbl (l_row_cnt).new_revised_item_revision := c.new_item_revision;
 l_rev_component_tbl (l_row_cnt).start_effective_date := c.scheduled_date;
 l_rev_component_tbl (l_row_cnt).quantity_per_assembly := component_quantity;
 l_rev_component_tbl (l_row_cnt).component_item_name := b.segment1;
 l_rev_component_tbl (l_row_cnt).alternate_bom_code := b.alternate_bom_designator;
 l_rev_component_tbl (l_row_cnt).acd_type := pi_action_type;
 l_rev_component_tbl (l_row_cnt).transaction_type := 'CREATE';
 l_row_cnt := l_row_cnt + 1;
 
 ELSE
 
 l_rev_component_tbl (l_row_cnt).eco_name := c.change_notice;
 l_rev_component_tbl (l_row_cnt).organization_code := c.organization_code;
 l_rev_component_tbl (l_row_cnt).revised_item_name := c.segment1;
 l_rev_component_tbl (l_row_cnt).new_revised_item_revision := NULL;
 l_rev_component_tbl (l_row_cnt).old_from_end_item_unit_number := c.from_end_item_unit_number;
 l_rev_component_tbl (l_row_cnt).from_end_item_unit_number := c.from_end_item_unit_number;
 l_rev_component_tbl (l_row_cnt).start_effective_date := c.scheduled_date;
 l_rev_component_tbl (l_row_cnt).old_effectivity_date := b.effectivity_date;
 l_rev_component_tbl (l_row_cnt).item_sequence_number := b.item_num;
 l_rev_component_tbl (l_row_cnt).operation_sequence_number := b.operation_seq_num;
 l_rev_component_tbl (l_row_cnt).old_operation_sequence_number := b.operation_seq_num;
 l_rev_component_tbl (l_row_cnt).mutually_exclusive := b.mutually_exclusive_options;
 l_rev_component_tbl (l_row_cnt).quantity_per_assembly := b.component_quantity;
 l_rev_component_tbl (l_row_cnt).optional := b.optional;
 l_rev_component_tbl (l_row_cnt).component_item_name := b.segment1;
 l_rev_component_tbl (l_row_cnt).alternate_bom_code := b.alternate_bom_designator;
 l_rev_component_tbl (l_row_cnt).acd_type := pi_action_type;
 l_rev_component_tbl (l_row_cnt).transaction_type := 'CREATE';
 l_row_cnt := l_row_cnt + 1; 
 
 END IF;
 
 END LOOP;
 
 END LOOP;

Eng_Eco_PUB.Process_Eco ( p_api_version_number => 1.0,
 p_init_msg_list => TRUE,
 x_return_status => l_return_status,
 x_msg_count => l_msg_count,
 p_bo_identifier => 'ECO',
 p_eco_rec => l_eco_rec,
 p_eco_revision_tbl => l_eco_revision_tbl,
 p_revised_item_tbl => l_revised_item_tbl,
 p_rev_component_tbl => l_rev_component_tbl,
 p_ref_designator_tbl => l_ref_designator_tbl,
 p_sub_component_tbl => l_sub_component_tbl,
 p_rev_operation_tbl => l_rev_operation_tbl,
 p_rev_op_resource_tbl => l_rev_op_resource_tbl,
 p_rev_sub_resource_tbl => l_rev_sub_resource_tbl,
 x_eco_rec => x_eco_rec,
 x_eco_revision_tbl => x_eco_revision_tbl,
 x_revised_item_tbl => x_revised_item_tbl,
 x_rev_component_tbl => x_rev_component_tbl,
 x_ref_designator_tbl => x_ref_designator_tbl,
 x_sub_component_tbl => x_sub_component_tbl,
 x_rev_operation_tbl => x_rev_operation_tbl,
 x_rev_op_resource_tbl => x_rev_op_resource_tbl,
 x_rev_sub_resource_tbl => x_rev_sub_resource_tbl,
 p_debug => 'Y',
 p_output_dir => '/usr/tmp',
 p_debug_filename => 'ECO_BO_DEBUG.log');

IF (l_return_status = 'S') THEN
 DBMS_OUTPUT.put_line ('Import SUCCESS!!');
 COMMIT;
 ELSE
 
 l_error_table.DELETE;
 Error_Handler.Get_Message_List (x_message_list => l_error_table);

FOR i IN 1 .. l_error_table.COUNT
 LOOP
 DBMS_OUTPUT.put_line ('Entity Id: ' || l_error_table (i).entity_id);
 DBMS_OUTPUT.put_line ( 'Index : ' || l_error_table (i).entity_index);
 DBMS_OUTPUT.put_line ( 'Table Name ' || l_error_table (i).table_name);
 DBMS_OUTPUT.put_line ( 'Mesg : ' || l_error_table (i).MESSAGE_TEXT);
 DBMS_OUTPUT.put_line ( 'row_identifier ' || l_error_table (i).row_identifier);
 DBMS_OUTPUT.put_line ('---------------------------------------');
 ROLLBACK;
 END LOOP;

DBMS_OUTPUT.put_line ('Total Messages: ' || TO_CHAR (i));
 END IF;
END;

Caso tenham dúvidas entrem em contato pelo skype: alexpagliarini53.

Deixe uma resposta

Powered by WordPress.com. Tema: Baskerville 2 por Anders Noren

Acima ↑

%d blogueiros gostam disto: