Friday 19 September 2014

API for Supplier/ Vendor Site creation in R12

DECLARE
l_vendor_site_rec AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
l_return_status
VARCHAR2(30);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER;

BEGIN
----Required field for API for ap_vendor_pub_pkg.create_vendor_site

l_vendor_site_rec.vendor_id := 51171;
l_vendor_site_rec.vendor_site_code := 'DEMO_SITE';
l_vendor_site_rec.address_line1 := '3RD STREET LA';
l_vendor_site_rec.city := 'New York';
l_vendor_site_rec.country := 'US';
l_vendor_site_rec.org_id := 204;

----Optional field

l_vendor_site_rec.purchasing_site_flag := 'N';
l_vendor_site_rec.pay_site_flag := 'N';
l_vendor_site_rec.rfq_only_site_flag := 'N';

--

pos_vendor_pub_pkg.create_vendor_site
(--input parameter
p_vendor_site_rec => l_vendor_site_rec,
--output parameter
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id);


--commit;
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_site_id: ' || l_vendor_site_id);
dbms_output.put_line('party_site_id: ' || l_party_site_id);
dbms_output.put_line('location_id: ' || l_location_id);

exception
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
--------------------------------------------------------------------------------------------------------------------------------

output
-------------------------------------------------------------------------------------------------------------------------------

return_status: S
msg_data:
vendor_site_id:
21911

party_site_id: 246632
location_id: 27339
---------------------------------------------------------------------------------------------------------------------------------

You will get data in base table using below query.

select * from ap_supplier_sites_all
where vendor_site_id=21911
---------------------------------------------------------------------------------------------
select * from hz_party_siteswhere party_site_id=246632
-------------------------------------------------------------------------------------------------
select * from hz_locationswhere location_id=27339
-----------------------------------------------------------------------------------------------

API for supplier/ vendor creation in R12

DECLARE
l_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
l_return_status
VARCHAR2(30);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;

BEGIN

----Required field for API pos_vendor_pub_pkg
l_vendor_rec.segment1 := '000777';
l_vendor_rec.vendor_name := 'DEMO_AP_SUPPLIER_API';
----Optional field for API pos_vendor_pub_pkg
l_vendor_rec.match_option := 'R';
l_vendor_rec.start_date_active := sysdate - 1;

----API call
pos_vendor_pub_pkg.Create_Vendor(--required input parametre
p_vendor_rec => l_vendor_rec,--output parameter
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id);


--COMMIT;
--output statement
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_id: ' || l_vendor_id);
dbms_output.put_line('party_id: ' || l_party_id);
--
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
---------------------------------------------------------------------------------------------------------------------

Output
-----------------------------------------------------------------------------------------------------------------------
return_status: S
msg_data:
vendor_id: 51171
party_id: 447681

--------------------------------------------------------------------------------------------------------------------------




Supplier Hub API Sample Scripts for Integrating Third Party Applications


