cancel
Showing results for 
Search instead for 
Did you mean: 

Xpath condition in interface determination

Former Member
0 Kudos

Hi all,

I have a scenario where i have two Interface mappings between same source and target. I need to define a condition based on if a field exists, then first one should be executed and if the field doesn't exists, then second.

How should i define a condition that if field doesn't exists, the second mapping should be executed.

Can any body please suggest.

Thanks,

Kalyani.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Kalyani,

To check existance of a field in Interface determination you can use Xpath.

When you configure more than one inbound interfaces in Interface determination and save it will prompt for codition.

Specify the Xpath in the left operand and select (EX) operator to check the existance of the filed inCondition Editor.

Hope this may help you.

Thanks and Regards,

Saipriya.

Former Member
0 Kudos

Hi

May be the below useful for reference...

(/p1:MT_ABC/Records/RecordType1/Data2[substring(Data2,2,1) = '0'] EX )

(/p1:MT_ABC/Records/RecordType1[substring(Data2,2,1) = '8'] EX)

There would be a 'Square brackets' as prefix and suffix of hilighted colour above...

Warm regards

Ramesh Pothireddy

Edited by: Ramesh Pothireddy on Feb 11, 2010 9:49 AM

Former Member
0 Kudos

Thanks for your replies . But this condition is not working for our requirement .

Below is our exact requirement.

Source structure is the xsd which we have imported into ExternalDefinition.This External Definition has 2 other external references(namespaces are also different).

The field which we need to check is in the external reference. This field is not visible in interface determination condition editor.

We have manually added the xpath condition in the interface determination.

1)The Xpath for EXIST condition looks like

(/p1:ABC_Responses/p1:ABC_Response/p1:ABCResponses/p1:ABCResponse/p6:Fault/p6:ID EX).

This is working fine.

2) The XPath for Not Exists condition looks like

(/p1:ABC_Responses/p1:ABC_Response/p1:ABCResponses/p1:ABCResponse/p6:Fault[not(p6:ID] EX).

This is not working.

Hope iam clear with the requirement now.

Edited by: kalyani uppari on Feb 11, 2010 10:30 AM

udo_martens
Active Contributor
0 Kudos

Hi Kalyani,

you can either copy your inbound interface (with the same message type) and put the Xpath condition into the interface determination

or make the mapping dependend from the condition. This would be very easy in case of XSL, ABAP or Java because a simple choose/when/otherwise or if / else with condition on a certain source value would struture the code. Message Mapping is more challenging because the target is basis for the structure.

Regards,

Udo

Former Member
0 Kudos

Hi Kalyani,

Xpath condition will help you to identify which interface mapping should be triggered among the two. Here in your case the same file can be sent to both interface mappings but based on the Xpath condition particular interface mapping will be triggered. So you need to maintain condition at mapping also.

Hope this will help. Please let me know if you need further clarifications.

Regards,

Sridhar.

Former Member
0 Kudos

Hi Kalyani,

May be you need this..

/people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service

Regds,

Pinangshuk.

former_member200962
Active Contributor
0 Kudos
How should i define a condition that if field doesn't exists, the second mapping should be executed

last but one example from this wiki: http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination

Regards,

Abhishek.

Former Member
0 Kudos

Thanks for the reply.

I have already tried this option but it doesnt work.

Regards,

Kalyani.