`
JerryWang_SAP
  • 浏览: 1031694 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

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: true
define role ZMX_SalesArea_DCL  {
grant select on ZMX_SalesArea_DCL
where (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_DCL
as select from
I_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的原创文章,请关注公众号"汪子熙":

 
0
0
分享到:
评论

相关推荐

    SAP S/4 HANA Migration to S/4

    SAP S/4 HANA Migration

    S4F10_ZH_Col11.rar SAP S/4HANA 中财务会计的业务流程

    1单元1:SAP S/4HANA概览2课程:介绍SAP HANA和SAP S/4HANA9课程:介绍SAP Fiori14单元2:S/4HANA中的财务会计(FI)概览15课程:概述SAP S/4HANA中的财务会计(FI)组件23单元3:总账(G/L)会计24课程:概述会计核算中的组织...

    S4F03_ZH_Col11.rar 会计向 SAP S/4HANA 的转换

    1单元1:使用Activate方法学习SAP S/4HANA2课程:介绍SAP S/4HANA7课程:概述转换流程14单元2:转换到SAP S/4HANA的准备15课程:解释转换流程23课程:分析每个系统的转换流程入手点34课程:准备转换成SAP S/4HANA43课程:...

    s4f00 Overview of Financials in SAP S/4HANA 2018英文版 PDF

    1Unit1:SAP S/4HANA Finance-Introduction and Overview 2Lesson:Positioning SAP S/4HANA Finance 10Lesson:SAP Fiori 16Unit 2:Business Processes in the SAP S/4HANA Finance Solution 17Lesson:Managing ...

    SAP S/4 HANA SD模块官方教材 S4600_EN_Col08

    SAP S/4 HANA SD模块官方教材 S4600_EN_Col08, 包括Sales Order, Delivery, Billing , Pricing

    UI Technology Guide for SAP S/4HANA 1909

    《SAP S/4HANA 1909 UI技术指南》是一份详细阐述SAP S/4HANA用户界面技术的重要文档,旨在帮助用户更好地理解和利用最新的功能、特性及创新点。SAP S/4HANA是SAP公司推出的下一代企业资源规划系统,其UI(用户界面)...

    SAP S/4 HANA Cloud - SAP S/4 HANA Cloud System Landscapes

    introduce the Starter, Quality, and Production Systems of the SAP S/4 HANA Cloud solution

    S4F01_ZH_Col11.rar面向 SAP ERP FI 专业人士的 SAP S/4HANA 财务会计

    1单元1:SAP S/4HANA的财务概览2课程:介绍SAP HANA与SAP S/4HANA的用途和功能11课程:说明会计的新体系结构16课程:介绍SAP Fiori的用途和功能21课程:概述财务向SAP S/4HANA Finance的迁移29单元2:总账会计30课程:管理...

    Material Requirements Planning with SAP S4HANA.pdf

    根据提供的文件内容,我们可以提取关于SAP S/4HANA中物料需求计划(Material Requirements Planning,简称MRP)的重要知识点。 首先,文档开头提到SAPPRESS是SAP与Rheinwerk Publishing的联合项目。SAPPRESS不仅...

    SAP BW/4HANA Technical Overview

    SAP BW/4HANA是SAP推出的新一代数据仓库应用,旨在帮助企业实现即时数字化运营。它不仅支持传统的本地部署方式,还通过Amazon Web Services(AWS)和SAP HANA Enterprise Cloud(SAP HANA企业云)提供了云端部署选项...

    SAP S/4HANA 项目控制中的业务流程

    SAP S/4HANA 项目控制中的业务流程 SAP S/4HANA 项目控制是指在 SAP S/4HANA 系统中对项目的管理和控制。项目控制是指对项目的计划、执行和监控,以确保项目的目标和范围得到实现。SAP S/4HANA 项目控制提供了一...

    Warehouse Management in SAP S4HANA

    在SAP S/4HANA系统中,仓库管理是一个关键组成部分,它帮助企业高效地管理和优化其内部物流流程。本文将详细探讨SAP S/4HANA的仓库管理功能,包括出库过程、库存移除、拣选、暂存区管理以及装载等环节。 1. 出库...

    SAP S/4HANA and SAP S/4HANA Cloud Extensibility for Customers and Partners

    SAP S/4HANA and SAP S/4HANA Cloud Extensibility for Customers and Partners September 2018 The experience gained from various customer and partner projects has made one thing very clear: Most SAP S/4...

    SAP S/4 HANA Cloud - SAP Cloud Security&Support; Framework

    SAP S/4 HANA Cloud是SAP公司推出的一套集成化的企业资源规划云解决方案,它基于S/4 HANA平台,旨在为各种规模的企业提供实时的数据处理和业务分析功能。而SAP Cloud Security & Support Framework则是SAP为了保障其...

    SAP S4 HANA On-Premise和S4 HANA Cloud

    SAP S/4HANA On-Premise和S4 HANA Cloud是SAP提供的两种不同部署方式的智能ERP解决方案,分别适用于不同需求的企业。S/4HANA On-Premise版本是一个基于SAP HANA内存数据库的ERP业务套件,允许企业在私有云或公有云上...

    S4F02_ZH_Col11.rar 面向 SAP ERP CO 专业人士的 SAP S/4HANA 管理会计

    获取SAP S/4HANA概览21单元2:管理会计中的组织结构和主数据22课程:了解SAP S/4HANA中管理会计的新体系结构27课程:管理组织结构48课程:介绍SAP Fiori59课程:分析报表选项64课程:了解S/4HANA Finance中成本要素的新...

    SAP BW4HANA标准建模指南.pdf

    这部分内容可能介绍如何在异构系统环境中部署这些标准内容,学习部署选项、理解关键设计原则,并且发掘SAP BW/4HANA内容涵盖的应用组件。 文档还包含了版权声明和免责声明,声明了此文档包含的信息是SAP的专有信息...

    SAP BW four HANA 系统课程学习 1

    SAP BW/4 HANA是SAP公司推出的企业数据仓库解决方案,是SAP Business Warehouse(BW)的第四代产品,专为与SAP HANA数据库集成而设计。SAP HANA是一款高性能的内存计算平台,允许数据在内存中进行存储和处理,从而...

Global site tag (gtag.js) - Google Analytics