64:
65: Cursor get_pending_qty_uom is
66: select wcti.transaction_quantity,
67: wcti.transaction_uom from
68: wip_cost_txn_interface wcti
69: where
70: wcti.wip_entity_id = p_wip_entity_id and
71: wcti.operation_seq_num = p_operation_seq_num and
72: wcti.resource_seq_num = p_resource_seq_num and
1162:
1163:
1164: PROCEDURE insert_wip_cost_txn
1165: (
1166: p_wip_cost_txn_interface_rec IN wip_cost_txn_interface%ROWTYPE,
1167: x_return_status OUT NOCOPY VARCHAR2
1168: )
1169: IS
1170:
1225: l_last_updated_by_name := fnd_global.user_name;
1226: l_last_update_login := fnd_global.login_id;
1227:
1228:
1229: --insert into table wip_cost_txn_interface
1230: BEGIN
1231:
1232: INSERT INTO wip_cost_txn_interface
1233: (last_updated_by_name,
1228:
1229: --insert into table wip_cost_txn_interface
1230: BEGIN
1231:
1232: INSERT INTO wip_cost_txn_interface
1233: (last_updated_by_name,
1234: last_updated_by,
1235: last_update_date,
1236: last_update_login,
1259: l_last_update_date,
1260: l_last_update_login,
1261: l_created_by_name,
1262: l_creation_date, -- sysdate,
1263: p_wip_cost_txn_interface_rec.operation_seq_num,
1264: p_wip_cost_txn_interface_rec.organization_id,
1265: p_wip_cost_txn_interface_rec.organization_code,
1266: l_process_phase,
1267: l_process_status,
1260: l_last_update_login,
1261: l_created_by_name,
1262: l_creation_date, -- sysdate,
1263: p_wip_cost_txn_interface_rec.operation_seq_num,
1264: p_wip_cost_txn_interface_rec.organization_id,
1265: p_wip_cost_txn_interface_rec.organization_code,
1266: l_process_phase,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1261: l_created_by_name,
1262: l_creation_date, -- sysdate,
1263: p_wip_cost_txn_interface_rec.operation_seq_num,
1264: p_wip_cost_txn_interface_rec.organization_id,
1265: p_wip_cost_txn_interface_rec.organization_code,
1266: l_process_phase,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1264: p_wip_cost_txn_interface_rec.organization_id,
1265: p_wip_cost_txn_interface_rec.organization_code,
1266: l_process_phase,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1265: p_wip_cost_txn_interface_rec.organization_code,
1266: l_process_phase,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1266: l_process_phase,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1267: l_process_status,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1268: p_wip_cost_txn_interface_rec.resource_seq_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1276: p_wip_cost_txn_interface_rec.employee_num,
1269: p_wip_cost_txn_interface_rec.transaction_date,
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1276: p_wip_cost_txn_interface_rec.employee_num,
1277: l_entity_type
1270: p_wip_cost_txn_interface_rec.transaction_quantity,
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1276: p_wip_cost_txn_interface_rec.employee_num,
1277: l_entity_type
1278: ) ;
1271: p_wip_cost_txn_interface_rec.transaction_type,
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1276: p_wip_cost_txn_interface_rec.employee_num,
1277: l_entity_type
1278: ) ;
1279:
1272: p_wip_cost_txn_interface_rec.transaction_uom,
1273: p_wip_cost_txn_interface_rec.wip_entity_name,
1274: p_wip_cost_txn_interface_rec.wip_entity_id,
1275: p_wip_cost_txn_interface_rec.employee_id,
1276: p_wip_cost_txn_interface_rec.employee_num,
1277: l_entity_type
1278: ) ;
1279:
1280:
4138: lc_load_res_type CONSTANT NUMBER := 1;
4139: lc_substitution_change_type CONSTANT NUMBER := 3;
4140:
4141:
4142: -- Constants used for inserting into wip_cost_txn_interface
4143:
4144: lc_res_transaction_type CONSTANT NUMBER := 1;
4145:
4146:
4144: lc_res_transaction_type CONSTANT NUMBER := 1;
4145:
4146:
4147: -- Records to hold the Job header,details
4148: -- and wip_cost_txn_interface data
4149:
4150: l_wip_cost_txn_interface_rec wip_cost_txn_interface%ROWTYPE;
4151: l_job_header_rec wip_job_schedule_interface%ROWTYPE;
4152: l_job_details_rec wip_job_dtls_interface%ROWTYPE;
4146:
4147: -- Records to hold the Job header,details
4148: -- and wip_cost_txn_interface data
4149:
4150: l_wip_cost_txn_interface_rec wip_cost_txn_interface%ROWTYPE;
4151: l_job_header_rec wip_job_schedule_interface%ROWTYPE;
4152: l_job_details_rec wip_job_dtls_interface%ROWTYPE;
4153:
4154:
4257: FND_MSG_PUB.ADD;
4258: RAISE FND_API.G_EXC_ERROR;
4259: end if; */
4260:
4261: l_wip_cost_txn_interface_rec.transaction_date := sysdate;
4262: l_wip_cost_txn_interface_rec.transaction_type := lc_res_transaction_type;
4263:
4264:
4265: -- Get the Group_id to be used for WIP Mass Load,
4258: RAISE FND_API.G_EXC_ERROR;
4259: end if; */
4260:
4261: l_wip_cost_txn_interface_rec.transaction_date := sysdate;
4262: l_wip_cost_txn_interface_rec.transaction_type := lc_res_transaction_type;
4263:
4264:
4265: -- Get the Group_id to be used for WIP Mass Load,
4266:
4276: FOR res_ctr in p_res_txn_dtls_tbl.FIRST.. p_res_txn_dtls_tbl.LAST
4277:
4278: LOOP
4279:
4280: l_wip_cost_txn_interface_rec.operation_seq_num := p_res_txn_dtls_tbl(res_ctr).operation_seq_num;
4281: l_wip_cost_txn_interface_rec.organization_id := p_res_txn_dtls_tbl(res_ctr).organization_id;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4277:
4278: LOOP
4279:
4280: l_wip_cost_txn_interface_rec.operation_seq_num := p_res_txn_dtls_tbl(res_ctr).operation_seq_num;
4281: l_wip_cost_txn_interface_rec.organization_id := p_res_txn_dtls_tbl(res_ctr).organization_id;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4285:
4278: LOOP
4279:
4280: l_wip_cost_txn_interface_rec.operation_seq_num := p_res_txn_dtls_tbl(res_ctr).operation_seq_num;
4281: l_wip_cost_txn_interface_rec.organization_id := p_res_txn_dtls_tbl(res_ctr).organization_id;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4285:
4286: If l_wip_cost_txn_interface_rec.transaction_quantity = 0 then
4279:
4280: l_wip_cost_txn_interface_rec.operation_seq_num := p_res_txn_dtls_tbl(res_ctr).operation_seq_num;
4281: l_wip_cost_txn_interface_rec.organization_id := p_res_txn_dtls_tbl(res_ctr).organization_id;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4285:
4286: If l_wip_cost_txn_interface_rec.transaction_quantity = 0 then
4287: FND_MESSAGE.SET_NAME('CSD','CSD_TRX_QTY_ZERO');
4280: l_wip_cost_txn_interface_rec.operation_seq_num := p_res_txn_dtls_tbl(res_ctr).operation_seq_num;
4281: l_wip_cost_txn_interface_rec.organization_id := p_res_txn_dtls_tbl(res_ctr).organization_id;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4285:
4286: If l_wip_cost_txn_interface_rec.transaction_quantity = 0 then
4287: FND_MESSAGE.SET_NAME('CSD','CSD_TRX_QTY_ZERO');
4288: FND_MSG_PUB.ADD;
4282: l_wip_cost_txn_interface_rec.organization_code := p_res_txn_dtls_tbl(res_ctr).organization_code;
4283: l_wip_cost_txn_interface_rec.resource_seq_num := p_res_txn_dtls_tbl(res_ctr).resource_seq_num;
4284: l_wip_cost_txn_interface_rec.transaction_quantity := p_res_txn_dtls_tbl(res_ctr).transaction_quantity;
4285:
4286: If l_wip_cost_txn_interface_rec.transaction_quantity = 0 then
4287: FND_MESSAGE.SET_NAME('CSD','CSD_TRX_QTY_ZERO');
4288: FND_MSG_PUB.ADD;
4289: RAISE FND_API.G_EXC_ERROR;
4290: end if;
4288: FND_MSG_PUB.ADD;
4289: RAISE FND_API.G_EXC_ERROR;
4290: end if;
4291:
4292: l_wip_cost_txn_interface_rec.transaction_uom := p_res_txn_dtls_tbl(res_ctr).transaction_uom;
4293: l_wip_cost_txn_interface_rec.wip_entity_name := p_res_txn_dtls_tbl(res_ctr).wip_entity_name;
4294: l_wip_cost_txn_interface_rec.wip_entity_id := p_res_txn_dtls_tbl(res_ctr).wip_entity_id;
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4289: RAISE FND_API.G_EXC_ERROR;
4290: end if;
4291:
4292: l_wip_cost_txn_interface_rec.transaction_uom := p_res_txn_dtls_tbl(res_ctr).transaction_uom;
4293: l_wip_cost_txn_interface_rec.wip_entity_name := p_res_txn_dtls_tbl(res_ctr).wip_entity_name;
4294: l_wip_cost_txn_interface_rec.wip_entity_id := p_res_txn_dtls_tbl(res_ctr).wip_entity_id;
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4297:
4290: end if;
4291:
4292: l_wip_cost_txn_interface_rec.transaction_uom := p_res_txn_dtls_tbl(res_ctr).transaction_uom;
4293: l_wip_cost_txn_interface_rec.wip_entity_name := p_res_txn_dtls_tbl(res_ctr).wip_entity_name;
4294: l_wip_cost_txn_interface_rec.wip_entity_id := p_res_txn_dtls_tbl(res_ctr).wip_entity_id;
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4297:
4298: l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4292: l_wip_cost_txn_interface_rec.transaction_uom := p_res_txn_dtls_tbl(res_ctr).transaction_uom;
4293: l_wip_cost_txn_interface_rec.wip_entity_name := p_res_txn_dtls_tbl(res_ctr).wip_entity_name;
4294: l_wip_cost_txn_interface_rec.wip_entity_id := p_res_txn_dtls_tbl(res_ctr).wip_entity_id;
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4297:
4298: l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4299: l_wip_cost_txn_interface_rec.employee_num := p_res_txn_dtls_tbl(res_ctr).employee_num;
4300:
4294: l_wip_cost_txn_interface_rec.wip_entity_id := p_res_txn_dtls_tbl(res_ctr).wip_entity_id;
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4297:
4298: l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4299: l_wip_cost_txn_interface_rec.employee_num := p_res_txn_dtls_tbl(res_ctr).employee_num;
4300:
4301: --insert into table wip_cost_txn_interface
4302:
4295:
4296: -- l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4297:
4298: l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4299: l_wip_cost_txn_interface_rec.employee_num := p_res_txn_dtls_tbl(res_ctr).employee_num;
4300:
4301: --insert into table wip_cost_txn_interface
4302:
4303: IF ( FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
4297:
4298: l_wip_cost_txn_interface_rec.employee_id := p_res_txn_dtls_tbl(res_ctr).employee_id;
4299: l_wip_cost_txn_interface_rec.employee_num := p_res_txn_dtls_tbl(res_ctr).employee_num;
4300:
4301: --insert into table wip_cost_txn_interface
4302:
4303: IF ( FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
4304: FND_LOG.STRING( FND_LOG.LEVEL_EVENT,
4305: lc_mod_name||'beforecallinsertwipcosttxn',
4312: item_id => 0,
4313: precision => 38,
4314: from_quantity => 1,
4315: from_unit => p_res_txn_dtls_tbl(res_ctr).uom_code,
4316: to_unit => l_wip_cost_txn_interface_rec.transaction_uom ,
4317: from_name => NULL,
4318: to_name => NULL);
4319:
4320:
4325: -- res_transactions_uom.conversion_rate;
4326:
4327:
4328:
4329: insert_wip_cost_txn( p_wip_cost_txn_interface_rec => l_wip_cost_txn_interface_rec,
4330: x_return_status => x_return_status );
4331:
4332:
4333: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN