Skip to content

/AWS1/IF_MPG=>CREATEAGREEMENTREQUEST()

About CreateAgreementRequest

Creates an agreement request that acts as a quote for the terms you want to accept. The agreement request captures the requested terms, calculates charges, and returns a summary. Use AcceptAgreementRequest with the returned agreementRequestId to finalize the agreement.

Method Signature

METHODS /AWS1/IF_MPG~CREATEAGREEMENTREQUEST
  IMPORTING
    !IV_CLIENTTOKEN TYPE /AWS1/MPGCLIENTTOKEN OPTIONAL
    !IV_INTENT TYPE /AWS1/MPGINTENT OPTIONAL
    !IT_REQUESTEDTERMS TYPE /AWS1/CL_MPGREQUESTEDTERM=>TT_REQUESTEDTERMLIST OPTIONAL
    !IV_SOURCEAGREEMENTIDENTIFIER TYPE /AWS1/MPGRESOURCEID OPTIONAL
    !IV_AGREEMENTPROPOSALID TYPE /AWS1/MPGAGREEMENTPROPOSALID OPTIONAL
    !IO_TAXCONFIGURATION TYPE REF TO /AWS1/CL_MPGTAXCONFIGURATION OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpgcreateagrmntreqout
  RAISING
    /AWS1/CX_MPGACCESSDENIEDEX
    /AWS1/CX_MPGCONFLICTEXCEPTION
    /AWS1/CX_MPGINTERNALSERVEREX
    /AWS1/CX_MPGRESOURCENOTFOUNDEX
    /AWS1/CX_MPGSERVICEQUOTAEXCDEX
    /AWS1/CX_MPGTHROTTLINGEX
    /AWS1/CX_MPGVALIDATIONEX
    /AWS1/CX_MPGCLIENTEXC
    /AWS1/CX_MPGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_intent TYPE /AWS1/MPGINTENT /AWS1/MPGINTENT

The purpose and desired outcome of the agreement request. This is a required parameter that determines how the agreement request is processed.

  • NEW – Creates a new agreement for terms in the request.

  • AMEND – Modifies an existing agreement with terms that are accepted in the request.

  • REPLACE – Creates a new agreement with accepted terms and replaces the existing agreement.

it_requestedterms TYPE /AWS1/CL_MPGREQUESTEDTERM=>TT_REQUESTEDTERMLIST TT_REQUESTEDTERMLIST

A list of terms that define what is being accepted as part of the agreement. Some terms require configuration.

Optional arguments:

iv_clienttoken TYPE /AWS1/MPGCLIENTTOKEN /AWS1/MPGCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

iv_sourceagreementidentifier TYPE /AWS1/MPGRESOURCEID /AWS1/MPGRESOURCEID

The agreement's identifier that the request acts upon.

This parameter is required for all non-NEW intents (i.e., AMEND or REPLACE). Don't provide this parameter if the intent is NEW.

iv_agreementproposalid TYPE /AWS1/MPGAGREEMENTPROPOSALID /AWS1/MPGAGREEMENTPROPOSALID

The agreement proposal signed by the proposer. The proposal includes the requested resources and the terms that outline an agreement outcome.

This parameter is required if the intent is not AMEND.

io_taxconfiguration TYPE REF TO /AWS1/CL_MPGTAXCONFIGURATION /AWS1/CL_MPGTAXCONFIGURATION

Configuration for tax estimation in the agreement request response.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpgcreateagrmntreqout /AWS1/CL_MPGCREATEAGRMNTREQOUT

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->createagreementrequest(
  io_taxconfiguration = new /aws1/cl_mpgtaxconfiguration( |string| )
  it_requestedterms = VALUE /aws1/cl_mpgrequestedterm=>tt_requestedtermlist(
    (
      new /aws1/cl_mpgrequestedterm(
        io_configuration = new /aws1/cl_mpgrequestedtermconf(
          io_cnfgrblupfrntprctermconf = new /aws1/cl_mpgcfgurableupfront02(
            it_dimensions = VALUE /aws1/cl_mpgdimension=>tt_dimensionlist(
              (
                new /aws1/cl_mpgdimension(
                  iv_dimensionkey = |string|
                  iv_dimensionvalue = 123
                )
              )
            )
            iv_selectorvalue = |string|
          )
          io_renewaltermconfiguration = new /aws1/cl_mpgrenewaltermconf( ABAP_TRUE )
          io_variablepaymenttermconf = new /aws1/cl_mpgvariablepmntterm00(
            iv_expirationduration = |string|
            iv_pmntrequestapprovalstrag = |string|
          )
        )
        iv_id = |string|
      )
    )
  )
  iv_agreementproposalid = |string|
  iv_clienttoken = |string|
  iv_intent = |string|
  iv_sourceagreementidentifier = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_agreementrequestid = lo_result->get_agreementrequestid( ).
  lo_chargesummary = lo_result->get_chargesummary( ).
  IF lo_chargesummary IS NOT INITIAL.
    lv_currencycode = lo_chargesummary->get_currencycode( ).
    lv_boundedstring = lo_chargesummary->get_newagreementvalue( ).
    lv_boundedstring = lo_chargesummary->get_newagrmntvalueaftertax( ).
    LOOP AT lo_chargesummary->get_expectedcharges( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_resourceid = lo_row_1->get_id( ).
        lv_timestamp = lo_row_1->get_time( ).
        lv_boundedstring = lo_row_1->get_amount( ).
        lv_boundedstring = lo_row_1->get_amountaftertax( ).
        lv_timing = lo_row_1->get_timing( ).
        lo_estimatedtaxes = lo_row_1->get_estimatedtaxes( ).
        IF lo_estimatedtaxes IS NOT INITIAL.
          LOOP AT lo_estimatedtaxes->get_breakdown( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_boundedstring = lo_row_3->get_amount( ).
              lv_boundedstring = lo_row_3->get_rate( ).
              lv_boundedstring = lo_row_3->get_type( ).
            ENDIF.
          ENDLOOP.
          lv_boundedstring = lo_estimatedtaxes->get_totalamount( ).
        ENDIF.
      ENDIF.
    ENDLOOP.
    lo_estimatedtaxes = lo_chargesummary->get_estimatedtaxes( ).
    IF lo_estimatedtaxes IS NOT INITIAL.
      LOOP AT lo_estimatedtaxes->get_breakdown( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_boundedstring = lo_row_3->get_amount( ).
          lv_boundedstring = lo_row_3->get_rate( ).
          lv_boundedstring = lo_row_3->get_type( ).
        ENDIF.
      ENDLOOP.
      lv_boundedstring = lo_estimatedtaxes->get_totalamount( ).
    ENDIF.
    LOOP AT lo_chargesummary->get_itemizedcharges( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_boundedstring = lo_row_5->get_dimensionkey( ).
        lv_integer = lo_row_5->get_newquantity( ).
        lv_integer = lo_row_5->get_oldquantity( ).
        lv_resourceid = lo_row_5->get_chargereference( ).
        lv_boundedstring = lo_row_5->get_incrementalchargeamount( ).
      ENDIF.
    ENDLOOP.
    lo_invoicingentity = lo_chargesummary->get_invoicingentity( ).
    IF lo_invoicingentity IS NOT INITIAL.
      lv_boundedstring = lo_invoicingentity->get_legalname( ).
      lv_boundedstring = lo_invoicingentity->get_branchname( ).
    ENDIF.
  ENDIF.
ENDIF.