cancel
Showing results for 
Search instead for 
Did you mean: 

Interface Determination condition

RafaelVieira
Active Participant
0 Kudos

Hi all,

I'd like to hear your opinions about a scenario where I'll have 2 interfaces (both async Mail->Abap Proxy) with disctinct layouts in Outbound comming from email side and, according to conditions, will trigger one or another Inbound interface (and Interface Mapping).

Interfaces strucutures:

               Interface A

MT_A_Out                 MT_A_Inb

XML_Version             Input_1

Field_2                       Input_2

Field_3                       Input_3

               Interface B

MT_B_Out                   MT_B_Inb

XML_Version               Input_x

Field_88                       Input_y

Field_99

I'll be reading XML files from the same mailbox so I'm not treating anything with Java code. Instead, I'd like to read field XML_Version (which comes in both XML layouts) and identify the receiver interface and mapping as per XML_Version content.

I don't think I could achive that just by setting up conditions in a single Interface Determination, since it just does not let me choose different Senders. I'm able to input another Message Interface, since it's not validated against existing IR objects, but I can't choose the corresponding interface mapping (interf. mappings just don't come up in the input help and fields are blocked for free text input)  As per my understanding, it allows conditions since we are getting data from the same Sender strucutre to different Receiver interfaces. Is that true?

This one did not help at all:

http://help.sap.com/saphelp_nwpi71/helpdata/en/44/591a3de1754689e10000000a11466f/content.htm

I'm running on PI 7.0

Please, share opinions on how to achieve such result without a BPM and Java code.

Thanks in advance!

Rafael Vieira.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Rafael,

In the Receiver Determination, there is no context object for SenderSystem but in Interface Determination there is a context object for SenderSystem which you can use in xpath.

Regards,

Mark

Former Member
0 Kudos

Hello Mark,

I think Rafael is gng to use only one sender system so i am not sure if he could use this functionality?

Plz correct me if i misunderstood u.

Thanks

Amit Srivastava

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Amit,

Oops, I think he meant two different message types from the same sender. I think this is possible in receiver determination via xPath (although he is using PI 7.0).

Regards,

Mark

RafaelVieira
Active Participant
0 Kudos

That's right, 2 different msg structure (using XSD for External Definitions).

Let's say I have Message Interface MI_Layout1_Out and MI_Layout2_Out.

In Interf. Determination, when I create a condition, I can set the MI_Layout1_Inb and a possible receiver and also can define it's Interface Mapping with corresponding Msg Mapping within the Mapping area.This happens bcz, as per my understanding, the outbound interface is the same as I've set in the Interface Determination header section when I created the object.

I'm also able to input MI_Layout2_Inb and set the next condition to it but if I try to bring up its corresponding Interface Mapping which has MI_Layout2_Out as sender, match code does not bring anything for selection. That's bcz this Outbound Msg Interface does not match the one set in Interf. Determination header.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Rafael,

I think I understand it now. You have two different sender/receiver interfaces. In your interface determination for InterfaceA, operation mapping is appearing, but when you add InterfaceB in InterfaceA determination there is no operation mapping since the OM expects InterfaceA as the source.


In that case, just create another interface determination for InterfaceB and your scenario will work fine.

There is no need to read XML version since they are using different mappings and have different source structures.

Hope this helps,

Mark

markangelo_dihiansan
Active Contributor
0 Kudos

It is possible to add conditions for MT_A and MT_B but you need to use just one Message Interface for source. PI 7.0 does not support multiple operations as in PI 7.1 and above. So here is a little POC for you (although I'm using 7.1) Please click the images to enlarge.

1. Create a data type (just a simple type category with xsd:string as type) and use it as a message type and then use the message type in a message interface

In this POC, the interface pattern used is Stateless (XI30-Compatible) -> this is the only way to simulate your scenario

2. Create the message types for MT_A_Out, MT_A_Inb, MT_B_Out, MT_B_Inb. Afterwards, create  service interfaces for MT_A_Inb and MT_B_Inb.

Service Interfaces

3. Create message mappings/operation mappings for Interface A and Interface B

Operation Mappings:

Note: When activating the operation mapping it will give a warning, but this is okay.

4. Receiver determination is normal receiver determination

5. Interface determination condition is this:

6. Two receiver agreements

7. My testing is done via file to file (in this PoC). Source payload is this:


<?xml version="1.0" encoding="UTF-8"?>

<MT_B_Out>

   <XML_Version>2.0</XML_Version>

   <Field_88>Field88</Field_88>

   <Field_89>Field89</Field_89>

</MT_B_Out>

Hope this helps,

Mark

Former Member
0 Kudos

Hello Mark,

Nice Solution.

Thanks

Amit Srivastava

markangelo_dihiansan
Active Contributor
0 Kudos

Thanks Amit!

RafaelVieira
Active Participant
0 Kudos

Superb !!!

I really though it wasn't possible to solve this way.

Also, let me share another way I was able to implement and test (so far, only Test Configuration done, but successful):


1 - Using different namespaces and creating the same interface in both (let's say, MT_A_Out).

We would have

Interface: MT_A_Out

Namespace: http://demo.com/dynamic

Service: ServiceA

and

Interface: MT_A_Out

Namespace: http://demo.com/dynamic_2

Service: ServiceA

2 - Keep Interface(Operation) Mapping A as is and change Interface(Operation) Mapping B namespace:

Edit it and replace the source structure namespace from http://demo.com/dynamic_2 to http://demo.com/dynamic.

Save and activate everything before moving further.

3 - Adjust ID:

- Conditions in Interface Determination checking XML_Version pointing to respective inbound interface (MI_A if XML_version = 1.0, MI_B if XML_version = 2.0)

- Create a new Receiver Determination for 2nd interface

Both solutions work just fine.

Thanks a lot for your dedication Mark!! and tks to all !!

Rafael Vieira.

markangelo_dihiansan
Active Contributor
0 Kudos

Thank you Rafael for sharing! This is another approach to your problem.

Regards,

Mark

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello,

If i were u then i would have achieved this req as below:

1) Mail  -> File: Using a simple JM (i know u want to avoid java but let me tell u it would certainly ease ur task) read Xml_Version tag and depending upon its value dump input file on PI file system with proper name for instance - FileA_Timestamp.xml or FileB_Timestamp.xml

Then using below 2 interfaces pick renamed files from file system.

2) File A (FileA*)--> PI --> SI1_Inb_ECC

3) File B(FileB*) --> PI --> SI2_InB_ECC

