Skip to content

/AWS1/CL_CRM=>GETSCHEMA()

About GetSchema

Retrieves the schema for a relation within a collaboration.

Method Signature

IMPORTING

Required arguments:

iv_collaborationidentifier TYPE /AWS1/CRMCOLLABORATIONID /AWS1/CRMCOLLABORATIONID

A unique identifier for the collaboration that the schema belongs to. Currently accepts a collaboration ID.

iv_name TYPE /AWS1/CRMTABLEALIAS /AWS1/CRMTABLEALIAS

The name of the relation to retrieve the schema for.

RETURNING

oo_output TYPE REF TO /aws1/cl_crmgetschemaoutput /AWS1/CL_CRMGETSCHEMAOUTPUT

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_crm~getschema(
  iv_collaborationidentifier = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_schema = lo_result->get_schema( ).
  IF lo_schema IS NOT INITIAL.
    LOOP AT lo_schema->get_columns( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_columnname = lo_row_1->get_name( ).
        lv_columntypestring = lo_row_1->get_type( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_schema->get_partitionkeys( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_columnname = lo_row_1->get_name( ).
        lv_columntypestring = lo_row_1->get_type( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_schema->get_analysisruletypes( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_analysisruletype = lo_row_3->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_analysismethod = lo_schema->get_analysismethod( ).
    LOOP AT lo_schema->get_selectedanalysismethods( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_selectedanalysismethod = lo_row_5->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_accountid = lo_schema->get_creatoraccountid( ).
    lv_tablealias = lo_schema->get_name( ).
    lv_uuid = lo_schema->get_collaborationid( ).
    lv_collaborationarn = lo_schema->get_collaborationarn( ).
    lv_tabledescription = lo_schema->get_description( ).
    lv_timestamp = lo_schema->get_createtime( ).
    lv_timestamp = lo_schema->get_updatetime( ).
    lv_schematype = lo_schema->get_type( ).
    LOOP AT lo_schema->get_schemastatusdetails( ) into lo_row_6.
      lo_row_7 = lo_row_6.
      IF lo_row_7 IS NOT INITIAL.
        lv_schemastatus = lo_row_7->get_status( ).
        LOOP AT lo_row_7->get_reasons( ) into lo_row_8.
          lo_row_9 = lo_row_8.
          IF lo_row_9 IS NOT INITIAL.
            lv_schemastatusreasoncode = lo_row_9->get_code( ).
            lv_string = lo_row_9->get_message( ).
          ENDIF.
        ENDLOOP.
        lv_analysisruletype = lo_row_7->get_analysisruletype( ).
        LOOP AT lo_row_7->get_configurations( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_schemaconfiguration = lo_row_11->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_analysistype = lo_row_7->get_analysistype( ).
      ENDIF.
    ENDLOOP.
    lo_schematypeproperties = lo_schema->get_schematypeproperties( ).
    IF lo_schematypeproperties IS NOT INITIAL.
      lo_idmappingtableschematyp = lo_schematypeproperties->get_idmappingtable( ).
      IF lo_idmappingtableschematyp IS NOT INITIAL.
        LOOP AT lo_idmappingtableschematyp->get_idmaptableinputsource( ) into lo_row_12.
          lo_row_13 = lo_row_12.
          IF lo_row_13 IS NOT INITIAL.
            lv_string = lo_row_13->get_idnamespaceassociationid( ).
            lv_idnamespacetype = lo_row_13->get_type( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.