Blogs

Praveen Gujjeti

XI/PI: Extended Receiver Determination with Conditional Context Object interface Determination
Praveen Gujjeti
Business Card
Company: Flextronics India (P) Ltd.
Posted on Nov. 04, 2009 01:28 AM in SAP NetWeaver Platform, SAP Process Integration (PI)

Subscribe.Subscribe
Print. Print
Permalink Permalink

 In one of Flex Projects, we got an enhancement requirement for an existing design and the situation is something like this.

 

Sender: MDM (Single File Interface, but before enhancement it is 5 different File interfaces with same structure but with different values)

Single Receiver: SRM (5 different ABAP Proxies)

 

So in the new requirement, the single message from MDM interface should be split according to certain value in the payload for a recurring field and then the split messages should be routed to a single SRM Business system using 5 different ABAP Proxy interfaces.

 

Initially I thought I can go ahead with multi mapping concept, but later I realized that it doesn’t work as receiver is XI adapter and it doesn’t support multi mapping.

Second option would be XPATH expression conditions in Interface Determination for logical routing of messages to the corresponding ABAP proxy interfaces. But since the input field reoccurs from the MDM source system it is not possible to set conditions using XPATH Expression.

Then, how to proceed.........?

 

The tricky thing is to use the combination of extended Receiver determination, Dynamic Configuration and then condition based interface determination using context objects. Let me explain in more detail.

Assume that we have the following structure from MDM,

image

Here the DIMENSIONTYPECODE can have values 1 to 5. And based on these values the message should be splitted and each message should go to one of the 5 proxies. e.g., all Dimension records with DIMENSIONTYPECODE = 1 should mapped to the first ABAP Proxy message type. Similarly for DIMENSIONTYPECODE = 2, 3, 4 and 5 the corresponding Dimension records should go to the second, third, fourth and fifth ABAP Proxy message Types. So we should have 5 message mapping and 5 interface mappings.

 

Next we should determine receiver business system using Extended Receiver Determination interface. So, define a mapping between MDM message type and Receivers message type from SAP BASIS SWCV (http://sap.com/xi/XI/System). Now, hardcode the business system for the SRM system in this mapping. Now we need an UDF within this mapping which can initialize certain predefined context objects based on the values of DIMENSIONTYPECODE. Later, these context objects will be useful for conditional Interface Determination in Integration Directory for the five ABAP proxy interfaces. I am using HTTP URL param context objects (URLParamOne to URLParamFive) in the UDF code. We will set values for these context objects logically based on the values of DIMENSIONTYPECODE using Dynamic Configuration code.

 

image

                              Map Constant (SRM Business System)--> Service

image

 

Extended UDF code

Then define interface mapping for the above mapping, which we will use in extended receiver determination in Directory.

 

Activate all the objects in Repository.

 

Next in Integration Directory, define a sender Agreement for the MDM interface associated with Sender File channel. Then, define an extended receiver determination using above the interface mapping which logically sets conditions for the context objects (URLParamOne to URLParamFive) based on the values of DIMENSIONTYPECODE filed from MDM system.

 

image

Define interface determination as below.

image


image

Define five receiver agreements for each ABAP Proxy Interface. Activate all objects in Integration Directory.

 Now, lets test the scenario with the below sample payload.

 

 

Lets check SXMB_MONI for the messages.We can see that there are only two child messages, since we are passing only two values 1 and 2 for DIMENSIONTYPECODE field.

image

Lets verify the this by checking Dynamic Configuration Header.

image

 So, the Dynamic Configuration Header clearly indicates that it satisfies only two conditions in the interface determination.

 

Praveen Gujjeti Certified SAP Netweaver consultant - Flextronics India(P) Ltd.


Add to: del.icio.us | Digg | Reddit


Comment on this article
Comment on this weblog