cancel
Showing results for 
Search instead for 
Did you mean: 

Assign Role in S4 HANA Public Cloud

JoelleS
Explorer
0 Kudos
520

Hi everyone,

I use Eclipse (ABAP ADT) to create a custom CDS view: 

@AbapCatalog.viewEnhancementCategory: [#NONE]

//@AccessControl.authorizationCheck: #NOT_REQUIRED

//@AccessControl.authorizationCheck: #CHECK

 

@AccessControl: {

authorizationCheck: #CHECK }

 

@EndUserText.label: 'ZJSTR_TEST1'

@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.usageType:{

serviceQuality: #X,

sizeCategory: #S,

dataClass: #MIXED

}

define view entity ZJSTR_TEST1

 

as select from I_Product

association [0..1] to I_ProductText as _Text on $projection.Product = _Text.Product

and _Text.Language = $session.system_language

/*association [0..*] to I_ProductPlantBasic as _ProductPlantBasic on $projection.Product = _ProductPlantBasic.Product*/

association [0..*] to I_MaterialStock_2 as MaterialStock on $projection.Product = MaterialStock.Material

association [0..*] to I_EWM_AvailableStock as EWMAvailableStock on $projection.ProductUUID = EWMAvailableStock.ProductUUID

//association [0..*] to I_SlsPrcgCndnRecdValidity as PrcRecValidities on $projection.Product = PrcRecValidities.Material

//I_SLSPRCGCONDITIONRECORD

 

{

key Product,

MaterialStock,

_Text.ProductName,

ProductType,

EWMAvailableStock,

ProductUUID,

EWMAvailableStock.EWMWarehouse

 

}

 

I defined a role as Access Control

@EndUserText.label: 'ZJSTR_TEST1 AC'

@MappingRole: true

//role ZJSTR_TEST1 {

role ZJSTR_TEST1 {

grant SELECT on ZJSTR_TEST1;

 

}

 

 

How do I assign this role to a user?

 

 

View Entire Topic
0 Kudos

Please perform as below steps:

Step1: Creation of a Data Control Language  or access control for CDS view

Step2: Maintain the relevant authorization object in DCL.

Step3: Maintain respective authorization object and values in PFCG role.

Thanks,

Satheesh Kumar Nendrambaka