Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query on declaration of SQL Variable in storedprocedure in sap PI 7.3.1 single stack.

Hi Sap-mates!!

Need your help another time.

I'm struggling with a requirement where I need to declare sql variables before executing stored procedure. I couldn't get any related content in scn hence posting my query here.

I have understood from other sql/oracle related web-sites that we need to insert the variables/fields first into temp table/scalar & then execute stored procedure.

Below is the declaration statement, that I'm trying to work with sap pi.

declare @temp CompMasterTable

INSERT INTO @temp VALUES('5000', 'DangerousGoods', '501', 5,)

INSERT INTO @temp VALUES('5001', 'DangerousGoods', '502', 6,)

EXEC dbo.CompMaster @temp

As below Declared variables in Insert statement

<Statement>

   <MAT action="INSERT">

      <table>CompMasterTable_MAT</table>

      <access>

         <Plant/>

         <Text/>

         <Matnr1/>

         <Seq/>

      </access>

   </MAT>

</Statement>

_____________________

Executed SP

<ExecuteSPCompMaster>

<sproc_MAT action="EXECUTE">

<table>CompMaster</table>

<insert_statement type="varchar"></insert_statement>

</sproc_MAT>

</ExecuteSPCompMaster>

I know something is wrong could you please guide me

Not what you were looking for? View more on this topic or Ask a question