cancel
Showing results for 
Search instead for 
Did you mean: 

RFC2JDBC scenario error while inserting multiple rows because of constraint

Former Member
0 Kudos

Hello,

We have a RFC2JDBC scenario,

in RFC, we have internal tables, after mapping xml looks like;

- <ns1:masterData>

+ <Statement>

+ <Statement>

+ <Statement>

</ns1:masterData>

in addition to these, I insert the records in mssql DB and one of the table column have a constraint .

The problem occurs here, if one of the records have errors because of the constraint, the other records dont be processed or valid Statements can not run.

For example;

1. <Statement> (valid sql)

2. <Statement> (Have errors because of constraint)

3. <Statement> (valid sql)

My first statement is inserted into table . 2. and 3. statement is not inserted. And the PI XML message generates an error Which is a DeliveryException.

I expect a result like;

<Statement_response>

<update_count>0</update_count>

<insert_count>1</insert_count>

</Statement_response>

<Statement_response>

<update_count>0</update_count>

<insert_count>0</insert_count>

</Statement_response>

<Statement_response>

<update_count>0</update_count>

<insert_count>1</insert_count>

</Statement_response>

First and Third Statment are inserted and Second is not..

How can I do this?

Thanks for your help..

Accepted Solutions (0)

Answers (1)

Answers (1)

VijayKonam
Active Contributor
0 Kudos

why dont you use 1..unbounded mapping on receiver side and make individual calls to JDBC adapter?

Refer to my document - http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/600b455f-01cd-2b10-0cab-a50e47a8f800

might help u.

VJ

Former Member
0 Kudos

Hi VijayaShankar, thank you for your answer..

I am trying to apply your solution to my problem.

One point, I couldnt pass..

In your Article, you use an IDOC interface, and there is no problem while creating Mapping Template.

But in my scenario, I am using RFC as a source message. And I couldnt create message template because, RFC has no

type. it is expected complex type but my imported RFC interface has no type. So I couldnt create Message Interface..

if there is a way to solve this, let me know..

Hasan.

Former Member
0 Kudos

Hi,

You can use simple 1:N multi-mapping approach for this requirement.

Also, by default, JDBC gives the response of the in terms of number of rows affected. Are you using BPM to capture this response?

-Supriya.

Former Member
0 Kudos

I am not using BPM, But I think, I have to use. The above solution is not working for me, response returns me if all the rows are executed successfully, if one of the rows have errors, for example, constraint error.. the process is stopped, end there is no return response.