SDK for SAP ABAP를 사용한 조직 예제 - AWS SDK 코드 예제

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

SDK for SAP ABAP를 사용한 조직 예제

다음 코드 예제에서는 Organizations와 함께 AWS SDK for SAP ABAP를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

주제

작업

다음 코드 예시는 AttachPolicy의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. lo_org->attachpolicy( iv_policyid = iv_policy_id iv_targetid = iv_target_id ). MESSAGE 'Policy attached to target.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to attach the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgtargetnotfoundex. MESSAGE 'The specified target does not exist.' TYPE 'E'. CATCH /aws1/cx_orgduplicateplyatta00. MESSAGE 'The policy is already attached to the target.' TYPE 'E'. ENDTRY.
  • API 세부 정보는 AWS SDK for SAP ABAP API 참조AttachPolicy를 참조하세요.

다음 코드 예시는 CreatePolicy의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. oo_result = lo_org->createpolicy( " oo_result is returned for testing purposes. " iv_name = iv_policy_name iv_description = iv_policy_description iv_content = iv_policy_content iv_type = iv_policy_type ). MESSAGE 'Policy created.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to create a policy.' TYPE 'E'. CATCH /aws1/cx_orgduplicatepolicyex. MESSAGE 'A policy with this name already exists.' TYPE 'E'. CATCH /aws1/cx_orgmalformedplydocex. MESSAGE 'The policy content is malformed.' TYPE 'E'. ENDTRY.
  • API 세부 정보는AWS SDK for SAP ABAP APICreatePolicy를 참조하세요.

다음 코드 예시는 DeletePolicy의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. lo_org->deletepolicy( iv_policyid = iv_policy_id ). MESSAGE 'Policy deleted.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to delete the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgpolicyinuseex. MESSAGE 'The policy is still attached to one or more targets.' TYPE 'E'. ENDTRY.

다음 코드 예시는 DescribePolicy의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. oo_result = lo_org->describepolicy( " oo_result is returned for testing purposes. " iv_policyid = iv_policy_id ). DATA(lo_policy) = oo_result->get_policy( ). MESSAGE 'Retrieved policy details.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to describe the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. ENDTRY.
  • API 세부 정보는 AWS SDK for SAP ABAP API 참조DescribePolicy를 참조하세요.

다음 코드 예시는 DetachPolicy의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. lo_org->detachpolicy( iv_policyid = iv_policy_id iv_targetid = iv_target_id ). MESSAGE 'Policy detached from target.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to detach the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgtargetnotfoundex. MESSAGE 'The specified target does not exist.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotattex. MESSAGE 'The policy is not attached to the target.' TYPE 'E'. ENDTRY.
  • API 세부 정보는 AWS SDK for SAP ABAP API 참조DetachPolicy를 참조하세요.

다음 코드 예시는 ListPolicies의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

TRY. oo_result = lo_org->listpolicies( " oo_result is returned for testing purposes. " iv_filter = iv_filter ). DATA(lt_policies) = oo_result->get_policies( ). MESSAGE 'Retrieved list of policies.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to list policies.' TYPE 'E'. CATCH /aws1/cx_orgawsorgsnotinuseex. MESSAGE 'Your account is not a member of an organization.' TYPE 'E'. ENDTRY.
  • API 세부 정보는 AWS SDK for SAP ABAP API 참조ListPolicies를 참조하세요.