Infolinks

Thursday, 21 June 2012

Script to Create an Organization in Oracle Apps

Script  to Create an Organization in Oracle Apps
 
Following script can be used to create an Organization in Oracle Apps. Its using the API below:
  • p_organization_rec hz_party_v2pub.organization_rec_type;
Create Organization
DECLARE
p_organization_rec hz_party_v2pub.organization_rec_type;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
x_party_id NUMBER;
x_party_number VARCHAR2 (2000);
x_profile_id NUMBER;
BEGIN
p_organization_rec.organization_name := 'abc';
p_organization_rec.created_by_module := 'abc_demo';
hz_party_v2pub.create_organization ('T',
p_organization_rec,
x_return_status,
x_msg_count,
x_msg_data,
x_party_id,
x_party_number,
x_profile_id
);
DBMS_OUTPUT.put_line ('party id ' || x_party_id);
DBMS_OUTPUT.put_line (SUBSTR ('x_return_status = ' || x_return_status,
1,
255
)
);
DBMS_OUTPUT.put_line ('x_msg_count = ' || TO_CHAR (x_msg_count));
DBMS_OUTPUT.put_line (SUBSTR ('x_msg_data = ' || x_msg_data, 1, 255));
IF x_msg_count > 1
THEN
FOR i IN 1 .. x_msg_count
LOOP
DBMS_OUTPUT.put_line
( i
|| '. '
|| SUBSTR
(fnd_msg_pub.get (p_encoded => fnd_api.g_false),
1,
255
)
);
END LOOP;
END IF;
END;

The above API will create records in hz_parties table in apps schema.
 
==============
 
Following SQL query can be used to get the recent Oracle EBS users and their email addresses.

SELECT DISTINCT ppf.full_name
, fu.user_name
, NVL(ppf.email_address,fu.email_address) email_address
FROM per_people_f ppf
, fnd_user fu
, fnd_logins fl
WHERE fl.start_time > SYSDATE - 2
AND fu.user_id = fl.user_id
AND ppf.person_id(+) = fu.employee_id
AND fu.user_name NOT IN ('SYSADMIN', 'GUEST');
 
==============
 
Use the following query to find the scheduled or on hold concurrent request:

select request_id 
from fnd_concurrent_requests 
where status_code in ('Q','I') 
and requested_start_date > SYSDATE 
and hold_flag = 'N';
 
 
===================
 
 

No comments:

Post a Comment