public class RfcQuery extends Query<QueryT,QueryResultT>
Use the class BapiQuery
to call BAPIs in an ERP system.
The signature of an RFM consists of importing, exporting, changing, and tables parameters.
From the perspective of the RFM caller, input data is considered as exporting, output data is considered as importing, tables, and changing parameters can be used for both directions. The methods of this class are named following the caller's perspective.
From the perspective of the RFM, importing means input data, exporting means output data, changing, and tables parameters can be used for both directions.
Example:
Calling a RFM with one importing parameter (from RFM perspective) requires to utilize the method
withExporting(String, String)
. Consider all existing variants of this method depending on the Java data type
of the parameter, e.g. use withExporting(String, String, String)
to pass a String object.
The data type (i.e. the data dictionary object) of importing and exporting parameters (regardless of the perspective) can either be a data element, a structure, or a table type.
withExporting(String, String)
and its data type dependent variants to supply an exporting RFM parameter
reflected by a data element.withExportingFields(String, String, Fields)
to supply an exporting RFM parameter reflected by a
structure.withExportingTable(String, String)
to supply an exporting RFM parameter reflected by a table type.
After calling execute(ErpEndpoint)
use the class RfcQueryResult
to access the results of the RFM
call (e.g. the exporting parameters from the RFM perspective respectively the importing parameters from the caller's
perspective).
Constructor and Description |
---|
RfcQuery(String functionName)
Constructs a remote function call query for which the result will be committed.
|
RfcQuery(String functionName,
boolean commit)
Constructs a remote function call query.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doCommit()
Deprecated.
This method will be removed in one of the next versions. Use
isPerformingTransactionalCommit() instead. |
boolean |
equals(Object o) |
RfcQueryResult |
execute(ErpEndpoint erpEndpoint)
Executes a given query against the given S/4HANA endpoint.
|
String |
getConstructedByMethod() |
Set<String> |
getExceptionNames() |
String |
getFunctionName() |
Collection<ErpTypeConverter<?>> |
getTypeConverters() |
int |
hashCode() |
boolean |
isPerformingTransactionalCommit() |
String |
toString() |
RfcQuery |
withChanging(String name,
String dataType)
Adds a changing parameter.
|
RfcQuery |
withChanging(String name,
String dataType,
BigDecimal value)
Adds a changing
BigDecimal parameter. |
RfcQuery |
withChanging(String name,
String dataType,
BigInteger value)
Adds a changing
BigInteger parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Boolean value)
Adds a changing
Boolean parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Byte value)
Adds a changing
Byte parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Character value)
Adds a changing
Character parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Double value)
Adds a changing
Double parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Float value)
Adds a changing
Float parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Integer value)
Adds a changing
Integer parameter. |
RfcQuery |
withChanging(String name,
String dataType,
org.joda.time.LocalDate value)
Adds a changing
LocalDate parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Locale value)
Adds a changing
Locale parameter. |
RfcQuery |
withChanging(String name,
String dataType,
org.joda.time.LocalTime value)
Adds a changing
LocalTime parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Long value)
Adds a changing
Long parameter. |
RfcQuery |
withChanging(String name,
String dataType,
Short value)
Adds a changing
Short parameter. |
RfcQuery |
withChanging(String name,
String dataType,
String value)
Adds a changing
String parameter. |
<T extends ErpType<T>> |
withChanging(String name,
String dataType,
T value)
Adds a changing parameter.
|
<T> RfcQuery |
withChanging(String name,
String dataType,
T value,
ErpTypeConverter<T> typeConverter)
Adds a changing parameter.
|
RfcQuery |
withChanging(String name,
String dataType,
Year value)
Adds a changing
Year parameter. |
ParameterFields<RfcQuery> |
withChangingFields(String name,
String dataType)
Adds a changing fields parameter for multiple values.
|
RfcQuery |
withChangingFields(String name,
String dataType,
Fields fields)
Adds a changing fields parameter for multiple values.
|
Table<RfcQuery> |
withChangingTable(String name,
String dataType)
Adds a changing table parameter.
|
RfcQuery |
withException(String name)
Declares an expected exception from calling a remote function module.
|
RfcQuery |
withExporting(String name,
String dataType)
Adds an exporting parameter reflected by a data element.
|
RfcQuery |
withExporting(String name,
String dataType,
BigDecimal value)
Adds an exporting
BigDecimal parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
BigInteger value)
Adds an exporting
BigInteger parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Boolean value)
Adds an exporting
Boolean parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Byte value)
Adds an exporting
Byte parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Character value)
Adds an exporting
Character parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Double value)
Adds an exporting
Double parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Float value)
Adds an exporting
Float parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Integer value)
Adds an exporting
Integer parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
org.joda.time.LocalDate value)
Adds an exporting
LocalDate parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Locale value)
Adds an exporting
Locale parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
org.joda.time.LocalTime value)
Adds an exporting
LocalTime parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Long value)
Adds an exporting
Long parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
Short value)
Adds an exporting
Short parameter reflected by a data element. |
RfcQuery |
withExporting(String name,
String dataType,
String value)
Adds an exporting
String parameter reflected by a data element. |
<T extends ErpType<T>> |
withExporting(String name,
String dataType,
T value)
Adds an exporting parameter reflected by a data element.
|
<T> RfcQuery |
withExporting(String name,
String dataType,
T value,
ErpTypeConverter<T> typeConverter)
Adds an exporting parameter reflected by a data element.
|
RfcQuery |
withExporting(String name,
String dataType,
Year value)
Adds an exporting
Year parameter. |
ParameterFields<RfcQuery> |
withExportingFields(String name,
String dataType)
Adds an exporting parameter reflected by a structure.
|
RfcQuery |
withExportingFields(String name,
String dataType,
Fields fields)
Adds an exporting parameter reflected by a structure.
|
Table<RfcQuery> |
withExportingTable(String name,
String dataType)
Adds an exporting parameter reflected by a table type.
|
RfcQuery |
withImporting(String name,
String dataType)
Adds an importing parameter reflected by a data element.
|
RfcQuery |
withImporting(String name,
String dataType,
BigDecimal value)
Adds a importing
BigDecimal parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
BigInteger value)
Adds a importing
BigInteger parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Boolean value)
Adds a importing
Boolean parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Byte value)
Adds a importing
Byte parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Character value)
Adds a importing
Character parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Double value)
Adds a importing
Double parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Float value)
Adds a importing
Float parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Integer value)
Adds a importing
Integer parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
org.joda.time.LocalDate value)
Adds a importing
LocalDate parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Locale value)
Adds a importing
Locale parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
org.joda.time.LocalTime value)
Adds a importing
LocalTime parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Long value)
Adds a importing
Long parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
Short value)
Adds a importing
Short parameter reflected by a data element. |
RfcQuery |
withImporting(String name,
String dataType,
String value)
Adds a importing
String parameter reflected by a data element. |
<T extends ErpType<T>> |
withImporting(String name,
String dataType,
T value)
Adds an importing parameter reflected by a data element.
|
<T> RfcQuery |
withImporting(String name,
String dataType,
T value,
ErpTypeConverter<T> typeConverter)
Adds an importing parameter reflected by a data element.
|
RfcQuery |
withImporting(String name,
String dataType,
Year value)
Adds a importing
Year parameter reflected by a data element. |
RfcQuery |
withImportingAsReturn(String dataType)
Adds an importing parameter as a return parameter with the name defined by
RETURN_PARAMETER . |
RfcQuery |
withImportingAsReturn(String name,
String dataType)
Adds an importing parameter as a return parameter.
|
ParameterFields<RfcQuery> |
withImportingFields(String name,
String dataType)
Adds an importing parameter reflected by a structure.
|
RfcQuery |
withImportingFields(String name,
String dataType,
Fields fields)
Adds an importing parameter reflected by a structure.
|
Table<RfcQuery> |
withImportingTable(String name,
String dataType)
Adds an importing parameter reflected by a table type.
|
Table<RfcQuery> |
withTable(String name,
String dataType)
Adds a table parameter.
|
RfcQuery |
withTableAsReturn(String dataType)
Adds a table parameter as a return parameter with the name defined by
RETURN_PARAMETER . |
RfcQuery |
withTableAsReturn(String name,
String dataType)
Adds a table parameter as a return parameter.
|
RfcQuery |
withTypeConverters(ErpTypeConverter<?>... typeConverters)
Delegates to
withTypeConverters(Iterable) . |
RfcQuery |
withTypeConverters(Iterable<ErpTypeConverter<?>> typeConverters)
Registers the given
ErpTypeConverter s. |
getLongRunningRequestThreshold, getReadAccessData, getRequestId, setLongRunningRequestThreshold
public RfcQuery(String functionName) throws IllegalArgumentException
functionName
- The name of the function to be called.IllegalArgumentException
- If the given function is a BAPI, i.e., its name starts with the prefix "BAPI".public RfcQuery(String functionName, boolean commit) throws IllegalArgumentException
functionName
- The name of the function to be called.commit
- Decides whether to commit the result of the function call.IllegalArgumentException
- If the given function is a BAPI, i.e., its name starts with the prefix "BAPI".public RfcQueryResult execute(ErpEndpoint erpEndpoint) throws QuerySerializationException, QueryExecutionException, DestinationNotFoundException, DestinationAccessException
Query
execute
in class Query<RfcQuery,RfcQueryResult>
QuerySerializationException
QueryExecutionException
DestinationNotFoundException
DestinationAccessException
public RfcQuery withTypeConverters(Iterable<ErpTypeConverter<?>> typeConverters)
ErpTypeConverter
s. Replaces existing converters for already existing types that have
been added before.public RfcQuery withTypeConverters(ErpTypeConverter<?>... typeConverters)
withTypeConverters(Iterable)
.public RfcQuery withExporting(String name, String dataType)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public <T extends ErpType<T>> RfcQuery withExporting(String name, String dataType, T value)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.public <T> RfcQuery withExporting(String name, String dataType, T value, ErpTypeConverter<T> typeConverter)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.typeConverter
- A type converter defining how to convert the type of the given value to its ERP representation.public RfcQuery withExporting(String name, String dataType, Boolean value)
Boolean
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Byte value)
Byte
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Character value)
Character
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, String value)
String
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Short value)
Short
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Integer value)
Integer
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Long value)
Long
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Float value)
Float
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Double value)
Double
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, BigInteger value)
BigInteger
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, BigDecimal value)
BigDecimal
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Locale value)
Locale
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, Year value)
Year
parameter. reflected by a data elementpublic RfcQuery withExporting(String name, String dataType, org.joda.time.LocalDate value)
LocalDate
parameter reflected by a data element.public RfcQuery withExporting(String name, String dataType, org.joda.time.LocalTime value)
LocalTime
parameter reflected by a data element.public ParameterFields<RfcQuery> withExportingFields(String name, String dataType)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withExportingFields(String name, String dataType, Fields fields)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.fields
- The exporting fields.public Table<RfcQuery> withExportingTable(String name, String dataType)
Note: Exporting refers to the point of view of the caller. Thus, when a parameter is declared as importing on ABAP side, you have to specify it as exporting here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withImporting(String name, String dataType)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public <T extends ErpType<T>> RfcQuery withImporting(String name, String dataType, T value)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.public <T> RfcQuery withImporting(String name, String dataType, T value, ErpTypeConverter<T> typeConverter)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.typeConverter
- A type converter defining how to convert the type of the given value to its ERP representation.public RfcQuery withImporting(String name, String dataType, Boolean value)
Boolean
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Byte value)
Byte
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Character value)
Character
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, String value)
String
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Short value)
Short
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Integer value)
Integer
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Long value)
Long
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Float value)
Float
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Double value)
Double
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, BigInteger value)
BigInteger
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, BigDecimal value)
BigDecimal
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Locale value)
Locale
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, Year value)
Year
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, org.joda.time.LocalDate value)
LocalDate
parameter reflected by a data element.public RfcQuery withImporting(String name, String dataType, org.joda.time.LocalTime value)
LocalTime
parameter reflected by a data element.public ParameterFields<RfcQuery> withImportingFields(String name, String dataType)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withImportingFields(String name, String dataType, Fields fields)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.fields
- The importing fields.public Table<RfcQuery> withImportingTable(String name, String dataType)
Note that importing is related to the point of view of the caller. Thus, when a parameter is declared as exporting on ABAP side, you have to specify it as importing here.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withImportingAsReturn(String dataType)
RETURN_PARAMETER
.
Note that return parameters refer to parameters for which return messages will be parsed and translated to
RemoteFunctionMessage
s.
dataType
- The ABAP data type of the parameter.public RfcQuery withImportingAsReturn(String name, String dataType)
Note that return parameters refer to parameters for which return messages will be parsed and translated to
RemoteFunctionMessage
s.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public Table<RfcQuery> withTable(String name, String dataType)
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withTableAsReturn(String dataType)
RETURN_PARAMETER
.
Note that return parameters refer to parameters for which return messages will be parsed and translated to
RemoteFunctionMessage
s.
dataType
- The ABAP data type of the parameter.public RfcQuery withTableAsReturn(String name, String dataType)
Note that return parameters refer to parameters for which return messages will be parsed and translated to
RemoteFunctionMessage
s.
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withChanging(String name, String dataType)
name
- The parameter name.dataType
- The ABAP data type of the parameter.public <T extends ErpType<T>> RfcQuery withChanging(String name, String dataType, T value)
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.public <T> RfcQuery withChanging(String name, String dataType, T value, ErpTypeConverter<T> typeConverter)
name
- The parameter name.dataType
- The ABAP data type of the parameter.value
- The value of the parameter.typeConverter
- A type converter defining how to convert the type of the given value to its ERP representation.public RfcQuery withChanging(String name, String dataType, Boolean value)
Boolean
parameter.public RfcQuery withChanging(String name, String dataType, Byte value)
Byte
parameter.public RfcQuery withChanging(String name, String dataType, Character value)
Character
parameter.public RfcQuery withChanging(String name, String dataType, String value)
String
parameter.public RfcQuery withChanging(String name, String dataType, Short value)
Short
parameter.public RfcQuery withChanging(String name, String dataType, Integer value)
Integer
parameter.public RfcQuery withChanging(String name, String dataType, Long value)
Long
parameter.public RfcQuery withChanging(String name, String dataType, Float value)
Float
parameter.public RfcQuery withChanging(String name, String dataType, Double value)
Double
parameter.public RfcQuery withChanging(String name, String dataType, BigInteger value)
BigInteger
parameter.public RfcQuery withChanging(String name, String dataType, BigDecimal value)
BigDecimal
parameter.public RfcQuery withChanging(String name, String dataType, Locale value)
Locale
parameter.public RfcQuery withChanging(String name, String dataType, Year value)
Year
parameter.public RfcQuery withChanging(String name, String dataType, org.joda.time.LocalDate value)
LocalDate
parameter.public RfcQuery withChanging(String name, String dataType, org.joda.time.LocalTime value)
LocalTime
parameter.public ParameterFields<RfcQuery> withChangingFields(String name, String dataType)
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withChangingFields(String name, String dataType, Fields fields)
name
- The parameter name.dataType
- The ABAP data type of the parameter.fields
- The changing fields.public Table<RfcQuery> withChangingTable(String name, String dataType)
name
- The parameter name.dataType
- The ABAP data type of the parameter.public RfcQuery withException(String name)
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") public int hashCode()
@Generated(value="lombok") public String toString()
@Generated(value="lombok") public Set<String> getExceptionNames()
public Collection<ErpTypeConverter<?>> getTypeConverters()
public String getFunctionName()
@Deprecated public boolean doCommit()
isPerformingTransactionalCommit()
instead.true
if a transactional commit will be performed after invoking the function, false
otherwise.public boolean isPerformingTransactionalCommit()
true
if a transactional commit will be performed after invoking the function, false
otherwise.@Generated(value="lombok") public String getConstructedByMethod()
getConstructedByMethod
in class Query<QueryT extends com.sap.cloud.sdk.s4hana.connectivity.rfc.AbstractRemoteFunctionQuery<QueryT,QueryResultT>,QueryResultT extends com.sap.cloud.sdk.s4hana.connectivity.rfc.AbstractRemoteFunctionQueryResult<QueryT,QueryResultT>>
Copyright © 2018 SAP SE. All rights reserved.