Skip to content

/AWS1/IF_LOC=>GETGEOFENCE()

About GetGeofence

Retrieves the geofence details from a geofence collection.

The returned geometry will always match the geometry format used when the geofence was created.

Method Signature

METHODS /AWS1/IF_LOC~GETGEOFENCE
  IMPORTING
    !IV_COLLECTIONNAME TYPE /AWS1/LOCRESOURCENAME OPTIONAL
    !IV_GEOFENCEID TYPE /AWS1/LOCID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_locgetgeofencersp
  RAISING
    /AWS1/CX_LOCACCESSDENIEDEX
    /AWS1/CX_LOCINTERNALSERVEREX
    /AWS1/CX_LOCRESOURCENOTFOUNDEX
    /AWS1/CX_LOCTHROTTLINGEX
    /AWS1/CX_LOCVALIDATIONEX
    /AWS1/CX_LOCCLIENTEXC
    /AWS1/CX_LOCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_collectionname TYPE /AWS1/LOCRESOURCENAME /AWS1/LOCRESOURCENAME

The geofence collection storing the target geofence.

iv_geofenceid TYPE /AWS1/LOCID /AWS1/LOCID

The geofence you're retrieving details for.

RETURNING

oo_output TYPE REF TO /aws1/cl_locgetgeofencersp /AWS1/CL_LOCGETGEOFENCERSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->getgeofence(
  iv_collectionname = |string|
  iv_geofenceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_id = lo_result->get_geofenceid( ).
  lo_geofencegeometry = lo_result->get_geometry( ).
  IF lo_geofencegeometry IS NOT INITIAL.
    LOOP AT lo_geofencegeometry->get_polygon( ) into lt_row.
      LOOP AT lt_row into lt_row_1.
        LOOP AT lt_row_1 into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_double = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDLOOP.
    lo_circle = lo_geofencegeometry->get_circle( ).
    IF lo_circle IS NOT INITIAL.
      LOOP AT lo_circle->get_center( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_double = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_sensitivedouble = lo_circle->get_radius( ).
    ENDIF.
    lv_base64encodedgeobuf = lo_geofencegeometry->get_geobuf( ).
    LOOP AT lo_geofencegeometry->get_multipolygon( ) into lt_row_4.
      LOOP AT lt_row_4 into lt_row.
        LOOP AT lt_row into lt_row_1.
          LOOP AT lt_row_1 into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_double = lo_row_3->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDLOOP.
      ENDLOOP.
    ENDLOOP.
  ENDIF.
  lv_string = lo_result->get_status( ).
  lv_timestamp = lo_result->get_createtime( ).
  lv_timestamp = lo_result->get_updatetime( ).
  LOOP AT lo_result->get_geofenceproperties( ) into ls_row_5.
    lv_key = ls_row_5-key.
    lo_value = ls_row_5-value.
    IF lo_value IS NOT INITIAL.
      lv_string = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.