cancel
Showing results for 
Search instead for 
Did you mean: 

Node functions

Former Member
0 Kudos

Hi Experts,

Can you please explain me in detail, a good example and a screen shot on remove contexts,splitbyvalue,collapsecontexts,useoneasmany,formatbyexample.I have read the sdn help but could not really understand as I am preety much new to this.

Thanks

Points will be awarded

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

you can have a look at the following links

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

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

Thanx

Aamir

Answers (6)

Answers (6)

Former Member
0 Kudos

hi,

.SplitByValue:

The SplitByValue() function is the counterpart to removeContexts(): Instead of deleting a context, you can insert a context change in the source value queue. You then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. You can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.

2.RemoveContexts:

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.

Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.

3.CreateIf:

CreateIf node function is used to create a node if true value is passed to it otherwise suppress it.

4.collapseContext

To remove the context in between the value and transfer only one value at a time

5.: useOneAsMany

First Input:

The value which is needed to be repeated.

Second Input:

It defines how many times the first input should be repeated.

Third Input:

It define when the context should be changed (on the basis of the required output

Please go through the given link hope it will be helpful to you.

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

http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm

Message Mapping Simplified – Part II

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

Replication of Nodes Using the Graphical Mapping Tool

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Message Splitting Using the Graphical Mapping Tool

/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool

Refer these links for more information on Node function:

http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb3...

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Check this weblog where claus have mentioned with examples:

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool

/people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool

Also check this weblogs:

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

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

Split by value -

http://help.sap.com/saphelp_nw04/helpdata/en/21/3bb8c495125e4eb5969f0377885fe0/content.htm

For value mapping check this video presentation and weblog:

/people/sreekanth.babu2/blog/2005/02/23/value-mapping-replication

/people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool

https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#xi [original link is broken]

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Function formatByExample:

/people/sundararamaprasad.subbaraman/blog/2006/02/21/real-example-for-formatbyexample

Split by value, remove context and collapse context:

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

Regards

former_member556603
Active Contributor
0 Kudos

Hi,

Good Document for Standard Functions general:

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

Go through this blogs:Message Mapping Simplified By : Sravya Talanki

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

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool

/people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool

Thanks,

Satya Kumar

Former Member
0 Kudos

Hi,

Please browse through the following links

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2171] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2792] [original link is broken] [original link is broken] [original link is broken];

Thanks,

Kiran.

sunil_singh13
Active Contributor
0 Kudos

Hi Guest,

removeContext:

We use remove context to remove the context of a queue

A ->removeContext-> A

B B

C C

here each line under an alphabet denotes context change.

One thing about context change is it will not show you null values coming in input.

A ->removeContext-> A

-- C

C

in above example -- represents only context change no value in this place(null).

Collapscontext :

It works very much same way of removecontext but it also considers null values and gives [] for null values (if Context of Field is on its Preceeding parent otherwice it will work as remove context)

A ->CollapsContext-> A

-- [] (Blank value)

C C

One more chane is if there are multiple values in a context then it will only select first value from that queue

A ->CollapsContext-> A

D B

B C

C

As you can see in above example A & D falls under one context hence D is Removed

Split ByValue :

Used to Chnage the Context of Input

it has three options in it

1)each value

2)value change

3)emptyValue

The link given by Rohit is Self Explanatry for this .

FormateByExample :

it changes the Context of input1 as per the Context of Second input but the number of values in both the input must be same .

eg.

Input1 Input2 ->FormateByExample-> Out

A P A

B Q B

C R C

As you can see Context of input1 is Changed as per input 2

Sorry Guest Seems To Be Some Problem With Formating

Give me you Email ID Will Send You in Proper Formate

Reward Points If Helpful

Thanks

Sunil Singh

Former Member
0 Kudos

Hey,

refer to this.

1. remove context:

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.

Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.

2. split by value:

The SplitByValue() function is the counterpart to removeContexts(): Instead of deleting a context, you can insert a context change in the source value queue. You then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. You can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.

3. collapse context:

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

This can be useful if an upper-level node is to be created each time a lower-level node exists, for example. The function is useful in combination with the SplitByValue function.

4. Use one as many

You require the function useOneAsMany() if a field that only occurs once needs to be replicated as often as another field occurs in the outbound message so that the fields can be written to the target structure in pairs as a record.

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

5. Map with default

6.copyValue

You use CopyValue() for a frequently occurring element to copy the value of a position in the source structure and assign it to a target field. The value is copied each time the target field occurs in the target structure. However, it is copied a maximum of maxOccurs times

7.createIf

You use createIf() to create a tag in the target structure depending on a condition.

8.exists

You use this function to determine whether a particular source field exists in the XML instance to be processed. If it does, exists() returns the value true, otherwise it returns the value false.

9.Use

You use this function if you need to synchronize two queues of equal length with reference to their context change. The mapping runtime takes the values from the first queue, and the context change from the second queue. If the two inbound queues do not have the same number of values, the mapping runtime triggers an exception.

Former Member
0 Kudos

Hi,

Refer the following link u will get clear idea about all these functions.

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Regards,

Rohit.

Reward points if helpful