Executing Stored Procedure From Sender Adapter in SAP PI 7
Executing Stored Procedure From Sender Adapter in SAP PI 7
Invoking Oracle stored procedures from within a JDBC sender channel is only possible for Oracle
DBMS versions >= 10.2.x using table functions
(check OSS note Note 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities point "6.
Oracle Database 10g 10.2.x JDBC Driver" for details") and other approach is developing your
own JDBC adapter .
Go through the below link for comparison of the above two approaches and brief explanation on second
approach.
http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/10/04/pixi-sender-jdbc-adapter-for-
oracle-stored-procedures-in-5-days
http://scn.sap.com/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-
adapter
Here I’m focusing on explaining the first approach in an easy manner by taking a business case.
It’s assumed that the reader of this document is familiar with the basics concepts
of SAP PI and database stored procedure or functions and
This document is limited to only sender JDBC adapter. Receiver adapter is not
discussed as part of this document.
Prerequisites:
Stored procedure:
is
begin
end;
In order to group these we will create a package inside which we will create
these functions and collection type.
end PITestPkg;
Please note that after the function return type pipelined key word is used to
specify that this function is pipelined.
Create the package body with the function code to execute the stored procedure
and return the pipelined values.
empDetails sys_refcursor;
/*row type temporary variable to loop through ref cursor and pipe the values*/
empDetail db_employee%rowtype;
begin
get_emp_details(empID, empDetails );
loop
end loop;
return;
/*end of function*/
end fn_Get_Empdetails;
end PITestPkg;
Adapter configuration:
There is not much configuration changes required from the PI end; we need to
use the select statement to execute the pipelined function
Configure all IDE objects as required, Save and activate all the IDE objects. Now
you can see the result of the stored procedure
in PI. Below is the screen shot of the output of the “get_emp_details” stored
procedure received in SXMB_MONI.
Disadvantages :
2. Executing stored procedure with more than one ref cursor will need very
complex collection types and pipeline function
Regards
Venkat