Skip to content

/AWS1/IF_BDC=>CREATEABTEST()

About CreateABTest

Creates an A/B test for comparing agent configurations. A/B tests split traffic between a control variant and a treatment variant through a gateway, then evaluate performance using online evaluation configurations to determine which variant performs better.

Method Signature

METHODS /AWS1/IF_BDC~CREATEABTEST
  IMPORTING
    !IV_NAME TYPE /AWS1/BDCABTESTNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/BDCABTESTDESCRIPTION OPTIONAL
    !IV_GATEWAYARN TYPE /AWS1/BDCGATEWAYARN OPTIONAL
    !IT_VARIANTS TYPE /AWS1/CL_BDCVARIANT=>TT_VARIANTLIST OPTIONAL
    !IO_GATEWAYFILTER TYPE REF TO /AWS1/CL_BDCGATEWAYFILTER OPTIONAL
    !IO_EVALUATIONCONFIG TYPE REF TO /AWS1/CL_BDCABTESTEVALCONFIG OPTIONAL
    !IV_ROLEARN TYPE /AWS1/BDCROLEARN OPTIONAL
    !IV_ENABLEONCREATE TYPE /AWS1/BDCBOOLEAN OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/BDCCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdccreateabtestrsp
  RAISING
    /AWS1/CX_BDCACCESSDENIEDEX
    /AWS1/CX_BDCCONFLICTEXCEPTION
    /AWS1/CX_BDCINTERNALSERVEREX
    /AWS1/CX_BDCSERVICEQUOTAEXCDEX
    /AWS1/CX_BDCTHROTTLINGEX
    /AWS1/CX_BDCUNAUTHORIZEDEX
    /AWS1/CX_BDCVALIDATIONEX
    /AWS1/CX_BDCCLIENTEXC
    /AWS1/CX_BDCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/BDCABTESTNAME /AWS1/BDCABTESTNAME

The name of the A/B test. Must be unique within your account.

iv_gatewayarn TYPE /AWS1/BDCGATEWAYARN /AWS1/BDCGATEWAYARN

The Amazon Resource Name (ARN) of the gateway to use for traffic splitting.

it_variants TYPE /AWS1/CL_BDCVARIANT=>TT_VARIANTLIST TT_VARIANTLIST

The list of variants for the A/B test. Must contain exactly two variants: a control (C) and a treatment (T1), each with a configuration bundle or target reference and a traffic weight.

io_evaluationconfig TYPE REF TO /AWS1/CL_BDCABTESTEVALCONFIG /AWS1/CL_BDCABTESTEVALCONFIG

The evaluation configuration specifying which online evaluation configurations to use for measuring variant performance.

iv_rolearn TYPE /AWS1/BDCROLEARN /AWS1/BDCROLEARN

The IAM role ARN that grants permissions for the A/B test to access gateway and evaluation resources.

Optional arguments:

iv_description TYPE /AWS1/BDCABTESTDESCRIPTION /AWS1/BDCABTESTDESCRIPTION

The description of the A/B test.

io_gatewayfilter TYPE REF TO /AWS1/CL_BDCGATEWAYFILTER /AWS1/CL_BDCGATEWAYFILTER

Optional filter to restrict which gateway target paths are included in the A/B test.

iv_enableoncreate TYPE /AWS1/BDCBOOLEAN /AWS1/BDCBOOLEAN

Whether to enable the A/B test immediately upon creation. If true, traffic splitting begins automatically.

iv_clienttoken TYPE /AWS1/BDCCLIENTTOKEN /AWS1/BDCCLIENTTOKEN

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdccreateabtestrsp /AWS1/CL_BDCCREATEABTESTRSP

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->createabtest(
  io_evaluationconfig = new /aws1/cl_bdcabtestevalconfig(
    it_pervarntonlineevalconfig = VALUE /aws1/cl_bdcpervaronlineeval00=>tt_pervarntonlineevalcfglist(
      (
        new /aws1/cl_bdcpervaronlineeval00(
          iv_name = |string|
          iv_onlineevaluationconfigarn = |string|
        )
      )
    )
    iv_onlineevaluationconfigarn = |string|
  )
  io_gatewayfilter = new /aws1/cl_bdcgatewayfilter(
    it_targetpaths = VALUE /aws1/cl_bdctargetpathlist_w=>tt_targetpathlist(
      ( new /aws1/cl_bdctargetpathlist_w( |string| ) )
    )
  )
  it_variants = VALUE /aws1/cl_bdcvariant=>tt_variantlist(
    (
      new /aws1/cl_bdcvariant(
        io_variantconfiguration = new /aws1/cl_bdcvariantconf(
          io_configurationbundle = new /aws1/cl_bdcconfbundleref(
            iv_bundlearn = |string|
            iv_bundleversion = |string|
          )
          io_target = new /aws1/cl_bdctargetref( |string| )
        )
        iv_name = |string|
        iv_weight = 123
      )
    )
  )
  iv_clienttoken = |string|
  iv_description = |string|
  iv_enableoncreate = ABAP_TRUE
  iv_gatewayarn = |string|
  iv_name = |string|
  iv_rolearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_abtestid = lo_result->get_abtestid( ).
  lv_abtestarn = lo_result->get_abtestarn( ).
  lv_abtestname = lo_result->get_name( ).
  lv_abteststatus = lo_result->get_status( ).
  lv_abtestexecutionstatus = lo_result->get_executionstatus( ).
  lv_timestamp = lo_result->get_createdat( ).
ENDIF.