cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting Multiple Line Items To Stored Procedure

former_member183908
Active Contributor
0 Kudos

Hi

I need to insert line item values to one of the argument in stored procedure.what data type do i need to pass for type attribute.I tried with different datatypes from sap help but no luck.Please guide me how should i proceed.

Interface is : Idoc to JDBC (stored procedure)

Target structure:

DT_Orderstatus_Trgt

--> StatementName

-->SP Name

action--->Attribute

table--->Attribute

--->Argument (to insert multiple line items)

isInput

isOutput

type

Just i am showing only one argumnet which needs to be inserted multiple line items.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

If you are dealing with high volume then convert your multiple lines payload in to one string and send it to SP argument

or

if load is not high colume then change occurance of statement object to 1 to unbounded and repeat the structure .

or

insted of stored procedure use insert statement where yu can repeat access tag depends on numer of line items and make sure that access tag occurace to 1 to unbounded.

Regards,

Raj

former_member183908
Active Contributor
0 Kudos

Hi Raja,

Thanks for the reply.

-->If you are dealing with high volume then convert your multiple lines payload in to one string and send it to SP argument

i am dealing with high volume data how can i convert payload into string?

Thanks

Pavan

Former Member
0 Kudos

hope i understood u correctly and please correct me if i am wrong

u want to pass entire line item payload at a single go to SP (and on the receiver side SP will parse that string and do the necessary operations)??

ur structure will be:


DT_Orderstatus_Trgt
--> StatementName
-->SP Name 
action--->Attribute
table--->Attribute
Argument (to insert multiple line items)
Type-->attribute

ur mapping will be (i assume that u r working on PI7.1 or higher versions):

lineItem (right click return as XML)-----Argument

constant(VARCHAR)-----type

rajasekhar_reddy14
Active Contributor
0 Kudos

You have to build mapping logic and separate evry record with special charctes like $&$ to differentiate multiple records and convert in to one string. you recquired two levels of mapping for this.

request DB team to alter stored procedure to support this.

Regards,

Raj

GabrielSagaya
Active Contributor
0 Kudos

Hi,

Stored procedure can support the below data types

INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).

But

Instead of passing multiple line items / array of input value in stored procedure, You can go for the below option as having 2 statements in your mapping with below structures and those 2 statements should be linked with the primary key say col1.

<root>

<StatementName1>

<dbTableName action=u201DINSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName1>

<StatementName2>

<dbTableName action=u201DINSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName2>

</root>