Thanks

Amit Srivastava

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Create one common structure as Hareesh mentioned (if that is feasible with business requirement) and you can also do Standard receiver determination here with the configured two receivers in this case. You can use context or xpath expression and do condition  based on the xml_version field to choose appropriate receivers during runtime.  Please refer Standard Receiver determination sap help link.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Create one common structure as Hareesh mentioned (if that is feasible with business requirement) and you can also do Standard receiver determination here with the configured two receivers in this case. You can use context or xpath expression and do condition  based on the xml_version field to choose appropriate receivers during runtime.  Please refer Standard Receiver determination sap help link.

former_member184720
Active Contributor
0 Kudos

i just over looked your requirement so modifying my reply.

I don't think you can go for multi mapping without BPM  as your receiver is ABAP proxy & your PI version.

Message was edited by: Hareesh Gampa

RafaelVieira
Active Participant
0 Kudos

Tks Hareesh, but I'm still seeing only same option of 1:n, and for my scenario, I have 2 different incoming XML layouts that must be mapped according to XML_Version field.

I didn't get how I can achieve this result, after reading the links you provided.

former_member184720
Active Contributor
0 Kudos

Hi Rafael - I had update my reply as multi mapping without BPM is not possible for ABAP proxies/IDOC's.

is it not possible for you to have one common structure for both the interfaces?

Define one structure having two fields in it.

MT_Out                 MT_Inb

XML_Version             Input_1

Field_2                       Input_2

Field_3                       Input_3

Field_88                    Input_x

Field_99                    input_y

And handle all the logic based on the XML_VERSION value in the mapping.