Skip to content

/AWS1/CL_DYN=>UPDATEGLOBALTABLE()

About UpdateGlobalTable

Adds or removes replicas in the specified global table. The global table must already exist to be able to use this operation. Any replica to be added must be empty, have the same name as the global table, have the same key schema, have DynamoDB Streams enabled, and have the same provisioned and maximum write capacity units.

This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global tables. Customers should use Global Tables version 2019.11.21 (Current) when possible, because it provides greater flexibility, higher efficiency, and consumes less write capacity than 2017.11.29 (Legacy).

To determine which version you're using, see Determining the global table version you are using. To update existing global tables from version 2017.11.29 (Legacy) to version 2019.11.21 (Current), see Upgrading global tables.

If you are using global tables Version 2019.11.21 (Current) you can use UpdateTable instead.

Although you can use UpdateGlobalTable to add replicas and remove replicas in a single request, for simplicity we recommend that you issue separate requests for adding or removing replicas.

If global secondary indexes are specified, then the following conditions must also be met:

  • The global secondary indexes must have the same name.

  • The global secondary indexes must have the same hash key and sort key (if present).

  • The global secondary indexes must have the same provisioned and maximum write capacity units.

Method Signature

IMPORTING

Required arguments:

iv_globaltablename TYPE /AWS1/DYNTABLENAME /AWS1/DYNTABLENAME

The global table name.

it_replicaupdates TYPE /AWS1/CL_DYNREPLICAUPDATE=>TT_REPLICAUPDATELIST TT_REPLICAUPDATELIST

A list of Regions that should be added or removed from the global table.

RETURNING

oo_output TYPE REF TO /aws1/cl_dynupdglbtableoutput /AWS1/CL_DYNUPDGLBTABLEOUTPUT

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->/aws1/if_dyn~updateglobaltable(
  it_replicaupdates = VALUE /aws1/cl_dynreplicaupdate=>tt_replicaupdatelist(
    (
      new /aws1/cl_dynreplicaupdate(
        io_create = new /aws1/cl_dyncreaterplaction( |string| )
        io_delete = new /aws1/cl_dyndeleterplaction( |string| )
      )
    )
  )
  iv_globaltablename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_globaltabledescription = lo_result->get_globaltabledescription( ).
  IF lo_globaltabledescription IS NOT INITIAL.
    LOOP AT lo_globaltabledescription->get_replicationgroup( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_regionname = lo_row_1->get_regionname( ).
        lv_replicastatus = lo_row_1->get_replicastatus( ).
        lv_replicastatusdescriptio = lo_row_1->get_replicastatusdescription( ).
        lv_replicastatuspercentpro = lo_row_1->get_rplstatuspercentprgss( ).
        lv_kmsmasterkeyid = lo_row_1->get_kmsmasterkeyid( ).
        lo_provisionedthroughputov = lo_row_1->get_provthroughputoverride( ).
        IF lo_provisionedthroughputov IS NOT INITIAL.
          lv_positivelongobject = lo_provisionedthroughputov->get_readcapacityunits( ).
        ENDIF.
        lo_ondemandthroughputoverr = lo_row_1->get_ondemandthruputoverride( ).
        IF lo_ondemandthroughputoverr IS NOT INITIAL.
          lv_longobject = lo_ondemandthroughputoverr->get_maxreadrequestunits( ).
        ENDIF.
        lo_tablewarmthroughputdesc = lo_row_1->get_warmthroughput( ).
        IF lo_tablewarmthroughputdesc IS NOT INITIAL.
          lv_positivelongobject = lo_tablewarmthroughputdesc->get_readunitspersecond( ).
          lv_positivelongobject = lo_tablewarmthroughputdesc->get_writeunitspersecond( ).
          lv_tablestatus = lo_tablewarmthroughputdesc->get_status( ).
        ENDIF.
        LOOP AT lo_row_1->get_globalsecondaryindexes( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_indexname = lo_row_3->get_indexname( ).
            lo_provisionedthroughputov = lo_row_3->get_provthroughputoverride( ).
            IF lo_provisionedthroughputov IS NOT INITIAL.
              lv_positivelongobject = lo_provisionedthroughputov->get_readcapacityunits( ).
            ENDIF.
            lo_ondemandthroughputoverr = lo_row_3->get_ondemandthruputoverride( ).
            IF lo_ondemandthroughputoverr IS NOT INITIAL.
              lv_longobject = lo_ondemandthroughputoverr->get_maxreadrequestunits( ).
            ENDIF.
            lo_globalsecondaryindexwar = lo_row_3->get_warmthroughput( ).
            IF lo_globalsecondaryindexwar IS NOT INITIAL.
              lv_positivelongobject = lo_globalsecondaryindexwar->get_readunitspersecond( ).
              lv_positivelongobject = lo_globalsecondaryindexwar->get_writeunitspersecond( ).
              lv_indexstatus = lo_globalsecondaryindexwar->get_status( ).
            ENDIF.
          ENDIF.
        ENDLOOP.
        lv_date = lo_row_1->get_rplinaccessibledatetime( ).
        lo_tableclasssummary = lo_row_1->get_replicatableclasssummary( ).
        IF lo_tableclasssummary IS NOT INITIAL.
          lv_tableclass = lo_tableclasssummary->get_tableclass( ).
          lv_date = lo_tableclasssummary->get_lastupdatedatetime( ).
        ENDIF.
      ENDIF.
    ENDLOOP.
    lv_globaltablearnstring = lo_globaltabledescription->get_globaltablearn( ).
    lv_date = lo_globaltabledescription->get_creationdatetime( ).
    lv_globaltablestatus = lo_globaltabledescription->get_globaltablestatus( ).
    lv_tablename = lo_globaltabledescription->get_globaltablename( ).
  ENDIF.
ENDIF.