Skip to content

/AWS1/IF_CN2=>LISTCAMPAIGNS()

About ListCampaigns

Provides summary information about the campaigns under the specified Amazon Connect account.

Method Signature

METHODS /AWS1/IF_CN2~LISTCAMPAIGNS
  IMPORTING
    !IV_MAXRESULTS TYPE /AWS1/CN2MAXRESULTS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/CN2NEXTTOKEN OPTIONAL
    !IO_FILTERS TYPE REF TO /AWS1/CL_CN2CAMPAIGNFILTERS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cn2listcampaignsrsp
  RAISING
    /AWS1/CX_CN2ACCESSDENIEDEX
    /AWS1/CX_CN2INTERNALSERVEREX
    /AWS1/CX_CN2VALIDATIONEX
    /AWS1/CX_CN2CLIENTEXC
    /AWS1/CX_CN2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_maxresults TYPE /AWS1/CN2MAXRESULTS /AWS1/CN2MAXRESULTS

The maximum number of results to return per page.

iv_nexttoken TYPE /AWS1/CN2NEXTTOKEN /AWS1/CN2NEXTTOKEN

The token for the next set of results.

io_filters TYPE REF TO /AWS1/CL_CN2CAMPAIGNFILTERS /AWS1/CL_CN2CAMPAIGNFILTERS

Filter model by type

RETURNING

oo_output TYPE REF TO /aws1/cl_cn2listcampaignsrsp /AWS1/CL_CN2LISTCAMPAIGNSRSP

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->listcampaigns(
  io_filters = new /aws1/cl_cn2campaignfilters(
    io_instanceidfilter = new /aws1/cl_cn2instanceidfilter(
      iv_operator = |string|
      iv_value = |string|
    )
  )
  iv_maxresults = 123
  iv_nexttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_nexttoken = lo_result->get_nexttoken( ).
  LOOP AT lo_result->get_campaignsummarylist( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_campaignid = lo_row_1->get_id( ).
      lv_campaignarn = lo_row_1->get_arn( ).
      lv_campaignname = lo_row_1->get_name( ).
      lv_instanceid = lo_row_1->get_connectinstanceid( ).
      LOOP AT lo_row_1->get_channelsubtypes( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_channelsubtype = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_externalcampaigntype = lo_row_1->get_type( ).
      lo_schedule = lo_row_1->get_schedule( ).
      IF lo_schedule IS NOT INITIAL.
        lv_timestamp = lo_schedule->get_starttime( ).
        lv_timestamp = lo_schedule->get_endtime( ).
        lv_iso8601duration = lo_schedule->get_refreshfrequency( ).
      ENDIF.
      lo_entrylimitsconfig = lo_row_1->get_entrylimitsconfig( ).
      IF lo_entrylimitsconfig IS NOT INITIAL.
        lv_integer = lo_entrylimitsconfig->get_maxentrycount( ).
        lv_iso8601duration = lo_entrylimitsconfig->get_minentryinterval( ).
      ENDIF.
      lv_arn = lo_row_1->get_connectcampaignflowarn( ).
    ENDIF.
  ENDLOOP.
ENDIF.