Package com.sap.conn.jco
Interface JCoFunction
- All Superinterfaces:
Cloneable
,Serializable
Class that represents a function.
A function instance consists of a name, an import parameter list, a changing parameter list,
an export parameter list and a table parameter list.
Moreover, it can have a list of AbapExceptions.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this JCoFunction instance.void
execute
(JCoDestination destination) Executes the function on the given target destination synchronously.void
execute
(JCoDestination destination, String tid) Executes the function on the given target destination in transactional mode using the tRfc protocol.void
execute
(JCoDestination destination, String tid, String queueName) Executes the function on the given target destination in queued transactional mode using the qRfc protocol.Returns the list of changing parameters.getException
(String key) Returns the ABAP exception for the specified key.Returns the list of defined ABAP exceptions that can occur.Returns the list of export parameters.Returns the function template, i.e.Returns the list import parameters.getName()
Returns the function name.Returns the list of table parameters.boolean
Returns the boolean value that indicates whether or not the server is permitted to transmit an ABAP class exception when executing this function.void
Sets the mode for ABAP class exceptions.toXML()
Returns the function as an XML string.
-
Method Details
-
clone
JCoFunction clone()Clones this JCoFunction instance.- Returns:
- a clone of this instance
- Since:
- JCo 3.0.14
-
getName
String getName()Returns the function name.- Returns:
- the name of the function
-
getImportParameterList
JCoParameterList getImportParameterList()Returns the list import parameters.- Returns:
- the import parameters or null if the function does not have any import parameters
-
getExportParameterList
JCoParameterList getExportParameterList()Returns the list of export parameters.- Returns:
- the export parameters or null if the function does not have any export parameters
-
getChangingParameterList
JCoParameterList getChangingParameterList()Returns the list of changing parameters.- Returns:
- the changing parameters or null if the function does not have any changing parameters
-
getTableParameterList
JCoParameterList getTableParameterList()Returns the list of table parameters.- Returns:
- the table parameters or null if the function does not have any table parameters
-
getExceptionList
AbapException[] getExceptionList()Returns the list of defined ABAP exceptions that can occur.- Returns:
- the list of exceptions or null if the function does not have any defined ABAP runtime exceptions
-
getException
Returns the ABAP exception for the specified key.- Parameters:
key
- ABAP's error key- Returns:
- the ABAP exception for the specified key or null if not defined
-
setAbapClassExceptionMode
Sets the mode for ABAP class exceptions. Enabling means that the ABAP server is permitted to transmit an ABAP class exception, whereas disabling signifies that the server must not transmit such an exception.- Parameters:
mode
- the value determining whether ABAP class exceptions are permitted (full or limited to the exception chain) or not
-
isAbapClassExceptionEnabled
boolean isAbapClassExceptionEnabled()Returns the boolean value that indicates whether or not the server is permitted to transmit an ABAP class exception when executing this function.- Returns:
true
orfalse
depending on whether transmitting ABAP class exceptions is permitted or not, respectively
-
execute
Executes the function on the given target destination synchronously.- Parameters:
destination
- the destination on which the function module should be executed- Throws:
JCoException
- if an exception occurred during the call execution
-
execute
Executes the function on the given target destination in transactional mode using the tRfc protocol.- Parameters:
destination
- the destination on which the function module should be executedtid
- the transaction ID to use for the tRFC call- Throws:
JCoException
- if an exception occurred during the call execution
-
execute
Executes the function on the given target destination in queued transactional mode using the qRfc protocol.- Parameters:
destination
- the destination on which the function module should be executedtid
- the transaction ID to use for the qRFC callqueueName
- the inbound queue to use for the qRFC call- Throws:
JCoException
- if an exception occurred during the call execution
-
toXML
String toXML()Returns the function as an XML string. Its format is depending on the used interface implementation, and is not guaranteed to remain stable. This method is meant to be used as a more powerful toString() variant, which allows to view the function within XML viewing tools thus making it easier to have a closer look at single parameter values.
Please note, that only an XML fragment is returned, which does not include an XML header.- Returns:
- the function serialized in XML format
-
getFunctionTemplate
JCoFunctionTemplate getFunctionTemplate()Returns the function template, i.e. the description of the function and its parameters, which was used to create this function instance.- Returns:
- the function template
-