32: g_ret_unexpected varchar2(1) := FND_API.G_RET_STS_UNEXP_ERROR;
33:
34:
35: type t_number is table of number index by binary_integer;
36: type t_job_name_tbl is table of number index by wip_entities.wip_entity_name%type;
37:
38: -- MES secondary qty changes
39: type t_wsm_job_sec_qty_tbl is table of wsm_job_secondary_quantities%rowtype index by binary_integer;
40: type t_wsm_sj_sec_qty_tbl is table of wsm_sj_secondary_quantities%rowtype index by binary_integer;
40: type t_wsm_sj_sec_qty_tbl is table of wsm_sj_secondary_quantities%rowtype index by binary_integer;
41: type t_wsm_rj_sec_qty_tbl is table of wsm_rj_secondary_quantities%rowtype index by binary_integer;
42: type t_wsm_op_sec_qty_tbl is table of wsm_op_secondary_quantities%rowtype index by binary_integer;
43:
44: type t_we_id_tbl is table of wip_entities.wip_entity_id%type index by binary_integer;
45: type t_cur_qty_tbl is table of wsm_job_secondary_quantities.current_quantity%type index by binary_integer;
46: type t_cur_uom_tbl is table of wsm_job_secondary_quantities.uom_code%type index by binary_integer;
47: -- End MES secondary qty changes
48:
3620: last_updated_by = g_user_id
3621: WHERE wdj.wip_entity_id = l_wip_entity_id;
3622:
3623: -- ST : Fix for bug 5122653 --
3624: -- Update the details in WIP_ENTITIES as well...
3625: UPDATE wip_entities
3626: SET primary_item_id = p_rj_job_rec.primary_item_id
3627: WHERE wip_entity_id = l_wip_entity_id;
3628: -- ST : Fix for bug 5122653 end --
3621: WHERE wdj.wip_entity_id = l_wip_entity_id;
3622:
3623: -- ST : Fix for bug 5122653 --
3624: -- Update the details in WIP_ENTITIES as well...
3625: UPDATE wip_entities
3626: SET primary_item_id = p_rj_job_rec.primary_item_id
3627: WHERE wip_entity_id = l_wip_entity_id;
3628: -- ST : Fix for bug 5122653 end --
3629:
4827:
4828: l_new_we_id number;
4829: l_sub_loc_change number;
4830: l_ret_status varchar2(1);
4831: l_new_name wip_entities.wip_entity_name%type;
4832: l_dup_job_name wip_entities.wip_entity_name%type;
4833:
4834: l_job_counter NUMBER;
4835:
4828: l_new_we_id number;
4829: l_sub_loc_change number;
4830: l_ret_status varchar2(1);
4831: l_new_name wip_entities.wip_entity_name%type;
4832: l_dup_job_name wip_entities.wip_entity_name%type;
4833:
4834: l_job_counter NUMBER;
4835:
4836: l_sj_gen_object_id wip_entities.gen_object_id%type;
4832: l_dup_job_name wip_entities.wip_entity_name%type;
4833:
4834: l_job_counter NUMBER;
4835:
4836: l_sj_gen_object_id wip_entities.gen_object_id%type;
4837: l_rj_gen_object_id wip_entities.gen_object_id%type;
4838:
4839: l_kanban_card_id wip_discrete_jobs.kanban_card_id%type;
4840:
4833:
4834: l_job_counter NUMBER;
4835:
4836: l_sj_gen_object_id wip_entities.gen_object_id%type;
4837: l_rj_gen_object_id wip_entities.gen_object_id%type;
4838:
4839: l_kanban_card_id wip_discrete_jobs.kanban_card_id%type;
4840:
4841: l_msg_count number;
6296:
6297: -- for geneology purpose.... get the gen obj id
6298: select gen_object_id
6299: into l_sj_gen_object_id
6300: from wip_entities we
6301: where we.wip_entity_id = p_wltx_starting_jobs_tbl(l_rep_sj_index).wip_entity_id;
6302:
6303: for l_job_counter in p_wltx_resulting_jobs_tbl.first..p_wltx_resulting_jobs_tbl.last loop
6304:
6306:
6307: -- get the gen object id of the resulting jobs ...
6308: select gen_object_id
6309: into l_rj_gen_object_id
6310: from wip_entities we
6311: where we.wip_entity_id = p_wltx_resulting_jobs_tbl(l_job_counter).wip_entity_id;
6312: --Bug 5387828:Genealogy should be created only when the starting job is diff from
6313: --resulting job.
6314: if l_sj_gen_object_id <> l_rj_gen_object_id then
6399:
6400: -- for geneology purpose.... get the gen obj id
6401: select gen_object_id
6402: into l_rj_gen_object_id
6403: from wip_entities we
6404: where we.wip_entity_id = p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_id;
6405:
6406: for l_job_counter in p_wltx_starting_jobs_tbl.first..p_wltx_starting_jobs_tbl.last loop
6407:
6409:
6410: -- get the gen object id of the resulting jobs ...
6411: select gen_object_id
6412: into l_sj_gen_object_id
6413: from wip_entities we
6414: where we.wip_entity_id = p_wltx_starting_jobs_tbl(l_job_counter).wip_entity_id;
6415:
6416: --Bug 5367218:START. Genealogy should be created only when the resulting job is not
6417: -- among one of the starting jobs.
6986: p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_id := p_wltx_starting_jobs_tbl(l_rep_sj_index).wip_entity_id;
6987: else
6988: select wip_entity_id
6989: into p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_id
6990: from wip_entities
6991: where wip_entity_name like p_wltx_starting_jobs_tbl(l_rep_sj_index).wip_entity_name;
6992: end if;
6993: end if;
6994:
7004: where wip_entity_id = p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_id;
7005:
7006: l_stmt_num := 570;
7007:
7008: update wip_entities
7009: set wip_entity_name = p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_name,
7010: description = p_wltx_resulting_jobs_tbl(l_rj_index).description
7011: where wip_entity_id = p_wltx_resulting_jobs_tbl(l_rj_index).wip_entity_id;
7012: