Skip to content

/AWS1/IF_MPI=>SEARCHLISTINGS()

About SearchListings

Returns a list of product listings based on search criteria and filters. You can search by keyword, filter by category, pricing model, fulfillment type, and other attributes, and sort results by relevance or customer rating.

Method Signature

METHODS /AWS1/IF_MPI~SEARCHLISTINGS
  IMPORTING
    !IV_SEARCHTEXT TYPE /AWS1/MPISEARCHTEXT OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_MPISEARCHFILTER=>TT_SEARCHFILTERLIST OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/MPIMAXRESULTS OPTIONAL
    !IV_SORTBY TYPE /AWS1/MPISEARCHLISTINGSSORTBY OPTIONAL
    !IV_SORTORDER TYPE /AWS1/MPISRCHLISTNGSSORTORDER OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/MPINEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpisrchlistngsoutput
  RAISING
    /AWS1/CX_MPIACCESSDENIEDEX
    /AWS1/CX_MPIINTERNALSERVEREX
    /AWS1/CX_MPITHROTTLINGEX
    /AWS1/CX_MPIVLDTNEXCEPTION
    /AWS1/CX_MPICLIENTEXC
    /AWS1/CX_MPISERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_searchtext TYPE /AWS1/MPISEARCHTEXT /AWS1/MPISEARCHTEXT

The search query text to find relevant listings.

it_filters TYPE /AWS1/CL_MPISEARCHFILTER=>TT_SEARCHFILTERLIST TT_SEARCHFILTERLIST

Filters to narrow search results. Multiple filters are combined with AND logic. Multiple values within the same filter are combined with OR logic.

iv_maxresults TYPE /AWS1/MPIMAXRESULTS /AWS1/MPIMAXRESULTS

The maximum number of results that are returned per call. You can use nextToken to get more results.

iv_sortby TYPE /AWS1/MPISEARCHLISTINGSSORTBY /AWS1/MPISEARCHLISTINGSSORTBY

The field to sort results by. Valid values are RELEVANCE and AVERAGE_CUSTOMER_RATING.

iv_sortorder TYPE /AWS1/MPISRCHLISTNGSSORTORDER /AWS1/MPISRCHLISTNGSSORTORDER

The sort direction. Valid values are DESCENDING and ASCENDING.

iv_nexttoken TYPE /AWS1/MPINEXTTOKEN /AWS1/MPINEXTTOKEN

If nextToken is returned, there are more results available. Make the call again using the returned token to retrieve the next page.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpisrchlistngsoutput /AWS1/CL_MPISRCHLISTNGSOUTPUT

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->searchlistings(
  it_filters = VALUE /aws1/cl_mpisearchfilter=>tt_searchfilterlist(
    (
      new /aws1/cl_mpisearchfilter(
        it_filtervalues = VALUE /aws1/cl_mpisrchfiltvallist_w=>tt_searchfiltervaluelist(
          ( new /aws1/cl_mpisrchfiltvallist_w( |string| ) )
        )
        iv_filtertype = |string|
      )
    )
  )
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_searchtext = |string|
  iv_sortby = |string|
  iv_sortorder = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_nonnegativecount = lo_result->get_totalresults( ).
  LOOP AT lo_result->get_listingsummaries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_listingid = lo_row_1->get_listingid( ).
      lv_nonemptystring = lo_row_1->get_listingname( ).
      lo_sellerinformation = lo_row_1->get_publisher( ).
      IF lo_sellerinformation IS NOT INITIAL.
        lv_sellerprofileid = lo_sellerinformation->get_sellerprofileid( ).
        lv_nonemptystring = lo_sellerinformation->get_displayname( ).
      ENDIF.
      lv_catalog = lo_row_1->get_catalog( ).
      lv_nonemptystring = lo_row_1->get_shortdescription( ).
      lv_url = lo_row_1->get_logothumbnailurl( ).
      LOOP AT lo_row_1->get_categories( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_nonemptystring = lo_row_3->get_categoryid( ).
          lv_nonemptystring = lo_row_3->get_displayname( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_fulfllmtoptionsummaries( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_fulfillmentoptiontype = lo_row_5->get_fulfillmentoptiontype( ).
          lv_nonemptystring = lo_row_5->get_displayname( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_badges( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_nonemptystring = lo_row_7->get_displayname( ).
          lv_listingbadgetype = lo_row_7->get_badgetype( ).
        ENDIF.
      ENDLOOP.
      lo_reviewsummary = lo_row_1->get_reviewsummary( ).
      IF lo_reviewsummary IS NOT INITIAL.
        LOOP AT lo_reviewsummary->get_reviewsourcesummaries( ) into lo_row_8.
          lo_row_9 = lo_row_8.
          IF lo_row_9 IS NOT INITIAL.
            lv_nonemptystring = lo_row_9->get_sourcename( ).
            lv_reviewsourceid = lo_row_9->get_sourceid( ).
            lv_url = lo_row_9->get_sourceurl( ).
            lv_nonemptystring = lo_row_9->get_averagerating( ).
            lv_nonnegativecount = lo_row_9->get_totalreviews( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      LOOP AT lo_row_1->get_pricingmodels( ) into lo_row_10.
        lo_row_11 = lo_row_10.
        IF lo_row_11 IS NOT INITIAL.
          lv_pricingmodeltype = lo_row_11->get_pricingmodeltype( ).
          lv_nonemptystring = lo_row_11->get_displayname( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_pricingunits( ) into lo_row_12.
        lo_row_13 = lo_row_12.
        IF lo_row_13 IS NOT INITIAL.
          lv_pricingunittype = lo_row_13->get_pricingunittype( ).
          lv_nonemptystring = lo_row_13->get_displayname( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_associatedentities( ) into lo_row_14.
        lo_row_15 = lo_row_14.
        IF lo_row_15 IS NOT INITIAL.
          lo_productinformation = lo_row_15->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.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.

Search for machine learning listings

Search for SaaS listings in the machine learning category with sorting by relevance

DATA(lo_result) = lo_client->searchlistings(
  it_filters = VALUE /aws1/cl_mpisearchfilter=>tt_searchfilterlist(
    (
      new /aws1/cl_mpisearchfilter(
        it_filtervalues = VALUE /aws1/cl_mpisrchfiltvallist_w=>tt_searchfiltervaluelist(
          ( new /aws1/cl_mpisrchfiltvallist_w( |machine-learning| ) )
        )
        iv_filtertype = |CATEGORY|
      )
    )
    (
      new /aws1/cl_mpisearchfilter(
        it_filtervalues = VALUE /aws1/cl_mpisrchfiltvallist_w=>tt_searchfiltervaluelist(
          ( new /aws1/cl_mpisrchfiltvallist_w( |SAAS| ) )
        )
        iv_filtertype = |FULFILLMENT_OPTION_TYPE|
      )
    )
  )
  iv_maxresults = 25
  iv_searchtext = |computer vision|
  iv_sortby = |RELEVANCE|
  iv_sortorder = |DESCENDING|
).