Beruflich Dokumente
Kultur Dokumente
Join us for Upcoming Logistics and Master Data Management Community Webcasts. For complete details on all upcoming Oracle Advisor Webcast Events, please review: Document 740966.1, Oracle Advisor Webcast Schedule in MOS Do you have any suggestions for future Inventory Management or Product Lifecycle Management webcasts? Please email your suggestions to: oracle-inv-news_WW@oracle.com
Oracle Product North America: xxxx Information International: xxxx Features Wednesday October 27 1:00 PM Eastern 10:00 AM Pacific Document 1185694.1
Password: Advisor Lifecycle Management
Management / Product
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
Webcast Information
Presentation will be recorded and available from:
Note 740964.1 And linked from MOS Logistics and Master Data Management Communities
Question and Answer will be at the end of the presentation and will be via WebEx Chat functionality
Send your chat question to All Panelists Refrain from including any proprietary information in your chat question We may not have opportunity to respond to all questions during live session Question responses will also be posted to MOS Logistics and Master Data Management Communities
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
In Release 12, the Oracle Integration Repository is shipped as part of the E-Business Suite. (Responsibility: Integrated SOA Gateway)
10
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
11
APIs
External Source
API
E-Business Suite
Why APIs ?
Migrate data from legacy systems to Oracle EBS Perform custom processing before data loads
12
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
13
14
PL/SQL APIs
PL/SQL Packages The Application Programming Interface or API is a PL/SQL packaged procedure that can be used as an alternative to Application online forms for data entry and manipulation.
15
API Packaging
Package: A package bundles logically related types, variables, cursors and subprograms(procedures and functions)
A package has two parts Specification and Body: Package Specification: The specification declares the types, constants, variables, exceptions, cursors and sub programs
16
Procedure: Subprogram without a return value, uses OUT parameters to return values
Function: Subprogram with a return value Note: All public packages that expose the APIs are named as <Product Prefix>_<Pkg Name>_PUB. Ex: EGO_ITEM_PUB Both the specification and body are packaged as two separate files, specification as <File Name>S.pls Ex: EGOPITMS.pls body as <File Name>B.pls Ex: EGOPITMB.pls
17
Default Values:
FND_API Boolean Values, Return Status Values {or} Package Spec API specific pre-defined constants Data Input: Process Single Record p_<var_name>_rec
{or}
Process Multiple Records p_<var_name>_tbl
18
P_INIT_MSG_LIST
P_COMMIT P_ITEM_TBL
IN
IN IN
VARCHAR2 := G_FALSE,
VARCHAR2 := G_FALSE, EGO_ITEM_PUB.ITEM_TBL_TYPE, EGO_ITEM_PUB.ROLE_GRANT_TBL_TYPE,
19
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
20
API Inputs
ITEM_NUMBER DESCRIPTION PRIMARY_UOM SECONDARY_UOM ITEM_TEMPLATE ROLE_NAME GRANTEE_PARTY_TYPE GRANTEE_PARTY_NAME START_DATE END_DATE
P_ROLE_GRANT_TBL
21
Code Flow
Initialize Applications Context Load data from external system Call the API
22
Code Flow
CREATE OR REPLACE PROCEDURE <proc_name> (parameter_list) <declare required variables and cursors> BEGIN <Initialize Applications Information>
<Loop through the cursor / Load data from the users table, and call the API>
<Print output information, and errors, if any> EXCEPTION <Handle exceptions, if multi-level API calls are made> END;
23
-- Get the user_id SELECT user_id INTO l_user_id FROM fnd_user WHERE user_name = l_user_name; -- Get the application_id and responsibility_id SELECT application_id, responsibility_id INTO l_application_id, l_resp_id FROM fnd_responsibility WHERE responsibility_key = l_resp_name;
-- Print message to user FND_GLOBAL.APPS_INITIALIZE(l_user_id, l_resp_id, l_application_id); dbms_output.put_line('Initialized applications context:'|| l_user_id ||' '|| l_resp_id ||' '|| l_application_id );
24
25
26
-- Code to print errors using the error_handler package dbms_output.put_line('====================================='); dbms_output.put_line('Return Status: '||x_return_status); IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN dbms_output.put_line('Error Messages :'); Error_Handler.GET_MESSAGE_LIST(x_message_list); FOR i IN 1..x_message_list.COUNT LOOP dbms_output.put_line(x_message_list(i).message_text);
END LOOP;
END IF; dbms_output.put_line('====================================='); =
27
Exception Handling
28
Demonstration
29
Agenda
Oracle Integration Repository Introduction to PL/SQL APIs Understand API Definition Code Flow & Demonstration Troubleshooting Best Practices References Question / Answer
30
Troubleshooting
31
Troubleshooting
Get the debug log file to see additional messages For Inventory, INV: Debug level to 15 INV: Debug Trace to YES INV: Debug file to a directory that is defined in the utl_file_dir parameter value
SELECT value FROM v$parameter WHERE name = utl_file_dir;
32
Troubleshooting Contd
For PLM / PIM, Input parameters - p_debug_level (>0)
* Note: Not all PIM APIs support this parameter.
33
Troubleshooting Contd
Get the trace and tkprof files for looking at the internal queries
To generate the trace file:
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
34
Troubleshooting Contd
To locate the trace file:
SELECT VALUE FROM V$PARAMETER WHERE NAME = user_dump_dest'
35
Agenda
Oracle Integration Repository Understand API Definition Code Flow Demonstration Troubleshooting Best Practices References Question / Answer
36
Best Practices
Ensure that
p_commit is set to TRUE only when implicit COMMIT is required x_return_status is printed to the users output: (S Success, E Error, U Unexpected Error) Print all Error Messages from FND stack in case of errors Handle exceptions appropriately, when calling multiple APIs
Agenda
Oracle Integration Repository Understand API Definition Code Flow Demonstration Troubleshooting Best Practices References Question / Answer
38
39
Q&A
41
5. Start a Discussion or comment on an existing thread The recorded version of this webcast will be available on the Advisor Webcast Archive in MOS:
Document ID 740964.1 Look under Oracle EBS Community Webcasts > Manufacturing
42
THANK YOU
43
44