Method CONVERT_AGENCY_INT2EXT

Function

Method CONVERT_AGENCY_INT2EXT is the opposite of method CONVERT_AGENCY_EXT2INT. It offers a function to convert Raw16 IDs that were previously converted back to the original combination of cct:identifier attributes schemeAgencyID, schemeAgencySchemeID and SchemeAgencySchemeAgencyID.

Parameters

Type

Name

Description

Import

IV_AGENCY_ID

This parameter passes the value of the Raw16 ID to the method.

Changing

CV_CCT_SAGENCY_ID

In this parameter the method passes the value of the cct:identifer attribute schemeAgencyID belonging to the passed Raw16 ID IV_AGENCY_ID.

Changing

CV_CCT_SASCHEME_ID

In this parameter the method passes the value of the cct:identifer attribute schemeAgencySchemeID belonging to the passed Raw16 ID IV_AGENCY_ID.

Changing

CV_CCT_SASAGENCY_ID

In this parameter the method passes the value of the cct:identifer attribute schemeAgencySchemeAgencyID belonging to the passed Raw16 ID IV_AGENCY_ID.

Exceptions

Exception CX_UKM_CONVERSION_FAILED is triggered if an error occurs during the conversion. In this case the passed Raw16 ID IV_AGENCY_ID was not found and thus was not converted into the cct:identifier attribute.

Notes

If import parameter IV_AGENCY_ID was passed as initial, the cct:identifier attributes are returned as initial. In this case no exception of type CX_UKM_CONVERSION_FAILED is triggered.

Example

* Reference to the common ukms exception class
DATA: lx_ukm_exception TYPE REF TO cx_ukm_exception.
TRY.
*   Reference to the conversion interface
    DATA: lr_conv TYPE REF TO if_ukm_attribute_convert.
*   Retrieve the context dependent interface instance
    CALL METHOD cl_ukm_factory=>get_instance_attribute_convert
      EXPORTING
         iv_main_context_id           = 'MyContext'
         iv_runtime_generated_context = abap_true
      IMPORTING
        er_if_ukm_attribute_convert   = lr_conv.
*   GUID (raw16) for internal agency
    DATA: lv_int_agency TYPE ukm_e_agency_id value '47110815471108154711'.
*   schemeAgencyID + schemeAgencySchemeID + schemeAgencySchemeAgencyID
    DATA: lv_cct_sagency_id   TYPE ukm_e_cct_id_sa_id,
          lv_cct_sascheme_id  TYPE ukm_e_cct_id_sas_id,
          lv_cct_sasagency_id TYPE ukm_e_cct_id_sasa_id.
*   Convert an internal agency back to the combination of
*   schemeAgencyID + schemeAgencySchemeID + schemeAgencySchemeAgencyID
    CALL METHOD lr_conv->convert_agency_int2ext
      EXPORTING
        iv_agency_id        = lv_int_agency
      CHANGING
        cv_cct_sagency_id   = lv_cct_sagency_id
        cv_cct_sascheme_id  = lv_cct_sascheme_id
        cv_cct_sasagency_id = lv_cct_sasagency_id.
  CATCH cx_ukm_context_unknown INTO lx_ukm_exception.
    DATA: lv_error_text TYPE string.
    lv_error_text = lx_ukm_exception->if_message~get_text( ).
  CATCH cx_ukm_conversion_failed INTO lx_ukm_exception.
    DATA: lv_failure_text TYPE string.
    lv_failure_text = lx_ukm_exception->if_message~get_text( ).
ENDTRY