cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Userdefined Functions

rajasekhar_reddy14
Active Contributor
0 Kudos

What is the Queue, Context in Advanced User Defined Functions ...

when we use CACHE in advanced user defined function...

regards,

raj

Edited by: Raja Sekhar Reddy T on May 30, 2008 3:58 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You do not use CACHE, the UDF has 3 possible types of Cache, i.e Value, Context, Queue.

Value makes the UDF a simple UDF, wherein u pass only a single value.

But there might be occasion when you want to pass the input as contexts, then you use context. So here you will be looping through each context.

When you want to pass the entire queue, you choose Queue. Here you will looping through the entire queue.

Answers (4)

Answers (4)

GabrielSagaya
Active Contributor
0 Kudos

Advanced useru2013functions can import either just one context or the

complete queue into input String arrays

A queue contains an entire XML instance of the source message

All the nodes and elements that belong to the same parent node are said to be in the same context

the nodes and elements that belong to different parent nodes have to be separated by a context change

Cache the whole queue=Selected:

==> all values of the whole queue are passed to the function

/people/venkat.donela/blog/2005/06/09/introduction-to-queues-in-message-mapping

/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

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

former_member556603
Active Contributor
0 Kudos

Hi,

There are 2 types of UDF - Simple and Advanced.

Simple UDFs uses Value, wherein we can manipulate only one value (input is one String). Therefore a single string is expected as input and the output would also b a single string.

Advanced UDFs uses Context or Queue, where you manipulate many values (input is an array of Strings).

User-Defined Functions

Use

If the standard functions for a target field mapping do not fulfill your requirements, or if the graphical representation becomes unclear due to the complexity of the mapping, you have the option of creating your own user-defined functions. You can create Java source text in this function. The function is included in the Java coding that is generated for the message mapping as a Java method.

Advanced User-Defined Functions

Use

Advanced user-defined functions can access more than just individual field values. Instead, you can import a complete context or an entire queue for a field as an array before your function is called. This enables you, for example, to perform calculations on all field values of a context as well as to divide up the contexts themselves further by inserting a context change.

Features

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.

Working with Contexts or Queues

Information in Cache

Implications

Context

Advanced functions that only import one context do not have an identifiable context change. You can of course insert a context change into the results list.

Queue

Since one or more entire queues are imported in this case, this option is more memory-intensive and is not suitable for very large messages.

The input arrays do not contain the context change at the start and end of the context (or of the queue). These context changes are implicitly always available and cannot be identified or deleted by the user-defined function.

For further reference go through these links..

http://help.sap.com/saphelp_nw04/helpdata/en/40/7b8e40496f6f1de10000000a1550b0/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm

Thanks,

Satya Kumar

Former Member
0 Kudos

hi

take this eg:

<Root>

<Mat>

<MatNo>10</MatNo>

</Mat>

<Mat>

<MatNo>20</MatNo>

</Mat>

<Mat>

<MatNo>30</MatNo>

</Mat>

<Mat>

<MatNo>40</MatNo>

</Mat>

</Root>

If you take the queue of <MatNo>

it will be 10||20||30||50

where || - is the content change means the parent node <Mat> is repeating

If you check 'Cache the complete Queue' - the content changes also can be manupulated in the AUDF...context change also will get added to the Q

rgds

Arun

Former Member
0 Kudos

Hi,

this indicated which values from your XML will be inserted into your funciton

either one - value

from one context only - context

or all - queue

check this page to understand

Working with Contexts or Queues

http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm

look into this link that explains about the same.

value ---> is a value for the input parameter. It may be a single value or multiple values.

Queue-----> it is an entire instance of XML message. That means, if you have duplicates of a node, all those contexts will be includedin Queue, which is passed to UDF.

Context -


> refers to a particular context of the XML message.

Please refer to the following document which comprehensively explain differences b/w the various options with examples

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

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

There r 2 types of UDF - Simple and Advanced- Simple UDFs uses Value, wherein we can manipulate only one value (input is one String). Therefore a single string is expected as input and the output would also b a single string.

Advanced UDFs uses Context or Queue, where you manipulate many values (input is an array of Strings).

This will help u

http://help.sap.com/saphelp_nw2004s/helpdata/en/40/7b8e40496f6f1de10000000a1550b0/content.htm

Thanks!!

Soumya