Skip to content

/AWS1/IF_CUS=>PUTSEGMENTSUBSCRIPTION()

About PutSegmentSubscription

Creates or updates a segment subscription for membership events. When a subscription is created, an initial snapshot is taken and the system begins monitoring for membership changes.

You can optionally set a schedule configuration interval to control how often membership snapshots are run. The interval can be from 1 to 24 hours. If not set, the interval defaults to 24 hours. Scheduled snapshots run on a best-effort basis. If a scheduled snapshot takes longer than the configured interval, the next scheduled run does not start until the in-progress snapshot completes, so a run might be delayed or skipped and is not guaranteed to occur at exactly the requested time.

For Classic segments, membership events are generated from these scheduled snapshots and also in near real-time as profile attribute changes occur. For SQL segments, membership events are generated only from the scheduled snapshots.

Method Signature

METHODS /AWS1/IF_CUS~PUTSEGMENTSUBSCRIPTION
  IMPORTING
    !IV_DOMAINNAME TYPE /AWS1/CUSNAME OPTIONAL
    !IV_SEGMENTDEFINITIONNAME TYPE /AWS1/CUSNAME OPTIONAL
    !IO_SCHEDULECONFIGURATION TYPE REF TO /AWS1/CL_CUSSCHEDULECONF OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cusputsegsubscrrsp
  RAISING
    /AWS1/CX_CUSACCESSDENIEDEX
    /AWS1/CX_CUSBADREQUESTEX
    /AWS1/CX_CUSINTERNALSERVEREX
    /AWS1/CX_CUSRESOURCENOTFOUNDEX
    /AWS1/CX_CUSTHROTTLINGEX
    /AWS1/CX_CUSCLIENTEXC
    /AWS1/CX_CUSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_domainname TYPE /AWS1/CUSNAME /AWS1/CUSNAME

The unique name of the domain.

iv_segmentdefinitionname TYPE /AWS1/CUSNAME /AWS1/CUSNAME

The unique name of the segment definition.

Optional arguments:

io_scheduleconfiguration TYPE REF TO /AWS1/CL_CUSSCHEDULECONF /AWS1/CL_CUSSCHEDULECONF

The optional schedule configuration that controls how often membership snapshots are run. If not provided, the subscription defaults to a 24-hour interval.

RETURNING

oo_output TYPE REF TO /aws1/cl_cusputsegsubscrrsp /AWS1/CL_CUSPUTSEGSUBSCRRSP

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->putsegmentsubscription(
  io_scheduleconfiguration = new /aws1/cl_cusscheduleconf(
    iv_interval = 123
    iv_unit = |string|
  )
  iv_domainname = |string|
  iv_segmentdefinitionname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_segmentsubscriptionstat = lo_result->get_status( ).
  lo_scheduleconfiguration = lo_result->get_scheduleconfiguration( ).
  IF lo_scheduleconfiguration IS NOT INITIAL.
    lv_intervalvalue = lo_scheduleconfiguration->get_interval( ).
    lv_scheduleconfigurationun = lo_scheduleconfiguration->get_unit( ).
  ENDIF.
  lv_timestamp = lo_result->get_startedat( ).
ENDIF.