Skip to content

/AWS1/IF_BIL=>GETBILLINGPREFERENCES()

About GetBillingPreferences

Retrieves billing preferences for the specified feature. Each feature controls a distinct billing capability: which accounts can share Reserved Instances or credits, whether billing alerts are enabled, the historical record of sharing changes, and per-credit options.

Method Signature

METHODS /AWS1/IF_BIL~GETBILLINGPREFERENCES
  IMPORTING
    !IV_NEXTTOKEN TYPE /AWS1/BILPAGETOKEN OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/BILINTEGER OPTIONAL
    !IT_FEATURES TYPE /AWS1/CL_BILBILLINGFEATURES_W=>TT_BILLINGFEATURES OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_BILBLLNGFEATUREFILTER=>TT_BILLINGFEATUREFILTERS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bilgetbillingprefsrsp
  RAISING
    /AWS1/CX_BILACCESSDENIEDEX
    /AWS1/CX_BILINTERNALSERVEREX
    /AWS1/CX_BILTHROTTLINGEX
    /AWS1/CX_BILVALIDATIONEX
    /AWS1/CX_BILCLIENTEXC
    /AWS1/CX_BILSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

it_features TYPE /AWS1/CL_BILBILLINGFEATURES_W=>TT_BILLINGFEATURES TT_BILLINGFEATURES

The feature to retrieve. Specify exactly one value. Valid values: BILLING_ALERTS, RI_SHARING, RI_SHARING_HISTORY, CREDIT_SHARING, CREDIT_SHARING_HISTORY, CREDIT_LEVEL_SHARING, CREDIT_PREFERENCE_OPTIONS.

Optional arguments:

iv_nexttoken TYPE /AWS1/BILPAGETOKEN /AWS1/BILPAGETOKEN

Pagination token from a previous response. Pass the value returned in nextToken to retrieve the next page of results.

iv_maxresults TYPE /AWS1/BILINTEGER /AWS1/BILINTEGER

The maximum number of records to return per page. Range: 1 to 50. Default: 50.

it_filters TYPE /AWS1/CL_BILBLLNGFEATUREFILTER=>TT_BILLINGFEATUREFILTERS TT_BILLINGFEATUREFILTERS

Filters to narrow results. Specify exactly one filter when supplied. The supported filter name is PREFERENCE_KEY, which accepts 1 to 10 values to match preference keys.

RETURNING

oo_output TYPE REF TO /aws1/cl_bilgetbillingprefsrsp /AWS1/CL_BILGETBILLINGPREFSRSP

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->getbillingpreferences(
  it_features = VALUE /aws1/cl_bilbillingfeatures_w=>tt_billingfeatures(
    ( new /aws1/cl_bilbillingfeatures_w( |string| ) )
  )
  it_filters = VALUE /aws1/cl_bilbllngfeaturefilter=>tt_billingfeaturefilters(
    (
      new /aws1/cl_bilbllngfeaturefilter(
        it_value = VALUE /aws1/cl_bilbllftfilterval_w=>tt_billingfeaturefiltervalues(
          ( new /aws1/cl_bilbllftfilterval_w( |string| ) )
        )
        iv_name = |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.
  LOOP AT lo_result->get_billingpreferences( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_billingfeature = lo_row_1->get_feature( ).
      lv_preferencekey = lo_row_1->get_key( ).
      lv_preferencevalue = lo_row_1->get_value( ).
      lv_accountname = lo_row_1->get_accountname( ).
      lv_accountid = lo_row_1->get_accountid( ).
      lo_billingperiod = lo_row_1->get_billingperiod( ).
      IF lo_billingperiod IS NOT INITIAL.
        lv_billingyear = lo_billingperiod->get_year( ).
        lv_month = lo_billingperiod->get_month( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_pagetoken = lo_result->get_nexttoken( ).
ENDIF.