on 07-19-2007 6:10 AM
Hi
I'd read couple of doc's on collapse context but not much clear. Could anyone let me know why need collapse context.
I'd checked on help.sap. Pls no links.
thkx
Prabhu
thkx raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this
refer here /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
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
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhu..
Go through this its give along with an example..
http://help.sap.com/saphelp_nw70/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
vasanth
Hi
Below is only Difference between Remove Context and Collapse Context
XML File Input:
?xml version="1.0"
encoding="UTF-8" ?>
<Test_Out_Remove>
<header name=A">
<item>A.one</item>
<item>A.two</item>
<item>A.three</item>
</header>
<header name="B">
<item>B.one</item>
<item>B.two</item>
</header>
</Test_Out_Remove>
After Using Remove Context Output:
<?xml version="1.0"
encoding="UTF-8" ?>
<Test_In_Remove>
<item>A.one</item>
<item>A.two</item>
<item>A.three</item>
<item>B.one</item>
<item>B.two</item>
</Test_In_Remove
Cpllapse Context
xml instances ( pARSE ---> ) tAG
Item(1,2,3,4,5,6)
Using
↓Collapse Context
Tag (Result Tag and Item see side)
Item ( no values)
Above XML file after parser for Tag and Item number,After That Using Collapse Context It Gives The result like Tag as it is and Item as a Empty value.
Might be useful
Message was edited by:
sridhar bommireddy
Message was edited by:
sridhar bommireddy
Prabhu,
Consider my source structure looks like
<EmployerInfo>
---<Location>
-
<Region>Trichy</Region>
-
<Region>Bangalore</Region>
-
<Region>Madurai</Region>
---</Location>
</EmployerInfo>
<EmployerInfo>
---<Location>
-
<Region>Andhra</Region>
-
<Region>Delhi</Region>
-
<Region>Mumbai</Region>
---</Location>
</EmployerInfo>
In my target structure I want only the first region for each employerinfo.
So what happens if you give Region->CollapseContext->SplitByValue--->Region
Then u will get the target structure as
<EmployerOrg>
-
<Region>Trichy</Region>
</EmployerOrg>
<EmployerOrg>
-
<Region>Andhra</Region>
The purpose of CollapseContext is to take the first value from the queue in the same context level.
Trichy
Bangalore
Madurai
<b>[Context Change]</b>
Andhra
Delhi
Mumbai
Results after collapse context
Trichy
<b>[ContextChange]</b> ---Bcoz I gave SplitByValue.
Andhra
I hope it clears a bit!!!
Best regards,
raj.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.