cancel
Showing results for 
Search instead for 
Did you mean: 

Diff b/w removeContexts and collapseContexts

Former Member
0 Kudos

Hi All,

Can you give me the difference b/w removeContexts and collapseContexts with examples.

thanks in advance.

regards

ramu

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I would like to give you simple example for removeContext()

source structure(please note levels)

-->Header

-


>Item

-


>MatGroup

target structure

Header

-


>MatGroup

To produce MatGroup in target below level Header you will use mapping as

MatGroup->removeContext->MatGroup(Target)

This will remove the top level hierarchy of MatGroup from source and make you feel as MatGroup coming as child of root node..

collapseContext() is well explained by experts

Former Member
0 Kudos

Hi Ramu,

Remove context : It is important where we are using this std fuction im mapping

if you map the source field with remove context and map to an UDF , here the context changes will be removed and delete all the top contexts , so that all the target queue context will have one root and all elements without context change.

Collapse context :

Using collapseContexts() puts the first values of all contexts into a context. Empty contexts are replaced with an empty string:

in general we need to use this kind of function , when ever you want to send all the first values , first one as each individual .. to the target

also see the below links

http://help.sap.com/saphelp_nw04/helpdata/en/58/cd834014d26f1de10000000a1550b0/frameset.htm

Chilla

Former Member
0 Kudos

hi Ramu

Using collapseContexts() puts the first values of all contexts into a context. Empty contexts are replaced with an empty string

http://help.sap.com/saphelp_nw04/helpdata/en/58/cd834014d26f1de10000000a1550b0/content.htm

You use removeContexts() to delete all the top contexts for an element. This removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue

http://help.sap.com/saphelp_nw04/helpdata/en/9d/308c4024d26e1de10000000a1550b0/content.htm

for more details about Diff b/w removeContexts and collapseContexts

refer this Pdf

<b>SAP Exchange Infrastructure: Designing Mappings</b>

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d046c490-0201-0010-84b6-9df523cb...

check this Blog

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/frameset.htm

Thanks !!!

Questions are welcome here!!

<b>Also mark helpful answers by rewarding points </b>

Regards

Abhishek Agrahari

Message was edited by:

Abhishek Agrahari

Former Member
0 Kudos

Hi Ramu,

check here.. ur doubt will be clear....

Remove context with example...

http://help.sap.com/saphelp_nw04/helpdata/en/9d/308c4024d26e1de10000000a1550b0/content.htm

Collapse context with example...

http://help.sap.com/saphelp_nw04/helpdata/en/58/cd834014d26f1de10000000a1550b0/content.htm

Regards

BILL

<b>***Reward with points if it helps you</b>

Former Member
0 Kudos

Hi Ramu,

Check these blogs

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

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

Regards,

Sreenivas