cancel
Showing results for 
Search instead for 
Did you mean: 

How do we know database connection fails in RFC-JDBC scenario

Former Member
0 Kudos

Hi,

In my RFC-JDBC scenario, from my RFC call if I receive one paramater as x, I need to delete the table in DB. If that param isnt x, I need to insert into the DB table.

How can I do this without BPM?.(since I dont want to use BPM).

Another problem is, how do I know that database connection fails, since I need to send "DB Connection Failed" from XI to SAP?.

Thanks-a-lot.

Raj.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

you can try setting 2 receivers with 2 jdbc communication channles

then in the receiver determination do:

if x then one receiver

if not x then the other

and use different mappings

but in the end the message will go to the same

database

I havne't tried that but you can give it a try

if don't want a BPM

Regards,

michal

Former Member
0 Kudos

Hi Michal,

Thanks-a-lot for prompt reply. In the datatype I want to define another structure for delete, and want to implement like christine mentioned. How do I can send a return message when database connection fails.

Hey christine, you responded I was composing this, can you please tell me exactly how to do this, I also have same thing in mind. May be an example. Meanwhile I will try myself.

Thanks,

Raj.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>> you responded I was composing this, can you please tell me exactly how to do this

if you don't want to use message mapping

then you can always create any kind of target structures

in java or abap mappings

Regards,

michal

Former Member
0 Kudos

Hi Michal, and Christine,

I was little bit misunderstood. There are 2 actions I need to do. One is Delete, when a param is x, another is Insert. If that param isnt x, then I dont need to that delete.

Can you please tell me how can I do that?.

Thanks,

Raj.

Former Member
0 Kudos

Hi Raj,

i think, i got you right. You either want to delete from that table or you want to insert into that table. (or do you want to delete the whole table with drop table statement?)

The SQL XML allows you to set the attribute action to DELETE or INSERT according to whatever you want to map. So you have to create a data type, message type and message interface for that SQL XML, so that you can use the message type as target in your mapping. And than in the mapping use a contruct to compare your parameter to the value it needs to have to delete and use an if else to set ation to DELETE or INSERT. It's really not that complicated.

Regards

Christine

Former Member
0 Kudos

hi cHRISTINE,

Thanks. Actually i want to do both of the actions at the same time one after the other. But the delete action is optional, it will be done only when its value is 'X'.

I am working on this link,

http://help.sap.com/saphelp_nw04/helpdata/en/5d/db0e83e8e74202a5bff527055ab7e5/frameset.htm.

Thanks, I will let you know as soon as I finish.

Raj.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

if you want to do both in one step you can

try executing a stored procedure

and give this X paramter to it with all

the values and do the insert, delete "programming"

in this stored procedure

Regards,

michal

Former Member
0 Kudos

Hi Raj,

ok, so you need two statments in your SQL XML. One you will always fill and for the other you can use a creatIf function two create the delete statement only if your parameter is x. Check here on how createif works: http://help.sap.com/saphelp_nw04/helpdata/en/d9/3033f96c79674f90e3ab8d101a595b/content.htm.

Regards

Christine

Former Member
0 Kudos

HI Christine,

Thanks-a-lot. I used the Createif function. But, the link you sent me actually confused me. The better way is, if we click on the function list, we need to select the createif function, and constant function with value 'X' (hard coded), then map it to the target structure. In testing Target structure appear only if value is 'X'.

Thatway it worked fine without any hassles.

Thanks,

Raj.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

to delete or insert you have to create an according document structure in your mapping. Check the documentation of the XML Format for the JDBC receiver:

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Basically you'll need to incorporate logic in your mapping to set attribute action to DELETE if x and INSERT_UPDATE or INSERT if not x.

This does not require a ccBPM, just a little effort in the mapping.

Regards

Christine