我创建了一个 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
根据上面的选择获取列表。