How to Create Code Combination ID by API

I was on an integration assignment between Home Grown Project System and Oracle Payable. A big gap which I faced there was how to maintain single source of Account Code Combinations. We had following options to manage this issue.
Built a View of GL_CODE_COMBINATIONS table and pass Combination and ID from Oracle to Custom System
Use API and create Code Combination
I used second way to handle this. Here is script which i used in that Assignment ( it works for me but you need to be careful as it’s not documented any where 🙂
—–Create Function
CREATE OR REPLACE FUNCTION APPS.XXX_CREATE_CCID
( P_CONCAT_SEGS IN VARCHAR2
) RETURN VARCHAR2
IS
L_STATUS BOOLEAN;
L_COA_ID NUMBER;
BEGIN
SELECT CHART_OF_ACCOUNTS_ID
INTO L_COA_ID
FROM GL_SETS_OF_BOOKS
WHERE SET_OF_BOOKS_ID = 2021; –UPDATE THIS WITH SET OF BOOKS ID

L_STATUS := FND_FLEX_KEYVAL.VALIDATE_SEGS(
‘CREATE_COMBINATION’,
‘SQLGL’,
‘GL#’,
L_COA_ID,
P_CONCAT_SEGS,
‘V’,
SYSDATE,
‘ALL’, NULL, NULL, NULL, NULL,
FALSE,FALSE, NULL, NULL, NULL);
IF L_STATUS THEN
RETURN ‘S’;
ELSE
RETURN ‘F’;
END IF;
END ;
/

—–EXECUTE FUNCTION
DECLARE
RETVAL VARCHAR2(200);
P_CONCAT_SEGS VARCHAR2(200); /* ‘10.2001.2211101.987872.001.0000’ THIS COMBINATION I WANT TO CREATE */
BEGIN
RETVAL := APPS.XXX_CREATE_CCID ( P_CONCAT_SEGS );
COMMIT;
END;

No approver found for Purchase Requisition XX

I was working on one client site for AME setup with Purchase Requisition. I finished setup for AME transaction Type “Purchase Requisition Approval”. When requester was submitting requisition system initially shows that it’s in process but after one minute requester was getting notification “No approver found for Purchase Requisition”.
I checked from AME Test Workbench functionality by using transaction ID system was generating approval list as per setup. In other words everything was setup properly but still after submission user was getting error while submitting from Core Purchasing Form.

If user was completing this purchase requisition by using iProcurement Checkout functionality request was going for approval to supervisor as per setup.

After 2 days of working, found out one silly problem .guess what????????

Download Solution

How to Create Company Cost Center By Using API

To implement Oracle Daily Business Intelligence it’s required to implement Company Cost Center at Organization definition level. Oracle Provided a API for this, in this document I will share the sample script to update company cost center by executing this script.

Link To Download File

How to Create Position Hierarchy by Using APIs

How to Create Position Hierarchy by Using APIs

Define Valid Grades for Position in Oracle HRMS

Define Valid Grades for Positions
Oracle HRMS lets you define Valid Grades for Positions. These definitions will be used to provide warning messages in the Assignment window when you enter Position and Grade information.
Navigate to Position Definitation Form
Query the position and click on the Valid Grades button
Enter and save the valid grades for each position. You can enter a single grade, or a set of grades.

Define Valid Grades for Positions By Using API
/* Formatted on 2010/01/17 08:29 (Formatter Plus v4.8.8) */
create table grade_raw_data(slno number,
position_name varchar2(1000),
grade varchar2(1000))

Upload Data into grade_raw_data table either by using SQLLDR or Some other tool

ALTER TABLE APPS_APPLMGR.GRADE_RAW_DATA
ADD (Status VARCHAR2(3 BYTE),
error_message varchar2(1000)
);

/* Formatted on 2010/01/17 08:40 (Formatter Plus v4.8.8) */
CREATE OR REPLACE PROCEDURE xx_position_valid_grade
IS
CURSOR cur
IS
SELECT g.slno, g.position_name, g.grade, g.status, g.error_message
FROM grade_raw_data g
WHERE status = ‘E’ or Status is Null;

x_rowid VARCHAR2 (200);
x_valid_grade_id NUMBER;
x_business_group_id NUMBER;
x_grade_id NUMBER;
x_date_from DATE;
x_comments VARCHAR2 (200);
x_date_to DATE;
x_job_id NUMBER;
x_position_id NUMBER;
x_attribute_category VARCHAR2 (200);
x_attribute1 VARCHAR2 (200);
v_msg VARCHAR2 (1000) := NULL;
x_attribute2 VARCHAR2 (200);
x_attribute3 VARCHAR2 (200);
x_attribute4 VARCHAR2 (200);
x_attribute5 VARCHAR2 (200);
x_attribute6 VARCHAR2 (200);
x_attribute7 VARCHAR2 (200);
x_attribute8 VARCHAR2 (200);
x_attribute9 VARCHAR2 (200);
x_attribute10 VARCHAR2 (200);
x_attribute11 VARCHAR2 (200);
x_attribute12 VARCHAR2 (200);
x_attribute13 VARCHAR2 (200);
x_attribute14 VARCHAR2 (200);
x_attribute15 VARCHAR2 (200);
x_attribute16 VARCHAR2 (200);
x_attribute17 VARCHAR2 (200);
x_attribute18 VARCHAR2 (200);
x_attribute19 VARCHAR2 (200);
x_attribute20 VARCHAR2 (200);
x_end_of_time DATE;
x_pst1_date_end DATE;
x_pst1_date_effective DATE := TO_DATE (’03-01-2010′, ‘DD-MM-YYYY’);
BEGIN
FOR pos IN cur
LOOP
BEGIN
x_rowid := NULL;
x_valid_grade_id := dbms_random.random;
x_business_group_id := 0;

SELECT grade_id
INTO x_grade_id
FROM per_grades
WHERE UPPER (NAME) = UPPER (pos.grade);

x_date_from := ’03-jan-2010′;

SELECT position_id
INTO x_position_id
FROM hr_all_positions_f
WHERE UPPER (NAME) = UPPER (pos.position_name);
per_valid_grades_pkg2.insert_row (x_rowid,
x_valid_grade_id,
x_business_group_id,
x_grade_id,
x_date_from,
x_comments,
x_date_to,
x_job_id,
x_position_id,
x_attribute_category,
x_attribute1,
x_attribute2,
x_attribute3,
x_attribute4,
x_attribute5,
x_attribute6,
x_attribute7,
x_attribute8,
x_attribute9,
x_attribute10,
x_attribute11,
x_attribute12,
x_attribute13,
x_attribute14,
x_attribute15,
x_attribute16,
x_attribute17,
x_attribute18,
x_attribute19,
x_attribute20,
x_end_of_time,
x_pst1_date_end,
x_pst1_date_effective
);

UPDATE grade_raw_data p
SET p.status = ‘I’
WHERE slno = pos.slno;
x_valid_grade_id := NULL;
X_GRADE_ID := null;
x_position_id := null;
EXCEPTION
WHEN OTHERS
THEN
v_msg := SQLERRM;
UPDATE grade_raw_data p
SET p.status = ‘E’,
p.error_message = v_msg
WHERE slno = pos.slno;
COMMIT;
END;
END LOOP;
END;
/

Next Post will be about Position Hierarchy Upload by Using API .

Upload Lookup Values by Using Script

Upload Lookup Values By Using Script

Extract Employee and Supervisor Based on Position Hierarchy

This SQL will give you employee and Supervisor as per position hierarchy .

/* Formatted on 2009/10/19 15:01 (Formatter Plus v4.8.8) */
SELECT LPAD (‘ ‘, 5 * LEVEL) || has.NAME hierarchy, LEVEL,
hap.NAME parent_name, pse.parent_position_id, has.NAME child_name,
pse.subordinate_position_id
FROM (SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV (‘LANG’)) hap,
(SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV (‘LANG’)) has,
per_pos_structure_elements pse
WHERE pse.business_group_id = 81
AND hap.position_id = pse.parent_position_id
AND has.position_id = pse.subordinate_position_id
start with pse.parent_position_id = –40979 Base Position Id (like CEO etc)
CONNECT BY PRIOR pse.subordinate_position_id = pse.parent_position_id
AND PRIOR pse.pos_structure_version_id = pse.pos_structure_version_id
AND PRIOR pse.business_group_id = pse.business_group_id
ORDER BY 4

How to Get Approval Group assigned to specific Job and Position in Oracle Purchasing

How to Get Approval Group assigned to specific Job and Position in Oracle Purchasing

Remittance Advice by Email to Supplier by Using UTL_SMTP

Click on Link to Read Article

How can one recover ? If one the apps password changed through FNDCPASS when application and database is running

Nice Article Written and Shared by Fouad Hasan Bandarkar

How to Turn On “About This Page” in Oracle R12 Web Forms

Set Following Profile Options as Required at User or Site

Personalize Self-Service Defn = YES

FND: Personalization Region Link Enabled = YES

Disable Self-Service Personal = NO (Only at Site)

FND: Diagnostics = Yes

Bounce the Apache Server

Login to Application you can see the About This Page Link on all web pages

By Using About This Page link you can have almost all information of technology Stack

How to Get Supplier Bank Detail In R12

In Release 12, Payables Supplier Bank Information is stored somewhere else instead of PO_VENDORS table as in 11i. After going thru the guides, it seems that the bank information (such as bank account numbers, etc) for suppliers may be in TCA or in Cash Management Bank Model. Please provide the tables names where bank account information and other bank related information is stored?

By Using Following Queries you can get Required Information on Basis on Supplier Site Name

/* For Supplier Bank Account Number Use This One */

SELECT bank_account_name, bank_account_num, branch_id

FROM iby_ext_bank_accounts

WHERE ext_bank_account_id IN (

SELECT ext_bank_account_id

FROM iby_account_owners

WHERE account_owner_party_id IN (

SELECT party_id

FROM hz_party_sites

WHERE party_site_name LIKE

‘%UPC%’))

/* USE THIS QUERY TO GET BANK NAME AND BANK BRANCH NAME OF SUPPLIER BANK*/

SELECT BANKORGPROFILE.HOME_COUNTRY BANK_HOME_COUNTRY,

BANKORGPROFILE.PARTY_ID BANK_PARTY_ID,

BANKORGPROFILE.ORGANIZATION_NAME BANK_NAME,

BANKORGPROFILE.BANK_OR_BRANCH_NUMBER BANK_NUMBER,

BRANCHPARTY.PARTY_ID BRANCH_PARTY_ID,

BRANCHPARTY.PARTY_NAME BANK_BRANCH_NAME,

BRANCHPARTY.PARTY_ID

FROM HZ_ORGANIZATION_PROFILES BANKORGPROFILE,

HZ_CODE_ASSIGNMENTS BANKCA,

HZ_PARTIES BRANCHPARTY,

HZ_ORGANIZATION_PROFILES BRANCHORGPROFILE,

HZ_CODE_ASSIGNMENTS BRANCHCA,

HZ_RELATIONSHIPS BRREL,

HZ_CODE_ASSIGNMENTS BRANCHTYPECA,

HZ_CONTACT_POINTS BRANCHCP,

HZ_CONTACT_POINTS EDICP

WHERE SYSDATE BETWEEN TRUNC (BANKORGPROFILE.EFFECTIVE_START_DATE)

AND NVL (TRUNC (BANKORGPROFILE.EFFECTIVE_END_DATE),

SYSDATE + 1

)

AND BANKCA.CLASS_CATEGORY = ‘BANK_INSTITUTION_TYPE’

AND BANKCA.CLASS_CODE IN (‘BANK’, ‘CLEARINGHOUSE’)

AND BANKCA.OWNER_TABLE_NAME = ‘HZ_PARTIES’

AND (BANKCA.STATUS = ‘A’ OR BANKCA.STATUS IS NULL)

AND BANKCA.OWNER_TABLE_ID = BANKORGPROFILE.PARTY_ID

AND BRANCHPARTY.PARTY_TYPE = ‘ORGANIZATION’

AND BRANCHPARTY.STATUS = ‘A’

AND BRANCHORGPROFILE.PARTY_ID = BRANCHPARTY.PARTY_ID

AND SYSDATE BETWEEN TRUNC (BRANCHORGPROFILE.EFFECTIVE_START_DATE)

AND NVL (TRUNC (BRANCHORGPROFILE.EFFECTIVE_END_DATE),

SYSDATE + 1

)

AND BRANCHCA.CLASS_CATEGORY = ‘BANK_INSTITUTION_TYPE’

AND BRANCHCA.CLASS_CODE IN (‘BANK_BRANCH’, ‘CLEARINGHOUSE_BRANCH’)

AND BRANCHCA.OWNER_TABLE_NAME = ‘HZ_PARTIES’

AND (BRANCHCA.STATUS = ‘A’ OR BRANCHCA.STATUS IS NULL)

AND BRANCHCA.OWNER_TABLE_ID = BRANCHPARTY.PARTY_ID

AND BANKORGPROFILE.PARTY_ID = BRREL.OBJECT_ID

AND BRREL.RELATIONSHIP_TYPE = ‘BANK_AND_BRANCH’

AND BRREL.RELATIONSHIP_CODE = ‘BRANCH_OF’

AND BRREL.STATUS = ‘A’

AND BRREL.SUBJECT_TABLE_NAME = ‘HZ_PARTIES’

AND BRREL.SUBJECT_TYPE = ‘ORGANIZATION’

AND BRREL.OBJECT_TABLE_NAME = ‘HZ_PARTIES’

AND BRREL.OBJECT_TYPE = ‘ORGANIZATION’

AND BRREL.SUBJECT_ID = BRANCHPARTY.PARTY_ID

AND BRANCHTYPECA.CLASS_CATEGORY(+) = ‘BANK_BRANCH_TYPE’

AND BRANCHTYPECA.PRIMARY_FLAG(+) = ‘Y’

AND BRANCHTYPECA.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’

AND BRANCHTYPECA.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID

AND BRANCHTYPECA.STATUS(+) = ‘A’

AND BRANCHCP.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’

AND BRANCHCP.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID

AND BRANCHCP.CONTACT_POINT_TYPE(+) = ‘EFT’

AND BRANCHCP.STATUS(+) = ‘A’

AND EDICP.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’

AND EDICP.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID

AND EDICP.CONTACT_POINT_TYPE(+) = ‘EDI’

AND EDICP.STATUS(+) = ‘A’

AND BRANCHCA.OWNER_TABLE_ID = :IBY_BRANCH_ID /*USER BRANCH ID FROM ABOVE QUERY*/

If anyone have a better solution then please update

Join Processing in Oracle

In a query involving more than one table, join processing is involved to determine the most optimal plan to perform the join. This comprises:

  1. Join cardinality
  2. Enumerating join orders
  3. Evaluating the costs associated with each join path under each join method.

Join Cardinality

Join cardinality is the determination of the number of rows that will make up the joined relation. In the worst case, we have no join predicates and the cardinality is the Cartesian product of the two or more tables involved. But typically when two or more tables participate in a join, the join is based on values of some columns. Using the statistical descriptions on the columns and the number of rows in each table, we calculate the cardinality of the joined form.

Join Orders

A “Join Order” is a particular permutation of ordering the access to tables participating in the join to complete the joined relation. Join orders depend on the type of join or the join topology. Depending on the structuring of the join predicates, joins can be classified into various types viz chain, star, cycle, complete graph, etc. For example, consider the query with a three table join –

SELECT … FROM t1,t2,t3 WHERE

t1.col1 = t2.col1 AND

t2.col1 = t3.col1 ;

Tables t1, t2 and t3 are joined in a chain order.

Tables t1,t2,t3 can be joined in n! i.e n factorial way .

where n is number of tables .

So in This case it will be 3*2*1=6

Possible join orders:

t1->t2->t3, t2->t1->t3, t2->t3->t1, t3->t2->t1

t1->t3->t2, t3->t1->t2

Note the Join orders such as t1->t3->t2, t3->t1->t2 are evaluated using

Cartesian product as there is no join predicate specified between t1 and t3.

Each of the join orders are possible and need to be evaluated for resource usage. As number of tables increase, depending on the join topology, the search space or the possible permutations go up steeply. Several techniques are used to prune the search space and reduce the work involved in identifying the best join order.

Evaluating Join Path Costs

For each join order, the optimizer evaluates the cost of performing the join by breaking the order into pairs. The first part is made of the relations already joined and the second part of the next table to be joined. Costs are considered using both join methods currently implemented in the kernel, the sort-merge join method and the nested-loops join method.

In the sort-merge method, the tables participating in the join are first sorted by the join columns. The sorted relations are then joined. The cost of performing join by this method includes the sorting costs and the cost of retrieving sorted records to perform the join.

In the nested-loops method, we scan the outer table row one at a time and for each row retrieved, we access the inner table based on the join columns. The outer table will actually be a joined relation where more than two tables are joined. The cost of performing the join in this method includes the cost of accessing the outer table and for each row retrieved and the cost of fetching the group of rows from the inner table based on the join columns.

For each table in a particular join order, there is a large number of possible access paths, the table can be accessed using a ROWID or could be accessed by doing a table scan. Alternatively, it may be accessed using a single index or a cluster scan or a merge of several single column no unique indexes.

Several rules are used to narrow down or prune the search space to speed up access path selection. For example, if there is a lookup by ROWID, it is considered the best and we don’t bother to evaluate other access paths open to the table.

Source := US Education Website

How can I unreserved quantity, Reserved against a closed / canceled sale order

Problem

In one of my operating unit sale officer enter order and released to ware house, after that sale officer cancel that sale order. Now it showing me quantity reserved for that sale order in system but actually order is canceled how can I unreserved this quantity

Solution

For 11i – 11.5.7 / INV.G and above
——————————————-

Download and review Patch.3170660 “script i2471362.sql not correcting orders for cancelled qty”

Run i2471362.sql to remove any old reservations

To delete a reservation manually

NAVIGATE to INV/On hand Availability/ Reservations Query up the item and find the associated row for the order Place cursor on the row to be deleted and click on delete icon and save icon.

Reference

Metalink Note Id 150081.1

Price List Bulk Loader Example Scripts

Please apply Patch#4900462 and find the following example scripts under QP_TOP/patch/11.5/sql directory.

QPBLKEX1.sql – Script populates interface tables to insert price list header and price list line.

QPBLKEX2.sql – Script populates interface tables to insert price list header and price list line and pricing attributes.

QPBLKEX3.sql – Script populates interface tables to insert price list header and price break line.

QPBLKEX4.sql – Script populates interface tables to update price list header with qualifiers.

QPBLKEX5.sql – Script populates interface tables to attach secondary price lists to the primary price list.

Serial number is not available when doing a inventory transaction but shows in on hand quantity

serial-number-is-not-available-when-doing-a-inventory-transaction-but-shows-in-on-hand-quantity

Script to Clear Orders Stuck in Workflow @ Releasing

If you have some order lines in booked status and the ship line activity is in error instead of ‘Notified’ then use the following script (But check on Test Environment first). Pass the line_id for one of the line from problematic order and check if this will progress the line to ‘Awaiting Shipping’ and the work flow activity to Notified status.

set serveroutput on
Declare

l_line_id NUMBER := &line_id; /* Order Line Id*/
l_org_id NUMBER; /* Organization Id*/
l_count NUMBER;
l_activity_id NUMBER;
l_result VARCHAR2(30);

Begin

OE_Standard_WF.OEOL_SELECTOR
(p_itemtype => ‘OEOL’
,p_itemkey => to_char(l_line_id) /* Order Line Id*/
,p_actid => 12345
,p_funcmode => ‘SET_CTX’
,p_result => l_result
);

select activity_id
into l_activity_id
from wf_item_activity_statuses_v
where item_type = ‘OEOL’
and activity_name = ‘SHIP_LINE’
and item_key = to_char(l_line_id)
and activity_status_code = ‘ERROR’;

wf_item_activity_status.create_status(‘OEOL’,to_char(l_line_id),l_activity_id,wf_engine.eng_notified,wf_engine.eng_null,SYSDATE,null);
commit;
End;
/

What Notification Types are available in Oracle Service

The following Notifications are available:”You can set up the application to automatically notify the service request owner and customer contacts associated with the service request whenever a certain event occurs, for example, whenever a service request is created, closed, or reassigned. Notifications can be sent via Oracle Workflow notifications or by e-mail.

Oracle TeleService includes a notification workflow and notification templates suitable for different types of events, but implementers must set up the rules that trigger the workflow. The rules make it possible to selectively notify users only about events of interest to the organization. This notification functionality enhances and replaces notifications through the Call Support Process workflow which can be associated with Service Request Types. The Call Support Process notifies users each and every time a service request is updated. This release includes one seeded notification rule: If service request status changes to closed, then notify the primary contacts of related service requests.

The following table describes the events that can trigger a notification message to be sent and the scope of the rule you can create.

1. Contact Added to Service Request

2. Published Solution Added to Service Request

3. Service Request Status Changed

4. Service Request Created

5. Service Request Owner Changed

6. Relationship Created

7. Relationship Removed

8. Service Request Updated

The Notifications that are available in Oracle Service can be set up via the Customer Support -> Setup -> Service Requests -> Notification Rules form.

Reference

Metalink

Oracle® TeleService Implementation Guide

How to Delete Stock Locators by Using API

How to Create Stock Locators By using API

How to Create Stock Locator by using API