cancel
Showing results for 
Search instead for 
Did you mean: 

using context object

Former Member
0 Kudos

Dear All

i am trying to use context object in order to determine one of target system.

i have one sender and two receiver without BPM. and it works fine now.

for example, location field and i would like to use value of location filed to determine receiver channel,

such as LA or BO, all of LA should be called to A business system and BO should be called to B business system.

i created context object and assigend to interface message and when i standing on receiver determination in configuraiton time(ID), i could not determine with context object. how do i use context object to determine each business system.

does anyone help me?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

If your XPATH is not long enough, you can do this conditional routing without context objects. In your receiver determination, there is a conditional editor. Use can use this conditional editor to enter one or more conditions. Check this up..

Regards,

Ravikiran.C

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello David,

I think filtering by mapping is best explained by one of the new mapping patterns that are (as of SP14) part of your XI installation. Please check in software component version <i>SAP BASIS 6.40</i>, ns <i>http://sap.com/xi/XI/System/Patterns</i> the Message Mapping <b>MapExampleFilterRecordsByQualifier</b>. Instead of the <i>less</i> function you'd rather use the <i>equalsS</i> function in your case. The behavior is also well documented in the online help.

Best regards

Joachim

Former Member
0 Kudos

Hi David,

You will still use the XPath condition or Context Object in your scenario. They are used to decide <b>where</b> to send your data (in your case data has obviously to be sent to both receivers!!!). The mapping then decides <b>which</b> data has to be sent (LA relevant data goes to LA, BO relevant data goes to BO).

So you should keep your receiver determination with the two receivers based on your context objects. But then you have to use two mappings. One filtering your LA data, the other looking for BO data. Hence:


       / Condition -> LA -> Mapping LA -> MsgLAIn
MsgOut 
        Condition -> BO -> Mapping BO -> MsgBOIn

Best regards

Joachim

Former Member
0 Kudos

Hi joachim orb,

thanks for continous effort.

as you told, i already tested as below;

/ Condition -> LA -> Mapping LA -> MsgLAInMsgOut \ Condition -> BO -> Mapping BO -> MsgBOIn

in message mapping in IR,

how do i filter data on each message mapping for each receivers?

i tried to use some object, such as equals, if, ifwithoutelse, but no success.

so could you explain how to filter data from MsgOut?

in my opinion, as you suggest, if it should be filterd by message mapping, we do not need to use context object.

just it will be working as well without context object.

thanks & regards

david.

Former Member
0 Kudos

Hi David,

Probably both key values are part of your message. Then your message is of course sent to both receivers. XI checks whether there is (at least) one entry that fulfills the defined condition. In your case both conditions return true and hence the message is sent to both receivers.

If you want to do a split based on the message content (parts of the message should be sent to system A and other parts to system B) then you should do this using mapping.

Best regards

Joachim

Former Member
0 Kudos

you mean, i have to use mapping to split? is it possible to split outbound data? records of LA, records of BO

i don't think so.

if so, what context object is for? and condition?

as result of testing, context object was not filtered by condition i define. all data goes.

please elaborate it, anybody has done such a this task?

thanks

david

Message was edited by: David

Former Member
0 Kudos

Hi David,

Are you sure, that your xml-instance at runtime corresponds to XPath definition? Please check the names of your elements and your namespace. They have to agree literally. Namely the usage of namespaces might be a source for a misconduct here.

Best regards

Joachim

Former Member
0 Kudos

as result of testing now, all of data(LA,BO)are inserted into both target system.

i do not know why condition is not working.

xPath definition, where can i check?

on sxmb_moni, i found some similar things

XP /p1:MaterialMaster01_Out/row/location</Trace>

<Trace level="2" type="T">......extracting values found: 6</Trace>

<Trace level="2" type="T">...valid Receiver with Condition: - A_SYSTEM</Trace>

<Trace level="2" type="T">Check conditions for rule line no. 2</Trace>

<Trace level="3" type="T">...call rule engine for Condition %CL_SAI_SWF_RULE_ENGINE.MSG_GET(MSG=&_MSG&;NSP=&_NSM&;XPATH="/p1:MaterialMaster01_Out/row/location")% CE LA and %CL_SAI_SWF_RULE_ENGINE.MSG_GET(MSG=&_MSG&;NSP=&_NSM&;XPATH="/p1:MaterialMaster01_Out/row/location")% CE BO</Trace>

<Trace level="2" type="T">......extracting (new) for Extractor: XP /p1:MaterialMaster01_Out/row/location</Trace>

<Trace level="2" type="T">......extracting values found: 6</Trace>

<Trace level="2" type="T">...valid Receiver with Condition: - B_SYSTEM</Trace>

<Trace level="2" type="T">No Receiver found behaviour:

Former Member
0 Kudos

Hello David,

Did you assign your context objects to your source messages?

Did you activate your changes in the Integration Repository?

Then you should be able select these Context Objects in the condition editor of the ID. First click on the value help of the condition editor and then on the value help of the left operand. Then your Context Objects should show up. For the right operand you can then define a constant value.

Best regards

Joachim

Former Member
0 Kudos

Hi,

in IR and ID, i assign my context object to receive determination in ID. in IR, i assigned it to ourtbound data type

but it seems to be not working,

here is my info;

Display Receiver Determination

-


configured Receivers

-


condition service

-


CO_Location = LA ASYSTEM

CO_Location = BO BSYSTEM

result of testing, all of data(LA,BO) inserted into one of two system(A,B)

I also test it such as CO_Location = "LA"

i would like to send data which is LA to ASYSTEM

and data which is BO to BSYSTEM

does anyone help me? please elaborate it

thank you in advance

David

Former Member
0 Kudos

Hi,

Did you go through this link, Not sure but thought of sharing with you

Regards,

Anirban.