cancel
Showing results for 
Search instead for 
Did you mean: 

Store Procedure Execution from SAP PI

Former Member
0 Kudos

Hello experts,

I have a scenarios as follows:

SAP ECC ABAP Proxy->SAP PI-> JDBC Stored Procedure execution in Oracle Database

I need to execute a Stored Procedure in the Oracle database sending it a parameter as an xml string, I created the stored procedure in Oracle DB and if I test it from a third party tool such as Razor works fine, now the problem is when I try to execute it from SAP PI.

The XML sent to oracle is as follows:

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MT_EnvioStock_SmartFlex_SPInt xmlns:ns1="http://cabletamps.com/SWCV_SMARTFLEX/EnvioStocks">

- <Statement>

- <spName action="execute">

<table>SMART.STORE_INTERMEDIO</table>

<par_osbitemload isInput="true" type="CLOB"><?xml version="1.0" encoding="Windows-1252" ?><ITEMS_LOAD><OPERUNIT_ORIGIN_ID>100000</OPERUNIT_ORIGIN_ID><OPERUNIT_TARGET_ID>100101</OPERUNIT_TARGET_ID><DATE>11-09-2011</DATE><DOCUMENT>FACT-0012</DOCUMENT><REFERENCE>SOL-A0001</REFERENCE><ITEM_ID>1000</ITEM_ID><QUANTITY>1</QUANTITY><COST>50</COST><SUBSIDY>0</SUBSIDY><STATUS>N</STATUS><SERIE>AIR_GRID_411</SERIE><ATTRIBUTES><MARCA>VALUE1</MARCA><MODELO>VALUE2</MODELO></ATTRIBUTES></ITEMS_LOAD></par_osbitemload>

</spName>

</Statement>

</ns1:MT_EnvioStock_SmartFlex_SPInt>

and with the logSQLStatement as true in the comm channel the only log regarding the stored procedure is this:

Time Stamp Type Description

05.10.2011 17:13:14 Information SMART.STORE_INTERMEDIO

05.10.2011 17:13:14 Information Database request processed successfully.

05.10.2011 17:13:14 Information MP: leaving

As you can see no parameters are visible but I think this is because the adapter can only log this with a stored procedure execution, cause I tried renaming the parameters and not sending them in the xml, and the comm channel reacts as missing parameters for stored procedure execution.

I've already tried the auto commit and database connection per message options in the comm channel with all possible combinations of both of them, tried the isInput attribute as 1, cause in the sap help link in the structure says true and in a parragraph following says 1 to activate the attribute, tried my value of xml string with ' at beggining and end, and without as you can see in the xml sample before, the user in the comm channel defined has the security permissions to execute this Stored Procedure and any other thing inside it, the xml string is considered as it is by PI cause this:

<?xml version="1.0" encoding="Windows-1252" ?><ITEMS_LOAD><OPERUNIT_ORIGIN_ID>100000</OPERUNIT_ORIGIN_ID><OPERUNIT_TARGET_ID>100101</OPERUNIT_TARGET_ID><DATE>11-09-2011</DATE><DOCUMENT>FACT-0012</DOCUMENT><REFERENCE>SOL-A0001</REFERENCE><ITEM_ID>1000</ITEM_ID><QUANTITY>1</QUANTITY><COST>50</COST><SUBSIDY>0</SUBSIDY><STATUS>N</STATUS><SERIE>AIR_GRID_411</SERIE><ATTRIBUTES><MARCA>VALUE1</MARCA><MODELO>VALUE2</MODELO></ATTRIBUTES></ITEMS_LOAD>

appears in Bold Black inside the tags of my parameter field par_osbitemload.

Already checked blogs:

Now what I'm thinking is that the parameter of the stored procedure being type CLOB could be a problem, according to the sap help we can use this, other thing is that I'm using the same user for execution in razor and in PI but maybe PI use another system user according arquitecture for sending info to database, this is just a thought, everything seems alright and pretty simple but I cannot make it work.

Thanks in advance for any comments on experiences like this, ideas or suggestions.

Regards,

Julio Cesar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I suggest to modify input parameter type, and declare it as a VARCHAR2.

I've seen (in previous experiences) that there're some problems between Sap & OracleSP with parameters typed as DATE or BLOB/CLOB.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello guys,

thanks a lot for your help, we asked the Oracle DBA to monitor our asynchronous execution and there was a problem with the date format, cause the thir party tools format the data before send it to the Database, thanks again.

Regards,

Julio

former_member192851
Active Participant
0 Kudos

Maybe can help

Best Regards,

Chizz

Former Member
0 Kudos

Hi Julio,

Have you checked this link:

PI[PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/26728] [original link is broken] [original link is broken] [original link is broken] [original link is broken]; even this is sender side JDBC adapter...

Also check Note 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities

Regards, Mika