cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC ,delete .insert ,update

Former Member
0 Kudos

hi

If there is one feed from sap ,we can insert or update database records(if not already inserted then update). but can we delete also ? or a separate interface is needed for deletion of a record in the database table?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

1..N mapping(with out BPM) would solve the issue. Just use multiple message types. One for Insert/update and the other one for delete. In the mapping choose which message you need to populate. You need both the message types as your target messages with occurance set to0..1 for both.

Former Member
0 Kudos

when you say : choose a operation in mapping ,how to choose? is it like in sending side ,there should be a flag which tells whether to delete or no? Thanks

Edited by: sap_logic on Sep 20, 2010 6:22 PM

Edited by: sap_logic on Sep 20, 2010 6:23 PM

former_member241146
Active Participant
0 Kudos

Hi.

You can use INSERT, UPDATE, DELETE and others.

Follow the HELP SAP link about it:

Defining XML Documents for Message Protocol XML SQL Format

http://help.sap.com/saphelp_nwpi711/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm

Regards

Bruno

Former Member
0 Kudos

Thats fine, i understand we can do all these operations.

I have a single feed and the action is one of the fields in the source structure ( action : update_insert or Delete)

but my question is as we know update_insert : it updates if not already inserted.but can we do all operations in one interface: i imply even the delete. If so how ?

one solution could be to send the flag : DELETE also from the source side and do a map that if action = delete then do some logic. I wanted to understand this logic: whether we need to create another statement node or access ?

Thanks

former_member241146
Active Participant
0 Kudos

Hi.

Yes, it's possible!

You can use MULTI-MAPPING and your conditions will be in the message mapping (whether it is a UPDATE_INSERT statement or it is a DELETE statement).

Multi-Mapping without BPM - Yes, itu2019s possible!

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Regards.

Bruno

stefan_grube
Active Contributor
0 Kudos

> one solution could be to send the flag : DELETE also from the source side and do a map that if action = delete then do some logic. I wanted to understand this logic: whether we need to create another statement node or access ?

You need another statement.

You can have different statements with different actions or different tables in one XI message.

Former Member
0 Kudos

Statement node is mapped to the repeating segment from the source structure.

action is coming as a separate field from the source structure since insert and updates can be implicitly done with the key logic but deletes have to be explicitly specified from the source field whether a particular record needs to be deleted.

So suppose a flag on source structure comes as DELETE, so another receiving structure statement node needs to be created since table for insert or update or delete is the same , just the action is different and action is coming as a flag from the source structure?

what is the mapping logic we need to put at Statement level for creating this conditional create?

Thanks

Edited by: sap_logic on Sep 20, 2010 9:54 PM

stefan_grube
Active Contributor
0 Kudos

You can use the same structure when you have suffient access and key fields for insert, update and delete.

It is not quite clear from online help, but I think the dbTableName node is 1:1 on statement node.

So each action needs another statement.

stefan_grube
Active Contributor
0 Kudos

> what is the mapping logic we need to put at Statement level for creating this conditional create?

The easiest approach: create a statement for each access. Otherwise your mapping would be tricky.

Former Member
0 Kudos

Thats fine.

Even if we have to create multiple statement nodes for different action coming from source structure, what is the mapping logic we could use to conditionally create different statement nodes based on a particular flag value from source?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can control the generation of the DELETE structure at its statement level.

Check the Source field for Delete flag and based on that create the statement or suppress the statement of delete.

Use ifWithoutElse mapping function for this.

-Supriya.

Former Member
0 Kudos

At action level also this can be controlled.

If source field has delete flag set , in action map it to Constant (DELETE) else map it to action to UPDATE_INSERT.

IF then else could be used. I tried it works well.

At statement level i am mapping the source segment which is repeating.

IS this logic also correct?