Skip to content

/AWS1/CL_SSS=>GETDATABASE()

About GetDatabase

Gets the SAP HANA database of an application registered with AWS Systems Manager for SAP.

Method Signature

IMPORTING

Optional arguments:

iv_applicationid TYPE /AWS1/SSSAPPLICATIONID /AWS1/SSSAPPLICATIONID

The ID of the application.

iv_componentid TYPE /AWS1/SSSCOMPONENTID /AWS1/SSSCOMPONENTID

The ID of the component.

iv_databaseid TYPE /AWS1/SSSDATABASEID /AWS1/SSSDATABASEID

The ID of the database.

iv_databasearn TYPE /AWS1/SSSSSMSAPARN /AWS1/SSSSSMSAPARN

The Amazon Resource Name (ARN) of the database.

RETURNING

oo_output TYPE REF TO /aws1/cl_sssgetdatabaseoutput /AWS1/CL_SSSGETDATABASEOUTPUT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->/aws1/if_sss~getdatabase(
  iv_applicationid = |string|
  iv_componentid = |string|
  iv_databasearn = |string|
  iv_databaseid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_database = lo_result->get_database( ).
  IF lo_database IS NOT INITIAL.
    lv_applicationid = lo_database->get_applicationid( ).
    lv_componentid = lo_database->get_componentid( ).
    LOOP AT lo_database->get_credentials( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_databasename = lo_row_1->get_databasename( ).
        lv_credentialtype = lo_row_1->get_credentialtype( ).
        lv_secretid = lo_row_1->get_secretid( ).
      ENDIF.
    ENDLOOP.
    lv_databaseid = lo_database->get_databaseid( ).
    lv_string = lo_database->get_databasename( ).
    lv_databasetype = lo_database->get_databasetype( ).
    lv_ssmsaparn = lo_database->get_arn( ).
    lv_databasestatus = lo_database->get_status( ).
    lv_string = lo_database->get_primaryhost( ).
    lv_integer = lo_database->get_sqlport( ).
    lv_timestamp = lo_database->get_lastupdated( ).
    LOOP AT lo_database->get_connectedcomponentarns( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_ssmsaparn = lo_row_3->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
  LOOP AT lo_result->get_tags( ) into ls_row_4.
    lv_key = ls_row_4-key.
    lo_value = ls_row_4-value.
    IF lo_value IS NOT INITIAL.
      lv_tagvalue = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.