The following sample scripts illustrate APIs for integrating third party applications
with Oracle Supplier Hub:
• Create Supplier
• Create Supplier Site
• Create Supplier Contact
• Update Supplier
• Update Supplier Site
• Validate Supplier
• Create User-defined Attribute
• Query User-defined Attribute
• Get Supplier Publication History
• Create Supplier Publication Event Response
Create Supplier

 
DECLARE
l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;
BEGIN
--
-- Required
--
l_vendor_rec.segment1 := '12345001'; -- Supplier Number
l_vendor_rec.vendor_name := 'Demo001';
--
-- Optional
--
l_vendor_rec.vendor_name_alt := 'DEMO001';
l_vendor_rec.start_date_active := sysdate - 1;
-- etc.. --
pos_vendor_pub_pkg.create_vendor(
p_vendor_rec => l_vendor_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('vendor_id: '||l_vendor_id);
dbms_output.put_line('party_id: '||l_party_id);
END;




-----------------------------------------------------------------------------------------
Create Supplier Site

 
DECLARE
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER;
BEGIN
--
-- Required
--
SELECT vendor_id
INTO l_vendor_site_rec.vendor_id
FROM pos_po_vendors_v
WHERE vendor_name = 'Demo001';
l_vendor_site_rec.vendor_site_code := 'Site001';
l_vendor_site_rec.address_line1 := '300 Oracle Parkway';
l_vendor_site_rec.city := 'Redwood City';
l_vendor_site_rec.state := 'CA';
l_vendor_site_rec.country := 'US';
l_vendor_site_rec.org_id := '204';
--
-- Optional
--
l_vendor_site_rec.phone := '6505066486';
-- etc... --
pos_vendor_pub_pkg.create_vendor_site(
p_vendor_site_rec => l_vendor_site_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('vendor_site_id: '||l_vendor_site_id);
dbms_output.put_line('party_site_id: '||l_party_site_id);
dbms_output.put_line('location_id: '||l_location_id);
END;
/

-----------------------------------------------------------------------------------------------
Create Supplier Contact

 
DECLARE
l_vendor_contact_rec ap_vendor_pub_pkg.r_vendor_contact_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_contact_id NUMBER;
l_per_party_id NUMBER;
l_rel_party_id NUMBER;
l_rel_id NUMBER;
l_org_contact_id NUMBER;
l_party_site_id NUMBER;
BEGIN
--
-- Required
--
SELECT vendor_id
INTO l_vendor_contact_rec.vendor_id
FROM pos_po_vendors_v
WHERE vendor_name = 'Demo001';
l_vendor_contact_rec.org_id := '204';
l_vendor_contact_rec.person_first_name := 'B';
l_vendor_contact_rec.person_last_name := 'Smith';
--
-- Optional
--
l_vendor_contact_rec.phone := '6505066486';
l_vendor_contact_rec.email_address := 'bso@us.oracle.com';
-- etc... --
pos_vendor_pub_pkg.create_vendor_contact(
p_vendor_contact_rec => l_vendor_contact_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_contact_id => l_vendor_contact_id,
x_per_party_id => l_per_party_id,
x_rel_party_id => l_rel_party_id,
x_rel_id => l_rel_id,
x_org_contact_id => l_org_contact_id,
x_party_site_id => l_party_site_id);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('vendor_contact_id: '||l_vendor_contact_id);
dbms_output.put_line('party_site_id: '||l_party_site_id);
dbms_output.put_line('per_party_id: '||l_per_party_id);
dbms_output.put_line('rel_party_id: '||l_rel_party_id);
dbms_output.put_line('rel_id: '||l_rel_id);
dbms_output.put_line('org_contact_id: '||l_org_contact_id);
END;
/

----------------------------------------------------------------------------------------------------
Update Supplier

 
DECLARE
l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;
BEGIN
--
-- Required
--
SELECT vendor_id
INTO l_vendor_rec.vendor_id
FROM pos_po_vendors_v
WHERE vendor_name = 'Demo001';
-- _______________________________________________________
-- | |
-- | NOTE: Name and Alt Name Cannot Be Updated By This API |
-- |_______________________________________________________|
--
--
-- Optional
--
l_vendor_rec.customer_num := '101';
-- etc.. --
pos_vendor_pub_pkg.update_vendor(
p_vendor_rec => l_vendor_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
END;
/

--------------------------------------------------------------------------------------------
Update Supplier Site

 
DECLARE
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
BEGIN
--
-- Required
--
SELECT vendor_id
INTO l_vendor_site_rec.vendor_id
FROM pos_po_vendors_v
WHERE vendor_name = 'Office Supplies, Inc.';
SELECT vendor_site_id
INTO l_vendor_site_rec.vendor_site_id
FROM ap_supplier_sites
WHERE vendor_id = l_vendor_site_rec.vendor_id AND
vendor_site_code = 'NEW YORK';
-- l_vendor_site_rec.org_id := '204';
l_vendor_site_rec.address_line1 := '3605 Center Road Changed';
l_vendor_site_rec.address_line2 := 'Line Two Changed';
l_vendor_site_rec.address_line3 := 'Line Three Changed';
l_vendor_site_rec.address_line4 := 'Line Four Changed';
l_vendor_site_rec.zip := '12345';
-- etc... --
pos_vendor_pub_pkg.update_vendor_site(
p_vendor_site_rec => l_vendor_site_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
END;
/

-------------------------------------------------------------------------------------------------------
Validate Supplier

 
DECLARE
l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
l_mode VARCHAR2(1);
l_party_valid VARCHAR2(1);
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
BEGIN
l_mode := 'U';
SELECT vendor_id
INTO l_vendor_rec.vendor_id
FROM pos_po_vendors_v
WHERE vendor_name = 'Demo001';
-- l_vendor_rec.segment1 := '12345001'; -- Supplier Number
-- l_vendor_rec.vendor_name := 'Demo001';
-- l_vendor_rec.vendor_name_alt := 'DEMO001';
-- etc... --
pos_vendor_pub_pkg.validate_vendor(
p_vendor_rec => l_vendor_rec,
p_mode => l_mode,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_party_valid => l_party_valid);
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('party_valid: '||l_party_valid);
END;
/

---------------------------------------------------------------------------------------------------
Create User-defined Attribute

 
DECLARE
l_party_id NUMBER;
l_attr_group_id NUMBER;
l_previous NUMBER := 0;
l_pk_column_values EGO_COL_NAME_VALUE_PAIR_ARRAY;
l_request_table EGO_ATTR_GROUP_REQUEST_TABLE :=
EGO_ATTR_GROUP_REQUEST_TABLE();
l_attributes_row_table EGO_USER_ATTR_ROW_TABLE;
l_attributes_data_table EGO_USER_ATTR_DATA_TABLE;
l_return_status VARCHAR2(100);
l_errorcode NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2(4000);
BEGIN
SELECT party_id
INTO l_party_id
FROM ap_suppliers
WHERE vendor_name = 'Office Supplies, Inc.';
SELECT attr_group_id
INTO l_attr_group_id
FROM ego_attr_groups_v
WHERE attr_group_disp_name = 'Business Information';
-- Primary key value pairs
l_pk_column_values :=
EGO_COL_NAME_VALUE_PAIR_ARRAY(
EGO_COL_NAME_VALUE_PAIR_OBJ('PARTY_ID', l_party_id)
);
-- Attribute group object
l_request_table.extend;
l_request_table(l_request_table.LAST) := EGO_ATTR_GROUP_REQUEST_OBJ(
l_attr_group_id --ATTR_GROUP_ID
,NULL -- application id
,NULL -- group type
,NULL -- group name
,'SUPP_LEVEL' -- data level
,'''N''' -- DATA_LEVEL_1
,NULL -- DATA_LEVEL_2
,NULL -- DATA_LEVEL_3
,NULL -- DATA_LEVEL_4
,NULL -- DATA_LEVEL_5
,NULL -- ATTR_NAME_LIST
);
-- Get the user attribute data
POS_VENDOR_PUB_PKG.Get_User_Attrs_Data (
p_api_version => 1.0
,p_pk_column_name_value_pairs => l_pk_column_values
,p_attr_group_request_table => l_request_table
,x_attributes_row_table => l_attributes_row_table
,x_attributes_data_table => l_attributes_data_table
,x_return_status => l_return_status
,x_errorcode => l_errorcode
,x_msg_count => l_msg_count
Sample Scripts for Integrating Third Party Applications
C-11


,x_msg_data => l_msg_data);
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_count: ' || l_msg_count);
dbms_output.put_line('msg_data: ' || l_msg_data);
IF l_attributes_row_table IS NOT NULL THEN
dbms_output.put_line('row_table count: ' ||
l_attributes_row_table.COUNT);
END IF;
IF l_attributes_data_table IS NOT NULL THEN
dbms_output.put_line('data_table count: ' ||
l_attributes_data_table.COUNT);
FOR i IN 1 .. l_attributes_data_table.COUNT LOOP
IF l_attributes_data_table(i).row_identifier <> l_previous
THEN
--
-- Add a line to separate each UDA row.
--
dbms_output.put_line('-----------------------------');
l_previous := l_attributes_data_table(i).row_identifier;
END IF;
dbms_output.put_line(
'Row ' || l_attributes_data_table(i).row_identifier ||
' Attr: '||l_attributes_data_table(i).attr_name ||
' Value String:
'||l_attributes_data_table(i).attr_value_str ||
' Value Number:
'||l_attributes_data_table(i).attr_value_num);
dbms_output.new_line;
END LOOP;
END IF;
END;
/

Sunday 31 August 2014

API TO LOAD VALUES IN TO VALUE SETS

CREATE OR REPLACE PROCEDURE xxcust_load_flex_values
IS
v_start_date_active date := sysdate;
v_error_msg varchar2(1000) := null;
v_who_type fnd_flex_loader_apis.who_type;
v_request_id number;
v_rec_success number;
v_rec_error number;
v_rec_cnt number := 0;
v_user_id number := fnd_global.user_id;
v_login_id number := fnd_global.login_id;
v_req_id number := fnd_global.conc_request_id;
-----------
BEGIN
--
dbms_output.put_line('in begin');
v_who_type.created_by := v_user_id;
v_who_type.creation_date :=sysdate;
v_who_type.last_updated_by := v_user_id;
v_who_type.last_update_date := sysdate;
v_who_type.last_update_login := v_login_id;
--
dbms_output.put_line('after begin');
--
--api to load values
fnd_flex_values_pkg.load_row(
x_flex_value_set_name => 'xx_test_api',
x_parent_flex_value_low => null,
x_flex_value => 'test456',
x_who => v_who_type,
x_enabled_flag => 'y',
x_summary_flag => 'n',
x_start_date_active => v_start_date_active,
x_end_date_active => null,
x_parent_flex_value_high => null,
x_structured_hierarchy_level => null,
x_hierarchy_level =>null,
x_compiled_value_attributes => null,
x_value_category => null,
x_attribute1 => null,
x_attribute2 => null,
x_attribute3 => null,
x_attribute4 => null,
x_attribute5 => null,
x_attribute6 => null,
x_attribute7 => null,
x_attribute8 => null,
x_attribute9 => null,
x_attribute10 => null,
x_attribute11 => null,
x_attribute12 => null,
x_attribute13 => null,
x_attribute14 => null,
x_attribute15 => null,
x_attribute16 => null,
x_attribute17 => null,
x_attribute18 => null,
x_attribute19 => null,
x_attribute20 => null,
x_attribute21 => null,
x_attribute22 => null,
x_attribute23 => null,
x_attribute24 => null,
x_attribute25 => null,
x_attribute26 => null,
x_attribute27 => null,
x_attribute28 => null,
x_attribute29 => null,
x_attribute30 => null,
x_attribute31 => null,
x_attribute32 => null,
x_attribute33 => null,
x_attribute34 => null,
x_attribute35 => null,
x_attribute36 => null,
x_attribute37 => null,
x_attribute38 => null,
x_attribute39 => null,
x_attribute40 => null,
x_attribute41 => null,
x_attribute42 => null,
x_attribute43 => null,
x_attribute44 => null,
x_attribute45 => null,
x_attribute46 => null,
x_attribute47 => null,
x_attribute48 => null,
x_attribute49 => null,
x_attribute50 => null,
x_attribute_sort_order => null,
x_flex_value_meaning => 'test456',
x_description => 'test456');
--
COMMIT;
--
dbms_output.put_line('after commit');
--
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('error is ' || substr(sqlerrm, 1, 1000));
END;

=====================================================================

Monday 25 August 2014

Creating XML Data Using DBMS_XMLDOM

-------Script for generating XML data using DBMS_XMLDOM
DECLARE

l_xmltype XMLTYPE;
l_domdoc dbms_xmldom.DOMDocument;
l_root_node dbms_xmldom.DOMNode;
--
l_department_element dbms_xmldom.DOMElement;
l_departments_node dbms_xmldom.DOMNode;
l_dept_element dbms_xmldom.DOMElement;
l_dept_node dbms_xmldom.DOMNode;
  --
l_name_element dbms_xmldom.DOMElement;
l_name_node dbms_xmldom.DOMNode;
l_name_text dbms_xmldom.DOMText;
l_name_textnode dbms_xmldom.DOMNode;
  --
l_empname_element dbms_xmldom.DOMElement;
l_empname_node dbms_xmldom.DOMNode;
l_empname_text dbms_xmldom.DOMText;
l_empname_textnode dbms_xmldom.DOMNode;
  --
l_empno_element dbms_xmldom.DOMElement;
l_empno_node dbms_xmldom.DOMNode;
l_empno_text dbms_xmldom.DOMText;
l_empno_textnode dbms_xmldom.DOMNode;

--
BEGIN
 
-- Create an empty XML document
l_domdoc := dbms_xmldom.newDomDocument; 
-- Create a root node
l_root_node := dbms_xmldom.makeNode(l_domdoc); 
-- Create a new node Departments and add it to the root node
l_department_element := dbms_xmldom.createElement(l_domdoc, DEPARTMENT_DETAIL' );
l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element));
--
FOR r_dept IN (SELECT a.deptno,
a.dname,
b.empno,
b.ename
FROM dept a, emp b
where a.deptno = b.deptno
and a.deptno IN (10, 20))
LOOP 
-- For each record, create a new Dept element with the Department ID as attribute.
-- and add this new Dept element to the Departments node
l_dept_element := dbms_xmldom.createElement(l_domdoc, 'DEPARTMENT' );
dbms_xmldom.setAttribute(l_dept_element,'DEPARTMENT_ID', r_dept.deptno);
l_dept_node := dbms_xmldom.appendChild(l_departments_node,
dbms_xmldom.makeNode(l_dept_element));
--
  -- Each Dept node will get a Name node which contains the department name as text
l_name_element := dbms_xmldom.createElement(l_domdoc, 'DEPARTMENT_NAME' );
l_name_node := dbms_xmldom.appendChild(l_dept_node,dbms_xmldom.makeNode(l_name_element));
l_name_text := dbms_xmldom.createTextNode(l_domdoc, r_dept.dname );
l_name_textnode := dbms_xmldom.appendChild(l_name_node,dbms_xmldom.makeNode(l_name_text));
--
-- Each Dept node will aslo get a EMPLOYEE NAME NODE
l_empname_element := dbms_xmldom.createElement(l_domdoc, 'EMPLOYEE_NAME' );
l_empname_node := dbms_xmldom.appendChild(l_dept_node,dbms_xmldom.makeNode(l_empname_element));
l_empname_text := dbms_xmldom.createTextNode(l_domdoc, r_dept.ename );
l_empname_textnode := dbms_xmldom.appendChild(l_empname_node,dbms_xmldom.makeNode(l_empname_text));
--
-- Each Dept node will aslo get a EMPLOYEE NUMBER NODE
l_empno_element := dbms_xmldom.createElement(l_domdoc, 'EMPLOYEE_NUMBER' );
l_empno_node := dbms_xmldom.appendChild(l_dept_node,dbms_xmldom.makeNode(l_empno_element));
l_empno_text := dbms_xmldom.createTextNode(l_domdoc, r_dept.empno );
l_empno_textnode := dbms_xmldom.appendChild(l_empno_node,dbms_xmldom.makeNode(l_empno_text));
END LOOP;
--
l_xmltype := dbms_xmldom.getXmlType(l_domdoc);
dbms_xmldom.freeDocument(l_domdoc);
dbms_output.put_line(l_xmltype.getClobVal);
--
END
; 
=====================Output===============================================================

<DEPARTMENT_DETAIL>

<DEPARTMENT DEPARTMENT_ID="10">
<DEPARTMENT_NAME>ACCOUNTING</DEPARTMENT_NAME>
<EMPLOYEE_NAME>KING</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7839</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="10">
<DEPARTMENT_NAME>ACCOUNTING</DEPARTMENT_NAME>
<EMPLOYEE_NAME>CLARK</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7782</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="20">
<DEPARTMENT_NAME>RESEARCH</DEPARTMENT_NAME>
<EMPLOYEE_NAME>JONES</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7566</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="20">
<DEPARTMENT_NAME>RESEARCH</DEPARTMENT_NAME>
<EMPLOYEE_NAME>SCOTT</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7788</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="20">
<DEPARTMENT_NAME>RESEARCH</DEPARTMENT_NAME>
<EMPLOYEE_NAME>FORD</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7902</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="20">
<DEPARTMENT_NAME>RESEARCH</DEPARTMENT_NAME>
<EMPLOYEE_NAME>SMITH</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7369</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="20">
<DEPARTMENT_NAME>RESEARCH</DEPARTMENT_NAME>
<EMPLOYEE_NAME>ADAMS</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7876</EMPLOYEE_NUMBER>
</DEPARTMENT>

<DEPARTMENT DEPARTMENT_ID="10">
<DEPARTMENT_NAME>ACCOUNTING</DEPARTMENT_NAME>
<EMPLOYEE_NAME>MILLER</EMPLOYEE_NAME>
<EMPLOYEE_NUMBER>7934</EMPLOYEE_NUMBER>
</DEPARTMENT>

</DEPARTMENT_DETAIL>

How to run Workflow Background Process concurrent program from Plsql

Below given script you can use to run work flow Background Process from Backend
========================================================================
DECLARE
l_set_interval BOOLEAN := FALSE;
l_init BOOLEAN;
l_ret_status VARCHAR2(30);
l_req_id NUMBER;
l_set_nls BOOLEAN;
l_set_mode BOOLEAN;
l_user_name VARCHAR2(40) := 'SMITH.K';
l_responsibility_key VARCHAR2(240) := 'SYSTEM_ADMINISTRATOR';
l_user_id NUMBER;
l_responsibility_id NUMBER;
l_application_id NUMBER;
--
BEGIN
 l_set_mode := apps.fnd_submit.set_mode (FALSE);
--
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = l_user_name;
--
SELECT application_id, responsibility_id
INTO l_application_id, l_responsibility_id
FROM fnd_responsibility_vl
WHERE responsibility_key = l_responsibility_key;
--
fnd_global.apps_initialize
(user_id => l_user_id,
resp_id=> l_responsibility_id,
resp_appl_id=> l_application_id);
--
DBMS_OUTPUT.put_line ('Initialization successful');
--
BEGIN
l_req_id := fnd_request.submit_request
(application=> 'FND',
 program=> 'FNDWFBG',
start_time=> SYSDATE,
sub_request=> FALSE,
argument1=> NULL,
argument2=> NULL,
argument3=> NULL,
 argument4=> 'Y',
 argument5=> 'Y',
argument6=> NULL );
--
DBMS_OUTPUT.put_line ('Request ID: ' || l_req_id);
--
EXCEPTION

 
WHEN OTHERS THEN
DBMS_OUTPUT.put_line ('Unknown error ' || SQLERRM);
END;
=========================================================================

HOW TO GENERATE XML DATA FROM PLSQL USING DBMS_XMLGEN

By using DBMS_XMLDOM we can generate xml output.

DECLARE
l_xmltype XMLTYPE;
l_ctx dbms_xmlgen.ctxhandle;
BEGIN
l_ctx := dbms_xmlgen.newcontext
('SELECT DNAME,LOC
FROM depT
WHERE depTNO in (10,20)'
);
dbms_xmlgen.setrowsettag(l_ctx, 'Departments');
dbms_xmlgen.setrowtag(l_ctx, 'DNAME');
l_xmltype := dbms_xmlgen.getXmlType(l_ctx) ;
dbms_xmlgen.closeContext(l_ctx);
dbms_output.put_line(l_xmltype.getClobVal);
End;
==========================================
OUTPUT WILL BE

 

 
<Departments>
<DNAME>
<DNAME>ACCOUNTING</DNAME>
<LOC>NEW YORK</LOC>
</DNAME>
<DNAME>
<DNAME>RESEARCH</DNAME>
<LOC>DALLAS</LOC>
</DNAME>
</Departments>

Thursday 14 August 2014

Oracle Fusion Applications

Oracle Fusion Applications (OFA) is a suite of enterprise resource planning software applications from Oracle Corporation. It is distributed across various product families; including financial management, human capital management, customer relationship management, supply chain management, procurement, governance, and project portfolio management.
Oracle Fusion Applications were announced shortly after Oracle's US$18 billion acquisition spree of PeopleSoft, JD Edwards, and Siebel Systems in 2005.
Oracle Fusion Applications were envisioned and pitched as an enterprise resource planning suite - a combination of features and functionalities taken from Oracle E-Business Suite, JD Edwards, PeopleSoft and Siebel product lines. The suite is built on top of the Oracle Fusion Middleware technology stack; both layers implement the Oracle Fusion Architecture, which leverages the capabilities of service-oriented architecture.

Started With Multiple Platform :
 Industry leading , standard -based, configurable, adaptive and secure fusion middleware.

Built Best Practise Business Processes based on Hundreads of year of Learning :
EBusiness Suite , Peoplesoft, JD Edwards, siebels etc.

Reinvented the user experience:
Role Based user interface embedded  decision support, purvasive collabroation.

Made Ready for cloud:
Private for Public Cloud.


Oracle Fusion Architecture:

Oracle Fusion Architecture provides an open architecture ecosystem, which is service & event- enabled. Many enterprises use this open, pluggable architecture ecosystem to write Oracle Fusion Applications, or even third-party applications on top of Oracle Fusion Middleware.
Oracle Fusion Architecture is based on the following core principles,
  • Model Driven: For applications, business processes and business information
  • Service & Event- enabled: For extensible, modular, flexible applications and processes
  • Information Centric: For complete and consistent, actionable, real-time intelligence
  • Grid-Ready: Must be scalable, available, secure, manageable on low-cost hardware
  • Standards-based: Must be open, pluggable in a heterogeneous environment
Oracle Fusion Applications that can be written on Oracle Fusion Middleware using the Oracle Fusion Architecture ecosystem, were released in September, 2010.

How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>

 How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>  Sometime these xml data tags automatically chang...