cancel
Showing results for 
Search instead for 
Did you mean: 

how to save records in database in different tables

Former Member
0 Kudos

Hi experts,

My scenario is i have to send a multiple records in a single file which have to be saved in database and also my condition is, for example if price is less than 100 it has to be saved in table 1 and if price is greater than 100 it has to be saved in table 2. i hope u guys have understood the problem...

Thanks & Regards,

B.Srinivas Prasad.

Accepted Solutions (0)

Answers (5)

Answers (5)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>for example if price is less than 100 it has to be saved in table 1 and if price is greater than 100 it has to be saved in table 2. i hope u guys have understood the problem...

Create JDBC Receiver structure with multiple Statements. Each Statement represents a table. So if the source field value is less than 100 then map to the respective statement which deals that table. You don't really need multimapping. Refer SAP JDBC document structure help link.

Sample:

<root>
<StatementName1>
<dbTableName action=u201DINSERTu201D>
<table>Table1</table>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
</dbTableName>  
</StatementName1>
<StatementName2>
<dbTableName action=u201DINSERTu201D>
<table>Table2</table>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
</dbTableName>  
</StatementName2>
</root>

Former Member
0 Kudos

I would just create a Stored Procedure in the database. It is easier to troubleshoot and maintain.

Former Member
0 Kudos

hi, very easy

you create data type with two statement objects conditionin your mapping or create in DD store procedure or funcition.

statement 0 .1

statement2 0 .unbounded

Former Member
0 Kudos

hi,

if receiver is JDBC :

you have to create 2 tables in receiver side and in interface determination u have mention condition.

if receiver is sap db:

you have to create multi mapping(1:n) then in interface determination u have mention condition.

rajasekhar_reddy14
Active Contributor
0 Kudos

Create receiver JDBC receiver data type with two statement objects and write a condition accodingly. in one mapping you can achive it easily.

Shabarish_Nair
Active Contributor
0 Kudos

Hi experts,

>

> My scenario is i have to send a multiple records in a single file which have to be saved in database and also my condition is, for example if price is less than 100 it has to be saved in table 1 and if price is greater than 100 it has to be saved in table 2. i hope u guys have understood the problem...

>

>

>

>

> Thanks & Regards,

> B.Srinivas Prasad.

use multimapping. and then using conditional interface determination push the data into different tables