次のように CDS ビューを作成しました。
define view YGAC_I_REQUEST_ROLE
with parameters
pm_req_id : grfn_guid,
@Consumption.defaultValue: 'ROL'
pm_item_type : grac_prov_item_type,
@Consumption.defaultValue: 'AP'
pm_approval : grac_approval_status
as select from YGAC_I_REQ_PROVISION_ITEM as provitem
association [1..1] to YGAC_I_ROLE as _Role on _Role.RoleId = provitem.ProvisionItemId
association [1..*] to YGAC_I_ROLE_RS as _Relation on _Relation.RoleId1 = provitem.ProvisionItemId
{
key ReqId,
key ReqIdItem,
Connector,
ProvisionItemId,
ActionType,
ValidFrom,
ValidTo,
_Role.RoleId,
_Role.RoleName,
_Role.RoleType,
_Role,
_Relation
}
where
ReqId = $parameters.pm_req_id
and ProvisionItemType = $parameters.pm_item_type
and ApprovalStatus = $parameters.pm_approval
次に、ABAP で消費しました。
SELECT
FROM ygac_i_request_role( pm_req_id = @lv_test,
pm_item_type = @lv_item_type,
pm_approval = @lv_approval
)
FIELDS reqid,
connector,
provisionitemid
INTO TABLE @DATA(lt_result).
_Relation
上記の選択に従ってのリストを取得する方法。