Interface ResultElement

All Known Subinterfaces:
ResultCollection, ResultObject, ResultPrimitive
All Known Implementing Classes:
DefaultResultCollection, GsonResultObject, GsonResultPrimitive

public interface ResultElement
Class representing one resulting element from a call to an external service (e.g. after invoking a BAPI or a remote-enabled function module).

Note that accessing the result element varies depending on its structure:

  • If the result element represents an unstructured value (e.g. a String object), it is considered a ResultPrimitive.
    When dealing with BAPI or RFM request results, this occurs if the respective result element is reflected as a data element in the ABAP Data Dictionary.
  • If the result element represents a structured object (e.g. one complex business object), it is considered a ResultObject.
    When dealing with BAPI or RFM request results, this occurs if the respective result element is reflected as a structure in the ABAP Data Dictionary.
  • If the result element represents a collection of result elements (e.g. a list of complex business objects), it is considered a ResultCollection.
    When dealing with BAPI or RFM request results, this occurs if the respective result element is reflected as a table type in the ABAP Data Dictionary or is used as tables parameter in the interface of the BAPI or RFM.
Use the methods isResultPrimitive(), isResultObject(), or isResultCollection() to check for the respective case.

As accessing the content of the result element varies depending on its structure, use the methods getAsPrimitive(), getAsObject(), or getAsCollection() to access the result element content.

If the result element is considered a ResultPrimitive, its content can be accessed with the respective method directly, such as asString() to obtain the result element content as String object.