Skip to content

/AWS1/IF_BDC=>BATCHUPDATEMEMORYRECORDS()

About BatchUpdateMemoryRecords

Updates multiple memory records with custom content in a single batch operation within the specified memory.

Method Signature

METHODS /AWS1/IF_BDC~BATCHUPDATEMEMORYRECORDS
  IMPORTING
    !IV_MEMORYID TYPE /AWS1/BDCMEMORYID OPTIONAL
    !IT_RECORDS TYPE /AWS1/CL_BDCMEMRECUPDATEINPUT=>TT_MEMORYRECSUPDATEINPUTLIST OPTIONAL
    !IO_RECORDEXPIRYSPECIFICATION TYPE REF TO /AWS1/CL_BDCRECORDEXPIRYSPEC OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdcbatchupdmemrecsout
  RAISING
    /AWS1/CX_BDCACCESSDENIEDEX
    /AWS1/CX_BDCRESOURCENOTFOUNDEX
    /AWS1/CX_BDCSERVICEEXCEPTION
    /AWS1/CX_BDCSERVICEQUOTAEXCDEX
    /AWS1/CX_BDCTHROTTLEDEXCEPTION
    /AWS1/CX_BDCVALIDATIONEX
    /AWS1/CX_BDCCLIENTEXC
    /AWS1/CX_BDCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_memoryid TYPE /AWS1/BDCMEMORYID /AWS1/BDCMEMORYID

The unique ID of the memory resource where records will be updated.

it_records TYPE /AWS1/CL_BDCMEMRECUPDATEINPUT=>TT_MEMORYRECSUPDATEINPUTLIST TT_MEMORYRECSUPDATEINPUTLIST

A list of memory record update inputs to be processed in the batch operation.

Optional arguments:

io_recordexpiryspecification TYPE REF TO /AWS1/CL_BDCRECORDEXPIRYSPEC /AWS1/CL_BDCRECORDEXPIRYSPEC

The record expiry (long-term memory time-to-live) applied to every record updated by this request. Set recordExpiryDurationDays to configure or overwrite the number of days after which the records expire, or set action to REMOVE to clear a previously configured expiry so that the records no longer expire.

When you do not provide this value, the service determines each record's expiry from its current state:

  • If the record already has an expiry configured, the service resets and reapplies the expiry based on the last applied recordExpiryDurationDays.

  • If the record does not have an expiry configured, no expiry is applied and the record remains non-expiring. This is the outcome regardless of whether the record's strategy configures an expiry.

Providing an explicit recordExpiryDurationDays always takes precedence: it overwrites an existing expiry, or sets one on a record that previously had none.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdcbatchupdmemrecsout /AWS1/CL_BDCBATCHUPDMEMRECSOUT

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->batchupdatememoryrecords(
  io_recordexpiryspecification = new /aws1/cl_bdcrecordexpiryspec(
    iv_action = |string|
    iv_recordexpirydurationdays = 123
  )
  it_records = VALUE /aws1/cl_bdcmemrecupdateinput=>tt_memoryrecsupdateinputlist(
    (
      new /aws1/cl_bdcmemrecupdateinput(
        io_content = new /aws1/cl_bdcmemorycontent( |string| )
        it_metadata = VALUE /aws1/cl_bdcmemrecordmetvalue=>tt_memoryrecordmetadatamap(
          (
            VALUE /aws1/cl_bdcmemrecordmetvalue=>ts_memoryrecordmetmap_maprow(
              key = |string|
              value = new /aws1/cl_bdcmemrecordmetvalue(
                it_stringlistvalue = VALUE /aws1/cl_bdcstringvaluelist_w=>tt_stringvaluelist(
                  ( new /aws1/cl_bdcstringvaluelist_w( |string| ) )
                )
                iv_datetimevalue = '20150101000000.0000000'
                iv_numbervalue = '0.1'
                iv_stringvalue = |string|
              )
            )
          )
        )
        it_namespaces = VALUE /aws1/cl_bdcnamespaceslist_w=>tt_namespaceslist(
          ( new /aws1/cl_bdcnamespaceslist_w( |string| ) )
        )
        it_sourcenamespaces = VALUE /aws1/cl_bdcnamespaceslist_w=>tt_namespaceslist(
          ( new /aws1/cl_bdcnamespaceslist_w( |string| ) )
        )
        iv_memoryrecordid = |string|
        iv_memorystrategyid = |string|
        iv_timestamp = '20150101000000.0000000'
      )
    )
  )
  iv_memoryid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_successfulrecords( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_memoryrecordid = lo_row_1->get_memoryrecordid( ).
      lv_memoryrecordstatus = lo_row_1->get_status( ).
      lv_requestidentifier = lo_row_1->get_requestidentifier( ).
      lv_integer = lo_row_1->get_errorcode( ).
      lv_string = lo_row_1->get_errormessage( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_failedrecords( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_memoryrecordid = lo_row_1->get_memoryrecordid( ).
      lv_memoryrecordstatus = lo_row_1->get_status( ).
      lv_requestidentifier = lo_row_1->get_requestidentifier( ).
      lv_integer = lo_row_1->get_errorcode( ).
      lv_string = lo_row_1->get_errormessage( ).
    ENDIF.
  ENDLOOP.
ENDIF.