Skip to content

/AWS1/IF_MPE=>GETENTITLEMENTS()

About GetEntitlements

GetEntitlements retrieves entitlement values for a given product. The results can be filtered based on customer identifier, AWS account ID, license ARN, or product dimensions.

Method Signature

METHODS /AWS1/IF_MPE~GETENTITLEMENTS
  IMPORTING
    !IV_PRODUCTCODE TYPE /AWS1/MPEPRODUCTCODE OPTIONAL
    !IT_FILTER TYPE /AWS1/CL_MPEFILTERVALUELIST_W=>TT_GETENTITLEMENTFILTERS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/MPENONEMPTYSTRING OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/MPEPAGESIZEINTEGER OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpegetentitlementsrs
  RAISING
    /AWS1/CX_MPEINTERNALSVCERROREX
    /AWS1/CX_MPEINVALIDPARAMETEREX
    /AWS1/CX_MPETHROTTLINGEX
    /AWS1/CX_MPECLIENTEXC
    /AWS1/CX_MPESERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_productcode TYPE /AWS1/MPEPRODUCTCODE /AWS1/MPEPRODUCTCODE

Product code is used to uniquely identify a product in AWS Marketplace. The product code will be provided by AWS Marketplace when the product listing is created.

Optional arguments:

it_filter TYPE /AWS1/CL_MPEFILTERVALUELIST_W=>TT_GETENTITLEMENTFILTERS TT_GETENTITLEMENTFILTERS

Filter is used to return entitlements for a specific customer or for a specific dimension. Filters are described as keys mapped to a lists of values. Filtered requests are unioned for each value in the value list, and then intersected for each filter key.

CustomerIdentifier and CustomerAWSAccountId are mutually exclusive parameters. You must use one or the other, but not both in the same request.

If you're migrating an existing integration, use Account Feeds to map CustomerIdentifier to CustomerAWSAccountId, and Agreements Feeds to map CustomerAWSAccountId and LicenseArn.

iv_nexttoken TYPE /AWS1/MPENONEMPTYSTRING /AWS1/MPENONEMPTYSTRING

For paginated calls to GetEntitlements, pass the NextToken from the previous GetEntitlementsResult.

iv_maxresults TYPE /AWS1/MPEPAGESIZEINTEGER /AWS1/MPEPAGESIZEINTEGER

The maximum number of items to retrieve from the GetEntitlements operation. For pagination, use the NextToken field in subsequent calls to GetEntitlements.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpegetentitlementsrs /AWS1/CL_MPEGETENTITLEMENTSRS

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->getentitlements(
  it_filter = VALUE /aws1/cl_mpefiltervaluelist_w=>tt_getentitlementfilters(
    (
      VALUE /aws1/cl_mpefiltervaluelist_w=>ts_getentitlementfilts_maprow(
        value = VALUE /aws1/cl_mpefiltervaluelist_w=>tt_filtervaluelist(
          ( new /aws1/cl_mpefiltervaluelist_w( |string| ) )
        )
        key = |string|
      )
    )
  )
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_productcode = |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_entitlements( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_productcode = lo_row_1->get_productcode( ).
      lv_nonemptystring = lo_row_1->get_dimension( ).
      lv_nonemptystring = lo_row_1->get_customeridentifier( ).
      lv_nonemptystring = lo_row_1->get_customerawsaccountid( ).
      lo_entitlementvalue = lo_row_1->get_value( ).
      IF lo_entitlementvalue IS NOT INITIAL.
        lv_integer = lo_entitlementvalue->get_integervalue( ).
        lv_double = lo_entitlementvalue->get_doublevalue( ).
        lv_boolean = lo_entitlementvalue->get_booleanvalue( ).
        lv_string = lo_entitlementvalue->get_stringvalue( ).
      ENDIF.
      lv_timestamp = lo_row_1->get_expirationdate( ).
      lv_string = lo_row_1->get_licensearn( ).
    ENDIF.
  ENDLOOP.
  lv_nonemptystring = lo_result->get_nexttoken( ).
ENDIF.