Skip to content

/AWS1/IF_MPI=>GETOFFER()

About GetOffer

Provides details about an offer, such as the pricing model, seller of record, availability dates, badges, and associated products.

Method Signature

METHODS /AWS1/IF_MPI~GETOFFER
  IMPORTING
    !IV_OFFERID TYPE /AWS1/MPIOFFERID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpigetofferoutput
  RAISING
    /AWS1/CX_MPIACCESSDENIEDEX
    /AWS1/CX_MPIINTERNALSERVEREX
    /AWS1/CX_MPITHROTTLINGEX
    /AWS1/CX_MPIVLDTNEXCEPTION
    /AWS1/CX_MPIRESOURCENOTFOUNDEX
    /AWS1/CX_MPICLIENTEXC
    /AWS1/CX_MPISERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_offerid TYPE /AWS1/MPIOFFERID /AWS1/MPIOFFERID

The unique identifier of the offer to retrieve.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpigetofferoutput /AWS1/CL_MPIGETOFFEROUTPUT

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->getoffer( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_offerid = lo_result->get_offerid( ).
  lv_catalog = lo_result->get_catalog( ).
  lv_nullablestring = lo_result->get_offername( ).
  lv_agreementresourceid = lo_result->get_agreementproposalid( ).
  lv_timestamp = lo_result->get_expirationtime( ).
  lv_timestamp = lo_result->get_availablefromtime( ).
  lo_sellerinformation = lo_result->get_sellerofrecord( ).
  IF lo_sellerinformation IS NOT INITIAL.
    lv_sellerprofileid = lo_sellerinformation->get_sellerprofileid( ).
    lv_nonemptystring = lo_sellerinformation->get_displayname( ).
  ENDIF.
  lv_agreementresourceid = lo_result->get_replacementagreementid( ).
  lo_pricingmodel = lo_result->get_pricingmodel( ).
  IF lo_pricingmodel IS NOT INITIAL.
    lv_pricingmodeltype = lo_pricingmodel->get_pricingmodeltype( ).
    lv_nonemptystring = lo_pricingmodel->get_displayname( ).
  ENDIF.
  LOOP AT lo_result->get_badges( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_nonemptystring = lo_row_1->get_displayname( ).
      lv_purchaseoptionbadgetype = lo_row_1->get_badgetype( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_associatedentities( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lo_productinformation = lo_row_3->get_product( ).
      IF lo_productinformation IS NOT INITIAL.
        lv_productid = lo_productinformation->get_productid( ).
        lv_nonemptystring = lo_productinformation->get_productname( ).
        lo_sellerinformation = lo_productinformation->get_manufacturer( ).
        IF lo_sellerinformation IS NOT INITIAL.
          lv_sellerprofileid = lo_sellerinformation->get_sellerprofileid( ).
          lv_nonemptystring = lo_sellerinformation->get_displayname( ).
        ENDIF.
      ENDIF.
      lo_offersetinformation = lo_row_3->get_offerset( ).
      IF lo_offersetinformation IS NOT INITIAL.
        lv_offersetid = lo_offersetinformation->get_offersetid( ).
        lo_sellerinformation = lo_offersetinformation->get_sellerofrecord( ).
        IF lo_sellerinformation IS NOT INITIAL.
          lv_sellerprofileid = lo_sellerinformation->get_sellerprofileid( ).
          lv_nonemptystring = lo_sellerinformation->get_displayname( ).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDIF.

Invoke GetOffer for Contract Pricing offer

Invoke GetOffer for Contract Pricing offer

DATA(lo_result) = lo_client->getoffer( |offer-sampleContractId| ).

Invoke GetOffer for Usage Pricing offer

Invoke GetOffer for Usage Pricing offer

DATA(lo_result) = lo_client->getoffer( |offer-sampleUsageId| ).

Invoke GetOffer for BYOL Pricing offer

Invoke GetOffer for BYOL Pricing offer

DATA(lo_result) = lo_client->getoffer( |offer-sampleByolId| ).

Invoke GetOffer for FREE Pricing offer

Invoke GetOffer for FREE Pricing offer

DATA(lo_result) = lo_client->getoffer( |offer-sampleFreeId| ).