/AWS1/IF_LM2=>LISTSESSIONMETRICS()¶
About ListSessionMetrics¶
Retrieves summary metrics for the user sessions with your bot. The following fields are required:
- 
metrics– A list of AnalyticsSessionMetric objects. In each object, use thenamefield to specify the metric to calculate, thestatisticfield to specify whether to calculate theSum,Average, orMaxnumber, and theorderfield to specify whether to sort the results inAscendingorDescendingorder. - 
startDateTimeandendDateTime– Define a time range for which you want to retrieve results. 
Of the optional fields, you can organize the results in the following ways:
- 
Use the
filtersfield to filter the results, thegroupByfield to specify categories by which to group the results, and thebinByfield to specify time intervals by which to group the results. - 
Use the
maxResultsfield to limit the number of results to return in a single response and thenextTokenfield to return the next batch of results if the response does not return the full set of results. 
Note that an order field exists in both binBy and metrics. Currently, you can specify it in either field, but not in both.
Method Signature¶
METHODS /AWS1/IF_LM2~LISTSESSIONMETRICS
  IMPORTING
    !IV_BOTID TYPE /AWS1/LM2ID OPTIONAL
    !IV_STARTDATETIME TYPE /AWS1/LM2TIMESTAMP OPTIONAL
    !IV_ENDDATETIME TYPE /AWS1/LM2TIMESTAMP OPTIONAL
    !IT_METRICS TYPE /AWS1/CL_LM2ALYSSESSIONMETRIC=>TT_ANALYTICSSESSIONMETRICS OPTIONAL
    !IT_BINBY TYPE /AWS1/CL_LM2ANALYTICSBINBYSPEC=>TT_ANALYTICSBINBYLIST OPTIONAL
    !IT_GROUPBY TYPE /AWS1/CL_LM2ALYSSESSGRPBYSPEC=>TT_ANALYTICSSESSIONGROUPBYLIST OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_LM2ALYSSESSIONFILTER=>TT_ANALYTICSSESSIONFILTERS OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/LM2MAXRESULTS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/LM2NEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lm2listsessionmetrsp
  RAISING
    /AWS1/CX_LM2INTERNALSERVEREX
    /AWS1/CX_LM2PRECONDFAILEDEX
    /AWS1/CX_LM2SERVICEQUOTAEXCDEX
    /AWS1/CX_LM2THROTTLINGEX
    /AWS1/CX_LM2VALIDATIONEX
    /AWS1/CX_LM2CLIENTEXC
    /AWS1/CX_LM2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_botid TYPE /AWS1/LM2ID /AWS1/LM2ID¶
The identifier for the bot for which you want to retrieve session metrics.
iv_startdatetime TYPE /AWS1/LM2TIMESTAMP /AWS1/LM2TIMESTAMP¶
The date and time that marks the beginning of the range of time for which you want to see session metrics.
iv_enddatetime TYPE /AWS1/LM2TIMESTAMP /AWS1/LM2TIMESTAMP¶
The date and time that marks the end of the range of time for which you want to see session metrics.
it_metrics TYPE /AWS1/CL_LM2ALYSSESSIONMETRIC=>TT_ANALYTICSSESSIONMETRICS TT_ANALYTICSSESSIONMETRICS¶
A list of objects, each of which contains a metric you want to list, the statistic for the metric you want to return, and the method by which to organize the results.
Optional arguments:¶
it_binby TYPE /AWS1/CL_LM2ANALYTICSBINBYSPEC=>TT_ANALYTICSBINBYLIST TT_ANALYTICSBINBYLIST¶
A list of objects, each of which contains specifications for organizing the results by time.
it_groupby TYPE /AWS1/CL_LM2ALYSSESSGRPBYSPEC=>TT_ANALYTICSSESSIONGROUPBYLIST TT_ANALYTICSSESSIONGROUPBYLIST¶
A list of objects, each of which specifies how to group the results. You can group by the following criteria:
ConversationEndState– The final state of the conversation. The possible end states are detailed in Key definitions in the user guide.
LocaleId– The unique identifier of the bot locale.
it_filters TYPE /AWS1/CL_LM2ALYSSESSIONFILTER=>TT_ANALYTICSSESSIONFILTERS TT_ANALYTICSSESSIONFILTERS¶
A list of objects, each of which describes a condition by which you want to filter the results.
iv_maxresults TYPE /AWS1/LM2MAXRESULTS /AWS1/LM2MAXRESULTS¶
The maximum number of results to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned.
iv_nexttoken TYPE /AWS1/LM2NEXTTOKEN /AWS1/LM2NEXTTOKEN¶
If the response from the ListSessionMetrics operation contains more results than specified in the maxResults parameter, a token is returned in the response.
Use the returned token in the nextToken parameter of a ListSessionMetrics request to return the next page of results. For a complete set of results, call the ListSessionMetrics operation until the nextToken returned in the response is null.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_lm2listsessionmetrsp /AWS1/CL_LM2LISTSESSIONMETRSP¶
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->listsessionmetrics(
  it_binby = VALUE /aws1/cl_lm2analyticsbinbyspec=>tt_analyticsbinbylist(
    (
      new /aws1/cl_lm2analyticsbinbyspec(
        iv_interval = |string|
        iv_name = |string|
        iv_order = |string|
      )
    )
  )
  it_filters = VALUE /aws1/cl_lm2alyssessionfilter=>tt_analyticssessionfilters(
    (
      new /aws1/cl_lm2alyssessionfilter(
        it_values = VALUE /aws1/cl_lm2alysfiltervalues_w=>tt_analyticsfiltervalues(
          ( new /aws1/cl_lm2alysfiltervalues_w( |string| ) )
        )
        iv_name = |string|
        iv_operator = |string|
      )
    )
  )
  it_groupby = VALUE /aws1/cl_lm2alyssessgrpbyspec=>tt_analyticssessiongroupbylist(
    ( new /aws1/cl_lm2alyssessgrpbyspec( |string| ) )
  )
  it_metrics = VALUE /aws1/cl_lm2alyssessionmetric=>tt_analyticssessionmetrics(
    (
      new /aws1/cl_lm2alyssessionmetric(
        iv_name = |string|
        iv_order = |string|
        iv_statistic = |string|
      )
    )
  )
  iv_botid = |string|
  iv_enddatetime = '20150101000000.0000000'
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_startdatetime = '20150101000000.0000000'
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_id = lo_result->get_botid( ).
  LOOP AT lo_result->get_results( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      LOOP AT lo_row_1->get_binkeys( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_analyticsbinbyname = lo_row_3->get_name( ).
          lv_analyticsbinvalue = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_groupbykeys( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_analyticssessionfield = lo_row_5->get_name( ).
          lv_analyticsgroupbyvalue = lo_row_5->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_metricsresults( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_analyticssessionmetricn = lo_row_7->get_name( ).
          lv_analyticsmetricstatisti = lo_row_7->get_statistic( ).
          lv_analyticsmetricvalue = lo_row_7->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.