SAP S/4HANA CDS View的訪問控制實現:DCL介紹
來自我的同事Xu Miles
Authorization Objects are business concept, they are distinguished by business scenario.
Therefore, there might be a lot of Authorization Objects using the same Authorization Field. Such as VKORG.
In Sales Planning, there're two Authorization Objects related to Sales Area, V_VBAK_VKO and V_VBRK_VKO, they represent transaction scenario Sales Document and Billing Document repectively. If we want to extract the Sales Area master data, technically we could use any Authorization Object with Authorization Field VKORG, VTWEG, SPART.
However, considering the authorization of the business user, we need to use Authorization Object V_VBAK_VKO and V_VBRK_VKO separately when end user is planning for income sales or sales volume.
To do this, we could use additional CDS view + DCL to realize.
Example on ERG/001:
CDS: ZMX_SalesArea_DCL
DCL: ZMX_SalesArea_DCL
The logic in DCL:
@EndUserText.label: 'Auto assigned mapping role for ZMX_SalesArea_DCL'@MappingRole: truedefine role ZMX_SalesArea_DCL {grant select on ZMX_SalesArea_DCLwhere (SalesPlanPurpose = '0' and (SalesOrganization, DistributionChannel, Division) =aspect pfcg_auth (V_VBAK_VKO, VKORG, VTWEG, SPART, actvt = '03'))OR (SalesPlanPurpose = '1' and (SalesOrganization) =aspect pfcg_auth (V_VBRK_VKO, VKORG, actvt = '03')); }
The logic in the CDS view:
define view ZMX_SalesArea_DCLas select fromI_SalesArea { key SalesOrganization, key DistributionChannel, key Division,'0' as SalesPlanPurpose } union all select from I_SalesArea { key SalesOrganization, key DistributionChannel, key Division,'1' as SalesPlanPurpose };
Authorization test on QW9/910
User: MILES01
Authorization:
Test Report:
REPORT mx_test_sa_dcl. PARAMETERS: p_purp TYPE C LENGTH 1. DATA: lt_tab TYPE STANDARD TABLE OF i_salesarea_dcl. SELECT * FROM i_salesarea_dcl INTO TABLE @lt_tab WHERE salesplanpurpose = @p_purp. LOOP AT lt_tab ASSIGNING FIELD-SYMBOL(<fs_row>). WRITE:/ <fs_row>-salesorganization, <fs_row>-distributionchannel, <fs_row>-division, <fs_row>-salesplanpurpose. ENDLOOP. WRITE:/ 'Finished.'.
The logic flow is that firstly we use SalesPlanUUID to get SalesPlanPurpose, then with SalesPlanPurpose we could get the Sales Area master data via the corresponding Authorization Objects.
SalesPlanPurpose: 0 (Incoming sales)
SalesPlanPurpose: 1(Sales Volume)
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2564239/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP ABAP CDS view 檢視的 Replacement 技術介紹View
- SAP S/4HANA OData Mock Service 介紹Mock
- 開啟SAP CDS view DCL前後的讀取效能對比View
- SAP CDS view單元測試框架Test Double介紹View框架
- SAP CDS view自學教程之十:SAP CDS view擴充套件性(Extensibility)實現原理View套件
- SAP S/4HANA Cloud SDK 入門介紹Cloud
- SAP CDS entity 中使用 @readonly 進行訪問控制
- SAP S/4HANA extensibility擴充套件原理介紹套件
- SAP S/4HANA New Simplified Data Model (NSDM) 模型介紹模型
- SAP S/4HANA裡extension include view和extension view的區別View
- SAP S/4HANA Cross Selling機制介紹ROS
- SAP S/4HANA Cloud 系統整合的一些場景介紹Cloud
- 一些SAP Partners能夠通過二次開發實現打通C/4HANA和S/4HANA的方法介紹
- SAP ABAP CDS view Association 引入的緣由View
- 如何使用SAP HANA Studio的PlanViz分析CDS view效能問題View
- SAP S/4HANA Material Fiori應用的搜尋實現原理
- SAP CDS view自學教程之一:如何測試基於SAP CDS view自動生成的OData服務View
- SAP CDS view自學教程之二:當SAP CDS view被啟用時,背後發生了什麼View
- 如何基於 SAP CDS view 生成 object pageViewObject
- 如何使用 SAP CDS view 中的 currency conversion 功能View
- SAP ABAP CDS view 裡 INNER JOIN 和 Association 的區別View
- 什麼是SAP CDS重定向檢視(Redirect View)?View
- 在 Excel 內使用 ODBC 消費 SAP ABAP CDS viewExcelView
- SAP CDS view自學教程之八:SAP Fiori Elements裡不同型別的annotationView型別
- SAP CDS redirect view支援寫操作嗎,一個實驗來驗證View
- SAP S/4HANA 2020安裝實錄
- SAP S/4HANA Cloud 上 in-app 和 side-by-side 兩種擴充套件方式的介紹CloudAPPIDE套件
- Struts2實現訪問控制
- 【RAC】RAC 實現IP訪問控制
- .net core下訪問控制層的實現
- SAP Commerce Cloud OAuth 實現介紹CloudOAuth
- Jerry的CDS view自學系列View
- 使用CDS view開發SAP Marketing contact的facet追溯工具View
- SAP R/3,SAP ECC 和 SAP S/4HANA 的聯絡和區別
- Generate Distribution Model from SAP ERP to SAP EWM in SAP S/4Hana
- OData服務在SAP CRM,Cloud for Customer和S/4HANA上的實現比較Cloud
- 用訪問控制列表實現網路單向訪問(轉)
- SAP Spartacus checkout 流程的擴充套件(extend)實現介紹套件