--PR and PO (Standard)
Oracle Apps R12 OPM, SCM, INV, Procurement, OM Modules Functional and Technical Solution by Razaul Karim Reza
Translate
Tuesday, April 16, 2024
Query for PR PO Receipt Invoice Payments in Orecle EBS R12
Adding Resp Via API / Deleting Executable and concurrent Program
DECLARE
lv_user_name VARCHAR2 (20) := 'SENTHIL';
lv_req_resp_key VARCHAR2 (50); -- := 'APPLICATION_DEVELOPER';
lv_description VARCHAR2 (100) := 'Via script added';
lv_req_resp_name VARCHAR2 (200);
lv_appl_shrt_name VARCHAR2 (20);
lv_appl_name VARCHAR2 (50);
lv_resp_key VARCHAR2 (50);
cursor c1 is
SELECT fav.application_short_name,
fav.application_name,
upper(frv.responsibility_name) responsibility_name,
frv.responsibility_key
--INTO lv_appl_shrt_name, lv_appl_name, lv_req_resp_name
FROM fnd_application_vl fav, fnd_responsibility_vl frv
WHERE frv.application_id = fav.application_id
and upper(frv.responsibility_name) in
(
'FUNCTIONAL ADMINISTRATOR'
,'AP PAYABLES SUPER USER'
);
BEGIN
DBMS_OUTPUT.put_line ('Below Responsibility Added for this user '|| lv_user_name);
DBMS_OUTPUT.put_line ('--------------------------------------------------------------');
for rec in c1
loop
/*SELECT fav.application_short_name,
fav.application_name,
frv.responsibility_name
INTO lv_appl_shrt_name, lv_appl_name, lv_req_resp_name
FROM fnd_application_vl fav, fnd_responsibility_vl frv
WHERE frv.application_id = fav.application_id
AND frv.responsibility_key = lv_req_resp_key; */
fnd_user_pkg.addresp (username => lv_user_name,
resp_app => rec.application_short_name, --lv_appl_shrt_name,
resp_key => rec.responsibility_key , --lv_req_resp_key,
security_group => 'STANDARD',
description => lv_description,
start_date => SYSDATE,
end_date => NULL
);
COMMIT;
DBMS_OUTPUT.put_line (rec.responsibility_name);
end loop;
DBMS_OUTPUT.put_line ('--------------------------------------------------------------');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line ('Responsibility IS NOT added due to ' || SQLCODE || '; ' || SUBSTR (SQLERRM, 1, 250));
ROLLBACK;
END;
/* Deleting Executable and concurrent Program*/
SET SERVEROUTPUT ON; DECLARE l_prog_short_name VARCHAR2 (240); l_exec_short_name VARCHAR2 (240); l_appl_full_name VARCHAR2 (240); l_appl_short_name VARCHAR2 (240); l_del_prog_flag VARCHAR2 (1) := 'Y'; --Set flag whether to delete Concurrent program or not l_del_exec_flag VARCHAR2 (1) := 'Y'; --Set flag whether to delete executable or not BEGIN -- -- set concurrent program and executable short name -- l_prog_short_name := 'XX_TEST_CP'; -- Concurrent program short name l_exec_short_name := 'XX_TEST_EXEC'; -- Executable short name l_appl_full_name := 'XX Custom Application'; -- Application full name l_appl_short_name := 'XXCUST'; -- Application Short name -- -- Check if the program exists. if found, delete the program -- IF fnd_program.program_exists (l_prog_short_name, l_appl_short_name) AND fnd_program.executable_exists (l_exec_short_name, l_appl_short_name) THEN IF l_del_prog_flag = 'Y' THEN -- --API call to delete Concurrent Program -- fnd_program.delete_program (l_prog_short_name, l_appl_full_name); -- END IF; -- IF l_del_exec_flag = 'Y' THEN -- --API call to delete Executable -- fnd_program.delete_executable (l_exec_short_name, l_appl_full_name); -- END IF; COMMIT; -- DBMS_OUTPUT.put_line ('Concurrent Program '||l_prog_short_name || ' deleted successfully'); DBMS_OUTPUT.put_line ('Executable '||l_exec_short_name || ' deleted successfully'); -- -- if the program does not exist in the system -- ELSE DBMS_OUTPUT.put_line (l_prog_short_name ||' or '||l_exec_short_name|| ' not found'); END IF; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('Error while deleting: ' || SQLERRM); END;
Query to find Responsibility for the Concurrent Program
SELECT distinct frt.responsibility_name,
frg.request_group_name,
frg.description,fcpt.user_concurrent_program_name
FROM fnd_request_groups frg
,fnd_request_group_units frgu
,fnd_concurrent_programs fcp
,fnd_concurrent_programs_tl fcpt
,fnd_responsibility_tl frt
,fnd_responsibility frs
WHERE frgu.unit_application_id = fcp.application_id
AND frgu.request_unit_id = fcp.concurrent_program_id
AND frg.request_group_id = frgu.request_group_id
AND frg.application_id = frgu.application_id
AND fcpt.source_lang = USERENV('LANG')
AND fcp.application_id = fcpt.application_id
AND fcp.concurrent_program_id = fcpt.concurrent_program_id
AND frs.application_id = frt.application_id
AND frs.responsibility_id = frt.responsibility_id
AND frt.source_lang = USERENV('LANG')
AND frs.request_group_id = frg.request_group_id
AND frs.application_id = frg.application_id
--AND fcp.concurrent_program_name = <shortname>
AND fcpt.user_concurrent_program_name LIKE '%XXX%Pre%%%'
and frt.responsibility_name like '%XX_PO%'
Tuesday, April 9, 2024
Query for item onhand quantity & Lot wise query
=============Query for item onhand quantity===================
SUM (mq.transaction_quantity) on_hand,msi.INVENTORY_ITEM_ID,msi.organization_id
FROM apps.org_organization_definitions ood,
apps.mtl_onhand_quantities mq,
apps.mtl_system_items_b msi,
mtl_item_locations b
WHERE 1 = 1
AND mq.organization_id = msi.organization_id
AND ood.organization_id(+) = msi.organization_id
AND mq.inventory_item_id = msi.inventory_item_id
AND mq.locator_ID = b.Inventory_location_id
--AND mq.inventory_item_id = b.Inventory_item_id
--and mq.organization_id = b.Organization_id
AND msi.segment1 = nvl(:P_ITEM_CODE,msi.segment1)
and msi.organization_id=nvl(:p_organization_id,msi.organization_id)
and mq.subinventory_code=nvl(:p_subinvcode,mq.subinventory_code)
GROUP BY msi.segment1, ood.organization_name, mq.subinventory_code,msi.organization_id,msi.INVENTORY_ITEM_ID,b.SEGMENT1,b.SEGMENT2,b.SEGMENT3,b.SEGMENT4
============================Lotwise Query===============================
select --*
moqd.ORGANIZATION_ID
,OOD.ORGANIZATION_NAME
,moqd.SUBINVENTORY_CODE
,msib.SEGMENT1 item
,SUM (moqd.primary_transaction_quantity) on_hand
,SUM (moqd.secondary_transaction_quantity) secondary_onhand
,msib.PRIMARY_UOM_CODE
,moqd.secondary_uom_code
,moqd.LOT_NUMBER
,(SELECT EXPIRATION_DATE FROM MTL_LOT_NUMBERS WHERE LOT_NUMBER=moqd.LOT_NUMBER
AND inventory_item_id =MOQD.inventory_item_id AND organization_id =MOQD.organization_id )LOT_EXPIRY_DATE
FROM
mtl_onhand_quantities_detail moqd
,mtl_system_items_b msib
,ORG_ORGANIZATION_DEFINITIONS OOD
WHERE 1 = 1
--AND moqd.organization_id = 143
/*AND moqd.subinventory_code = 'R DRY HALA'
AND moqd.inventory_item_id = 9095
AND moqd.owning_organization_id = 143
AND moqd.planning_organization_id = 143*/
AND moqd.INVENTORY_ITEM_ID=msib.INVENTORY_ITEM_ID
AND moqd.organization_id=msib.organization_id
AND OOD.organization_id=msib.organization_id
group by
moqd.ORGANIZATION_ID
,moqd.SUBINVENTORY_CODE
,msib.SEGMENT1
,moqd.secondary_uom_code
,moqd.LOT_NUMBER
,msib.PRIMARY_UOM_CODE
,OOD.ORGANIZATION_NAME
,MOQD.inventory_item_id
=================Using API=====================================
create or replace function XXMADN_GET_OHQTY(
p_inv_item_id in varchar2,
p_org_id number,
p_qty_type IN VARCHAR2
)
return number is
x_return_status VARCHAR2 (50);
x_msg_count VARCHAR2 (50);
x_msg_data VARCHAR2 (50);
v_item_id NUMBER;
v_organization_id NUMBER;
v_qoh NUMBER;
v_rqoh NUMBER;
v_atr NUMBER;
v_att NUMBER;
v_qr NUMBER;
v_qs NUMBER;
v_lot_control_code BOOLEAN;
v_serial_control_code BOOLEAN;
L_QTY NUMBER;
BEGIN
SELECT inventory_item_id, mp.organization_id
INTO v_item_id, v_organization_id
FROM mtl_system_items_b msib, mtl_parameters mp
WHERE msib.inventory_item_id = p_inv_item_id
AND msib.organization_id = mp.organization_id
AND msib.organization_id =p_org_id; -- :organization_code;
v_qoh := NULL;
v_rqoh := NULL;
v_atr := NULL;
v_lot_control_code := FALSE;
v_serial_control_code := FALSE;
fnd_client_info.set_org_context (1);
inv_quantity_tree_pub.query_quantities (
p_api_version_number => 1.0,
p_init_msg_lst => 'F',
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_organization_id => v_organization_id,
p_inventory_item_id => v_item_id,
p_tree_mode => apps.inv_quantity_tree_pub.g_transaction_mode,
p_is_revision_control => FALSE,
p_is_lot_control => v_lot_control_code,
p_is_serial_control => v_serial_control_code,
p_revision => NULL, -- p_revision,
p_lot_number => NULL, -- p_lot_number,
p_lot_expiration_date => SYSDATE,
p_subinventory_code => NULL, -- p_subinventory_code,
p_locator_id => NULL, -- p_locator_id,
p_onhand_source => 3,
x_qoh => v_qoh, -- Quantity on-hand
x_rqoh => v_rqoh, --reservable quantity on-hand
x_qr => v_qr,
x_qs => v_qs,
x_att => v_att, -- available to transact
x_atr => v_atr -- available to reserve
);
IF
p_qty_type='OHQ' THEN --On Hand qty
L_QTY :=v_qoh; --v_QuantityOnhand;
ELSE IF
p_qty_type='ATR' THEN --Available to Reserve
L_QTY :=v_atr;
ELSE IF
p_qty_type='ATT' THEN --Available to Transact
L_QTY :=v_att;
END IF;
END IF;
END IF;
return L_QTY;
--return v_atr;
DBMS_OUTPUT.put_line ('On-Hand Quantity: ' || v_qoh);
DBMS_OUTPUT.put_line ('Available to reserve: ' || v_atr);
DBMS_OUTPUT.put_line ('Quantity Reserved: ' || v_qr);
DBMS_OUTPUT.put_line ('Quantity Suggested: ' || v_qs);
DBMS_OUTPUT.put_line ('Available to Transact: ' || v_att);
DBMS_OUTPUT.put_line ('Available to Reserve: ' || v_atr);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('ERROR: ' || SQLERRM);
END XXMADN_GET_OHQTY;
select XXMADN_GET_OHQTY(183645,1404,'OHQ')from dual
Thursday, April 4, 2024
Query to find all APPLICATION (module) information
-------------------------------------------------------------------------------
-- Query to find all APPLICATION (module) information
-------------------------------------------------------------------------------
SELECT fa.application_id "Application ID",
fat.application_name "Application Name",
fa.application_short_name "Application Short Name",
fa.basepath "Basepath"
FROM fnd_application fa,
fnd_application_tl fat
WHERE fa.application_id = fat.application_id
AND fat.language = USERENV('LANG')
-- AND fat.application_name = 'Payables' -- <change it>
ORDER BY fat.application_name
Monday, April 1, 2024
SQL To Extract the Account Derivation Rules (ADR) In OPM SUbledger Accounting (SLA) (Doc ID 1929297.1)
Select on ADRs and conditions
1)
select * from xla_seg_rules_b
where segment_rule_code = '&SegmentRuleCode';
'Segment Rule Code' is the value displayed in the 'Rule Code' field in the Accounting Derivation Rules form
2)
select * from xla_seg_rule_details
where segment_rule_code = '&SegmentRuleCode';
3)
select * from xla_conditions
where segment_rule_detail_id in (select segment_rule_detail_id
from xla_seg_rule_details
where segment_rule_code =
'&SegmentRuleCode';
4)
select * from xla_sources_b
where (application_id,source_code,source_type_code) in
(select source_application_id,source_code,source_type_code
from xla_conditions
where segment_rule_detail_id in
(select segment_rule_detail_id
from xla_seg_rule_details
where segment_rule_code = '&SegmentRuleCode'));
5)
select * from fnd_flex_value_sets
where flex_value_set_id in
(select flex_value_set_id
from xla_sources_b
where (application_id,source_code,source_type_code) in
(select source_application_id,source_code,source_type_code
from xla_conditions
where segment_rule_detail_id in
(select segment_rule_detail_id
from xla_seg_rule_details
where segment_rule_code = '&SegmentRuleCode')));
6)
select * from fnd_flex_validation_tables
where flex_value_set_id in
(select flex_value_set_id
from xla_sources_b
where (application_id,source_code,source_type_code) in
(select source_application_id,source_code,source_type_code
from xla_conditions
where segment_rule_detail_id in
(select segment_rule_detail_id
from xla_seg_rule_details
where segment_rule_code = '&SegmentRuleCode')));
R12 Subledger Accounting (SLA)
What is Subledger Accounting?
#Subledger Accounting is a Service, not an Application.
#There are no SLA responsibilities and there is no direct login to SLA.
# # SLA forms and programs are embedded within standard Oracle Application responsibilities(e.g. Payables Manager).
=> Simply, It is a rule-based accounting engine, toolset & repository supporting Oracle E-Business Suite modules.
=> Allows multiple accounting representations for a single business event, resolving conflicts between corporate and local fiscal accounting requirements.
=> Retains the most granular level of detail in the subledger accounting model, with different summarization options in the General Ledger, allowing full auditability and reconciliation.
=> Introduces a common data model and UI across subledgers, replaces various disparate 11i setups, providing single source of truth for financial and management analysis. Screen shots of sample Invoice Distribution and It's Accounting Journal Entries
Group accounting event types into user-orientated transaction categories called event classes. For example, group the event types Invoice Approved, Invoice Adjusted, and Invoice Canceled into the event class Invoices. Then assign AMB components, such as journal line types, by event class within the application accounting definition. This assignment simplifies setup when the accounting requirements for all event types in a class are the same. Also, sources assigned to an event class are available for the accounting of all event types in that event class.
Example Payables:
Invoice, Debit Memo, Prepayment, Payments, Refunds
Receivables: Invoice, Deposit, Receipt, Bill Receivable
Event Type
Each accounting event should be represented by an accounting event type. These types are registered in the AMB. When subledger journal entries need to be created, the event
type determines which application accounting definitions should be used to process the accounting event. Application accounting definitions created in the AMB determine the
lines, descriptions, accounts, and other elements of subledger journal entries.
Example
AP Invoice Events: Validated, Adjusted, Cancelled
AR Receipt Events: Created, Applied, Unapplied, Updated, Reversed
Application Accounting Definition(AAD)
Use Application Accounting Definitions(AADs) to assign journal line definitions and header descriptions to event classes and event types. AADs must be included in a subledger accounting method and assigned to a ledger. You can group accounting definitions from multiple products, such as Oracle Payables, receivables Assets into a single accounting method.
Journal Line Definition(JLD)
Journal line type, description, account derivations rules grouped together as a journal line definition to create the rule for particular event type.
Journal Line Type(JLT)
-Identify the natural side: Debit, Credit, Gain/Loss
-Determine the accounting class
-Set under which conditions the rule will create a line
-Define the values needed for entry line generation, such as amount, currency, conversion rate information
-Control behavior for certain features i.e. multi period accounting, business flows, line merging and summarization
Account derivation rules are used to determine the account combinations for subledger journal entries. You can define various rules in te AMB to determine how a journal entry
account is derived. You can derive accounts segment by segment or as a complete account combination. This picture shows an Account Derivation Rule with conditional logic. If
the condition holds for priority 1, then this source (Invoice Liability Account) is used. If not, SLA uses the source for priority 2(If it is available).
Journal Entry Description
This is useful in finding the actual transaction object details(Ex: Invoice/Payment details from journal line)
Transaction Object
Example for transaction objects:
ap_invoice_extract_details_v.xdf
ap_invoice_extract_header_v.xdf
ap_payment_extract_details_v.xdf
ap_payment_extract_header_v.xdf
ap_prepayapp_extract_details_v.xdf
ap_system_parameters_extract_v.xdf
Transaction Object is nothing but a view which fetches all transaction information required to create journal line for particular event class. AP_INVOICE_EXTRACT_HEADER_V, AP_INVOICE_EXTRACT_DETAILS_V are transaction objects for event class Invoices. So, accounting for all invoice type events get transaction information from these transaction objects.
Sources Each column in the transaction object is defined as Source in the AMB. AMB uses these sources to get transaction information from Transaction Objects
Accounting Attributes
Sources are mapped with Accounting Attributes. Accounting Attributes are bridge between JLT and Sources.
Example
GL Date, Entered Currency Code, Entered Amount, Accounted Amount, Conversion Rate Date, Conversion Rate Type, Conversion Rate, Distribution Type, Party Type, Party Identifier, Party Site Identifier
The XLA_EVENTS table stores records for accounting events generated by subledger applications. Each product team populates this table by calling Subledger Accounting API and the respective product team will decide when this table is to be populated during the transaction life cycle.
The XLA_AE_HEADERS table stores subledger journal entries. There is a one-to-many relationship between accounting events and journal entry headers.
The XLA_DISTRIBUTION_LINKS table stores detailed distributions for journal entries. This table stores the data at most granular level and represents data contained in respective subledger product’s distribution tables. The detailed distributions stored in this table are merged into accounting lines and stored in XLA_AE_LINES table. Subledger Accounting uses this table for processing reversals and business flows.
The XLA_AE_LINES table stores the subledger journal entry lines. There is a one-to-many relationship between subledger journal entry headers and subledger journal entry lines. This table will store at least one row for debit and one row for credit for each accounting entry created. If multiple debit or credit journal entry lines exists for any specific event type and if the journal line type allows merge matching lines then these lines will be merged into single line. The unmerged granular level of detail for each accounting line will be available in XLA_DISTRIBUTION_LINKS table.
What are the Accounting Methods seeded in SLA?
Standard Accrual
Standard Cash
Encumbrance Accrual and Encumbrance Cash
United States Federal
China Standard Accrual
What are the reports available in SLA?
Journal Entries Report
Account Analysis Report
Third Party Balances Report
Period Close Exceptions Report
Open Account Balances Listing
Accounts Receivable-AR setups in Oracle EBS Functional Financials - Apps R12
1. Oracle Receivables -> Setup -> System ->System Options a. Receivable GL related setup b. Transaction and Customer rela...
-
Oracle Alert : Move order Created from Production Batch I Got one Requirement from Production and Store Team, as below So I created...
-
Oracle Process Manufacturing Process Execution – List of database tables GME_BATCH_HEADER GME_BATCH_HEADER_MIG GME_BATCH_HISTORY GME_BATCH_...
-
Discrete Jobs End to End Cycle with Cost Roll-up in Standard Cost Organization in R12.2 STEP 1: CREATE ITEMS Responsibility: ...