Skip to content

/AWS1/IF_WA2=>GETREVENUESTATISTICS()

About GetRevenueStatistics

Retrieves ranked monetization statistics. Use the StatisticType parameter to specify the ranking: TOP_SOURCES_BY_REVENUE for top sources by revenue, or TOP_PATHS_BY_REVENUE for top content paths by revenue. This operation is only available for CLOUDFRONT scope. The maximum supported time window is 90 days. When no CurrencyMode filter is provided, results default to REAL. To retrieve test data, include a CurrencyMode filter with the value TEST.

Method Signature

METHODS /AWS1/IF_WA2~GETREVENUESTATISTICS
  IMPORTING
    !IV_STATISTICTYPE TYPE /AWS1/WA2RANKINGSTATISTICTYPE OPTIONAL
    !IO_TIMEWINDOW TYPE REF TO /AWS1/CL_WA2TIMEWINDOW OPTIONAL
    !IV_SCOPE TYPE /AWS1/WA2SCOPE OPTIONAL
    !IV_CURRENCY TYPE /AWS1/WA2CURRENCY OPTIONAL
    !IV_GROUPBY TYPE /AWS1/WA2GROUPBYTYPE OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_WA2MONETIZATIONFILTER=>TT_MONETIZATIONFILTERLIST OPTIONAL
    !IV_NEXTMARKER TYPE /AWS1/WA2NEXTMARKER OPTIONAL
    !IV_LIMIT TYPE /AWS1/WA2PATHSTATISTICSLIMIT OPTIONAL
    !IV_SORTBY TYPE /AWS1/WA2RANKINGSORTBY OPTIONAL
    !IV_SORTORDER TYPE /AWS1/WA2SORTORDER OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_wa2getrevenuestatsrsp
  RAISING
    /AWS1/CX_WA2WAFINTERNALERROREX
    /AWS1/CX_WA2WAFINVALIDOPEX
    /AWS1/CX_WA2WAFINVALIDPARAMEX
    /AWS1/CX_WA2WAFNONEXENTITEMEX
    /AWS1/CX_WA2CLIENTEXC
    /AWS1/CX_WA2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_statistictype TYPE /AWS1/WA2RANKINGSTATISTICTYPE /AWS1/WA2RANKINGSTATISTICTYPE

TOP_SOURCES_BY_REVENUE ranks revenue from AI bot traffic, grouped by the dimension you specify in the GroupBy parameter (NAME, CATEGORY, INTENT, ORGANIZATION, or WEBACL); GroupBy is required for this statistic type. TOP_PATHS_BY_REVENUE ranks revenue by path.

io_timewindow TYPE REF TO /AWS1/CL_WA2TIMEWINDOW /AWS1/CL_WA2TIMEWINDOW

The time range for the query. Specify start and end timestamps.

iv_scope TYPE /AWS1/WA2SCOPE /AWS1/WA2SCOPE

Specifies whether this is for a Amazon CloudFront distribution (CLOUDFRONT) or for a regional application (REGIONAL).

iv_currency TYPE /AWS1/WA2CURRENCY /AWS1/WA2CURRENCY

The currency for the revenue amounts in the response.

Optional arguments:

iv_groupby TYPE /AWS1/WA2GROUPBYTYPE /AWS1/WA2GROUPBYTYPE

The dimension to group results by: NAME, CATEGORY, INTENT, ORGANIZATION, or WEBACL. Required when StatisticType is TOP_SOURCES_BY_REVENUE. Not required for TOP_PATHS_BY_REVENUE, where results are grouped by content path. If StatisticType is TOP_SOURCES_BY_REVENUE and GroupBy is omitted, the request is rejected with a WAFInvalidParameterException.

it_filters TYPE /AWS1/CL_WA2MONETIZATIONFILTER=>TT_MONETIZATIONFILTERLIST TT_MONETIZATIONFILTERLIST

Optional filters to narrow the results.

iv_nextmarker TYPE /AWS1/WA2NEXTMARKER /AWS1/WA2NEXTMARKER

When you get a paginated response, this marker indicates that additional results are available. Use it in a subsequent request to retrieve the next page of results.

iv_limit TYPE /AWS1/WA2PATHSTATISTICSLIMIT /AWS1/WA2PATHSTATISTICSLIMIT

The maximum number of results to return.

iv_sortby TYPE /AWS1/WA2RANKINGSORTBY /AWS1/WA2RANKINGSORTBY

The field to sort results by: REVENUE, PERCENTAGE, or NAME.

iv_sortorder TYPE /AWS1/WA2SORTORDER /AWS1/WA2SORTORDER

The sort order: ASC for ascending or DESC for descending.

RETURNING

oo_output TYPE REF TO /aws1/cl_wa2getrevenuestatsrsp /AWS1/CL_WA2GETREVENUESTATSRSP

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->getrevenuestatistics(
  io_timewindow = new /aws1/cl_wa2timewindow(
    iv_endtime = '20150101000000.0000000'
    iv_starttime = '20150101000000.0000000'
  )
  it_filters = VALUE /aws1/cl_wa2monetizationfilter=>tt_monetizationfilterlist(
    (
      new /aws1/cl_wa2monetizationfilter(
        it_values = VALUE /aws1/cl_wa2monetizationfltv00=>tt_monetizationfiltervaluelist(
          ( new /aws1/cl_wa2monetizationfltv00( |string| ) )
        )
        iv_name = |string|
      )
    )
  )
  iv_currency = |string|
  iv_groupby = |string|
  iv_limit = 123
  iv_nextmarker = |string|
  iv_scope = |string|
  iv_sortby = |string|
  iv_sortorder = |string|
  iv_statistictype = |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_sourcestatistics( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_filterstring = lo_row_1->get_sourcename( ).
      lv_percentagevalue = lo_row_1->get_percentage( ).
      lv_monetizationamountvalue = lo_row_1->get_amount( ).
      lv_requestcount = lo_row_1->get_requestcount( ).
      lv_filterstring = lo_row_1->get_sourcecategory( ).
      lv_filterstring = lo_row_1->get_intent( ).
      lv_filterstring = lo_row_1->get_organization( ).
      lv_verifiedstatus = lo_row_1->get_verified( ).
      lv_filterstring = lo_row_1->get_groupbyvalue( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_revenuepathstatistics( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_pathstring = lo_row_3->get_path( ).
      lv_percentagevalue = lo_row_3->get_percentage( ).
      lv_monetizationamountvalue = lo_row_3->get_amount( ).
      lv_requestcount = lo_row_3->get_requestcount( ).
    ENDIF.
  ENDLOOP.
  lv_nextmarker = lo_result->get_nextmarker( ).
ENDIF.