The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_debug_stmt);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_debug_stmt);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_debug_stmt);
Adding the organization_id condition to the select below.
*/
select expense_account into x_account
from mtl_secondary_inventories
where secondary_inventory_name = x_dest_sub_inv
and organization_id = x_dest_org_id;
select EXPENSE_ACCOUNT into x_account
from MTL_SYSTEM_ITEMS
where organization_id = x_dest_org_id
and inventory_item_id = x_item_id;
select expense_account into x_account
from mtl_parameters
where organization_id = x_dest_org_id;
select material_account into x_account
from mtl_parameters
where organization_id = x_dest_org_id;
select expense_account into x_account
from mtl_secondary_inventories
where secondary_inventory_name = x_dest_sub_inv
and organization_id = x_dest_org_id;
select expense_account into x_account
from mtl_parameters
where organization_id = x_dest_org_id;
select material_account into x_account
from mtl_secondary_inventories
where secondary_inventory_name = x_dest_sub_inv
and organization_id = x_dest_org_id;
select material_account into x_account
from mtl_parameters
where organization_id = x_dest_org_id;
select inventory_asset_flag into x_asset_item_flag
from mtl_system_items
where organization_id = x_dest_org_id
and inventory_item_id = x_item_id;
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.check_inv_item_type EXCEPTION at '||x_progress
||': '||SQLERRM);
select asset_inventory into x_asset_inventory
from mtl_secondary_inventories
where secondary_inventory_name = x_dest_sub_inv
and organization_id = x_dest_org_id;
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
select EXPENSE_ACCOUNT into x_expense_acc
from MTL_SYSTEM_ITEMS
where organization_id = x_dest_org_id
and inventory_item_id = x_item_id;
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.expense result='||result);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.expense x_expense_acc='||x_expense_acc);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
SELECT outside_processing_account
INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND OUTSIDE_PROCESSING_ACCOUNT <> -1;
SELECT OVERHEAD_ACCOUNT INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND OVERHEAD_ACCOUNT <> -1
AND NVL(x_wip_entity_type,'2') in ('1', '3', '4', '5'));
SELECT outside_processing_account INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND OUTSIDE_PROCESSING_ACCOUNT <> -1
AND NVL(x_wip_entity_type,'2') in ('1', '3', '4', '5'));
SELECT RESOURCE_ACCOUNT INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND RESOURCE_ACCOUNT <> -1
AND NVL(x_wip_entity_type,'2') in ('1', '3', '4', '5'));
SELECT MATERIAL_OVERHEAD_ACCOUNT INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND MATERIAL_OVERHEAD_ACCOUNT <> -1
AND NVL(x_wip_entity_type,'2') in ('1', '3', '4', '5'));
SELECT MATERIAL_ACCOUNT INTO x_wip_job_account
FROM WIP_DISCRETE_JOBS
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND MATERIAL_ACCOUNT <> -1
AND NVL(x_wip_entity_type,'2') in ('1', '3', '4', '5'));
SELECT FLEX_VALUE INTO x_wip_job_account
FROM FND_FLEX_VALUES_VL
WHERE FLEX_VALUE = x_destination_organization_id
AND (FLEX_VALUE_SET_ID = 102256);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, 'EXCEPTION IN PO_WF_PO_CHARGE_ACC.JOB_WIP');
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
SELECT OVERHEAD_ACCOUNT INTO x_wip_schedule_account
FROM WIP_REPETITIVE_SCHEDULES
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND '2' = NVL(x_wip_entity_type,'1')
AND REPETITIVE_SCHEDULE_ID = NVL(x_wip_repetitive_schedule_id,-99)
AND OVERHEAD_ACCOUNT <> -1);
SELECT OUTSIDE_PROCESSING_ACCOUNT INTO x_wip_schedule_account
FROM WIP_REPETITIVE_SCHEDULES
WHERE ORGANIZATION_ID = TO_NUMBER(x_destination_organization_id)
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND '2' = NVL(x_wip_entity_type,'1')
AND REPETITIVE_SCHEDULE_ID = NVL(x_wip_repetitive_schedule_id,-99)
AND OUTSIDE_PROCESSING_ACCOUNT <> -1);
SELECT RESOURCE_ACCOUNT INTO x_wip_schedule_account
FROM WIP_REPETITIVE_SCHEDULES
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND '2' = NVL(x_wip_entity_type,'1')
AND REPETITIVE_SCHEDULE_ID = NVL(x_wip_repetitive_schedule_id,-99)
AND RESOURCE_ACCOUNT <> -1) ;
SELECT MATERIAL_OVERHEAD_ACCOUNT INTO x_wip_schedule_account
FROM WIP_REPETITIVE_SCHEDULES
WHERE ORGANIZATION_ID = TO_NUMBER(x_destination_organization_id)
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND '2' = NVL(x_wip_entity_type,'1')
AND REPETITIVE_SCHEDULE_ID = NVL(x_wip_repetitive_schedule_id,-99)
AND MATERIAL_OVERHEAD_ACCOUNT <> -1);
SELECT MATERIAL_ACCOUNT INTO x_wip_schedule_account
FROM WIP_REPETITIVE_SCHEDULES
WHERE ORGANIZATION_ID = x_destination_organization_id
AND (WIP_ENTITY_ID = NVL(x_wip_entity_id,-99)
AND '2' = NVL(x_wip_entity_type,'2')
AND REPETITIVE_SCHEDULE_ID = NVL(x_wip_repetitive_schedule_id,-99)
AND MATERIAL_ACCOUNT <> -1);
SELECT FLEX_VALUE INTO x_wip_schedule_account
FROM FND_FLEX_VALUES_VL
WHERE FLEX_VALUE = x_destination_organization_id
AND (FLEX_VALUE_SET_ID = 102256);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, 'EXCEPTION IN PO_WF_PO_CHARGE_ACC.SCHEDULE');
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'po_encumbrance_flag='||po_encumbrance_flag||', x_destination_type='||x_destination_type||', l_is_financing_flag='||l_is_financing_flag||', l_is_advance_flag='||l_is_advance_flag);
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'org_id from PO_MOAC='||PO_MOAC_UTILS_PVT.get_current_org_id||', org_id from PO_GA_PVT='||PO_GA_PVT.get_current_org );
SELECT nvl(fsp.purch_encumbrance_flag,'N'),
nvl(fsp.req_encumbrance_flag,'N')
INTO l_purch_encumbrance_flag,
l_req_encumbrance_flag
FROM financials_system_parameters fsp,
gl_sets_of_books sob,
po_system_parameters psp,
rcv_parameters rcv
WHERE fsp.set_of_books_id = sob.set_of_books_id
AND rcv.organization_id (+) = fsp.inventory_organization_id;
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'PO_CORE_S: l_purch_encumbrance_flag='||l_purch_encumbrance_flag||', l_req_encumbrance_flag='||l_req_encumbrance_flag);
SELECT purch_encumbrance_flag,
req_encumbrance_flag
INTO l_purch_encumbrance_flag,
l_req_encumbrance_flag
FROM FINANCIALS_SYSTEM_PARAMETERS; -- view
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'View: l_purch_encumbrance_flag='||l_purch_encumbrance_flag||', l_req_encumbrance_flag='||l_req_encumbrance_flag);
SELECT purch_encumbrance_flag,
req_encumbrance_flag
INTO l_purch_encumbrance_flag,
l_req_encumbrance_flag
FROM FINANCIALS_SYSTEM_PARAMS_ALL -- table
WHERE org_id = PO_MOAC_UTILS_PVT.get_current_org_id;
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'Table: MOAC: l_purch_encumbrance_flag='||l_purch_encumbrance_flag||', l_req_encumbrance_flag='||l_req_encumbrance_flag);
SELECT purch_encumbrance_flag,
req_encumbrance_flag
INTO l_purch_encumbrance_flag,
l_req_encumbrance_flag
FROM FINANCIALS_SYSTEM_PARAMS_ALL -- table
WHERE org_id = PO_GA_PVT.get_current_org;
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'Table: PO_GA_PVT: l_purch_encumbrance_flag='||l_purch_encumbrance_flag||', l_req_encumbrance_flag='||l_req_encumbrance_flag);
PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'After: l_is_financing_flag='||l_is_financing_flag||', l_is_advance_flag='||l_is_advance_flag);
/* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.is_dest_accounts_flow_type result='||result);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.is_SPS_distribution result='||result);
SELECT outside_operation_flag -- it is a NOT NULL column
INTO is_shopfloor_enabled_item
FROM MTL_SYSTEM_ITEMS
WHERE inventory_item_id = p_item_id AND
organization_id = p_inv_org_id;
SELECT cost_of_sales_account
INTO l_COGS_account_id
FROM MTL_PARAMETERS
WHERE ORGANIZATION_ID = p_inv_org_id;
SELECT expense_account
INTO l_item_expense_account_id
FROM MTL_SYSTEM_ITEMS
WHERE organization_id = p_inv_org_id AND
inventory_item_id = p_item_id;
SELECT expense_account
INTO l_org_expense_account_id
FROM MTL_PARAMETERS
WHERE organization_id = p_inv_org_id;
SELECT material_account
INTO l_org_material_account_id
FROM MTL_PARAMETERS
WHERE organization_id = p_inv_org_id;
SELECT operating_unit
INTO l_temp_ou_id
FROM org_organization_definitions
WHERE organization_id = p_logical_inv_org_id;
PO_WF_DEBUG_PKG.insert_debug(p_itemtype, p_itemkey,
'LINV does not belong to POU');
PO_WF_DEBUG_PKG.insert_debug(p_itemtype, p_itemkey,
'Exception while sanity checking LINV');
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.get_SPS_charge_account result='||result);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.get_SPS_charge_account l_SPS_charge_account_id='||
l_SPS_charge_account_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.get_SPS_charge_account EXCEPTION at '|| l_progress);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.is_dest_charge_acc_null '||
'Copying DestChargeAccId to TEMP_ACCOUNT_ID '||
'(current val = ' || l_temp_acc_id || ') ' ||
'dest_charge_account_id='||l_dest_charge_account_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.is_dest_charge_acc_null result='||result||
' l_dest_charge_account_id='||l_dest_charge_account_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.are_COAs_same result='||result);
PO_WF_DEBUG_PKG.insert_debug(itemtype,
itemkey,
'PO_WF_PO_CHARGE_ACC.set_null_resp_id: Setting the Responsibility to NULL ');
PO_WF_DEBUG_PKG.insert_debug(itemtype,
itemkey,
'PO_WF_PO_CHARGE_ACC.reset_resp_id: Setting the Responsibility back to:' || l_resp_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.validate_combination: l_flex_status='
||l_flex_status);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'PO_WF_PO_CHARGE_ACC.validate_combination: l_is_combination_valid is false');