cancel
Showing results for 
Search instead for 
Did you mean: 

node functions in real time scenario

Former Member
0 Kudos

can any one tell me where node functions used in realtime explain with examples?

thanx&regards

naren

Accepted Solutions (1)

Accepted Solutions (1)

former_member537867
Active Contributor
0 Kudos

Hi Narendra,

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.

Please go through these links.

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

Message Mapping Simplified - Part I

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

Message Mapping Simplified – Part II

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

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb...

Message Splitting Using the Graphical Mapping Tool

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

Introduction to Context Handling in Message Mapping

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

Regards,

Vinod.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hey,

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.

Link for Node function.

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

Example:

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 Change 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 useful.

regards,

Milan

Former Member
0 Kudos

Hi,

We use Node functions for mapping purpose mainly.

Which mainly deals with mappings of XML structure involving complex hierarchy.

Go through these blogs and forums to have better idea:

Message Mapping

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

Replication of Nodes Using Graphical Mapping Tool

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

Message Splitting Using Graphical Mapping Tool

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

Go through this :

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

Former Member
0 Kudos

Hi,

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.

These blog links are really worth.. Node functions explained with proper examples.... give a try for implementing these examples ....

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

Introduction to Context Handling in Message Mapping

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

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

Thanks,

vijaya.

Former Member
0 Kudos

HI,

Node functions are used in Real time when the occurance of receiver fields is multiple and needed various complex logics to be added.

Just few days back it was discussed here

Please refer below link for Real time Example - step bye step

Check this weblog where claus have mentioned with examples:

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

/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

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]

check the following link for the node functions:

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

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

Thanks

Swarup

Edited by: Swarup Sawant on Jun 3, 2008 6:46 AM