Skip to Content
avatar image
Former Member

Context Objects

When do we use Context Objects ?

Please give some example.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Feb 12, 2008 at 11:22 AM

    hi,

    Context objects are a simple alternative to XPath expressions for accessing the contents of a message.

    It is used for condition based routing. You create a context object in IR and assign it to a interface in IR. You can use the same in ID in receiver agreement(condition) to check the value at run time... Based on the value you can decide the receiver at run time..

    If XPATH is complex that it cannot be referred to easily in the design / config time, it is easier to encapsulate the path of the data in a Context Object and then use this Context Object to refer to the entire XPATH.

    Please refer below link for example

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm

    context object in xpath under reciver determination

    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object

    Thanks

    Swarup

    Edited by: Swarup Sawant on Feb 12, 2008 12:24 PM

    Edited by: Swarup Sawant on Feb 12, 2008 12:24 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2008 at 11:26 AM

    Hi Check this

    context object -

    Context objects are a simple alternative to XPath expressions for accessing the contents of a message. Take the following message instance as an example:

    <InvoiceOut>

    <customerData>

    <address>

    <name> ... </name>

    <postalCode> ...</postalCode>

    ...

    </address>

    ...

    </customerData>

    </InvoiceOut>

    To access the content of the <postalCode> field, you would use the following expression in XPath:

    /InvoiceOut/customerData/address/postalCode

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/content.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/content.htm

    Please have a look at the below blog

    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

    Regards

    Abhishek

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2008 at 11:32 AM

    Hi,

    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

    /people/riyaz.sayyad/blog/2006/04/23/introduction-to-context-handling-in-message-mapping

    /people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi

    I think it will be helpfull to U.

    Regards,

    Sharanya.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2008 at 11:34 AM

    Hi,

    We will use Context Obj. or X-paths when ever you want to place a condition on a particular field in the Source file

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm

    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object

    context-objects

    Receiver Det- Xpath:

    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

    XPATH in Interfce Det:

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

    Regards

    Seshagiri

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2008 at 12:02 PM

    Hi,

    The Context Object we can use insted of Xpath. For your better under stand i can give you an example.

    Suppose have to send a message with ClientID

    <Record>

    <Client>100</Client>

    <Name>xxxx</Name>

    </Record>

    <Record>

    <Client>200</Client>

    <Name>yyyy</Name>

    </Record>

    If you create a context object to the <Client> then you can set the condition at Receiver Determination level. If <Client> 100 then the message goes to client 100. If <Client> 200 then the message goes to client 200.

    Thanks,

    Satish.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2008 at 12:15 PM

    Hi,

    If u have multiple receiver system then to determine the reciever u can use context object.....

    the alternative of context objetc is X-Path...

    Check out these

    http://help.sap.com/saphelp_nw2004s/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/content.htm

    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object

    Here is a scenario where context objects were used for BPM

    Technical Context Object in ccBPM

    Get the details here:

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm

    Technical Context Objects :

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm

    A list of the Technical Context Objects names can be found here:

    http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/content.htm

    Difference between context object and x-path:

    diff-between-context-object-and-x-path

    Thanqx

    Biplab

    Add comment
    10|10000 characters needed characters exceeded