<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dcl &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/dcl/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sapewmhelp.com</link>
	<description>SAP EWM questions answered by experts — ABAP, S/4HANA, warehouse management</description>
	<lastBuildDate>Fri, 31 Oct 2025 17:42:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>What are DCLs in CDS?</title>
		<link>https://www.sapewmhelp.com/question/what-are-dcls-in-cds/</link>
					<comments>https://www.sapewmhelp.com/question/what-are-dcls-in-cds/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Fri, 31 Oct 2025 17:42:02 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-are-dcls-in-cds</guid>

					<description><![CDATA[DCL (Data Control Language) in CDS is used to define and control data authorizations for CDS views.In other words, it allows you to restrict access to specific data records based on user roles, so that users can only see data they are authorized to see. DCLs are written using the DEFINE ROLE syntax and stored [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>DCL (Data Control Language)</strong> in CDS is used to <strong>define and control data authorizations</strong> for CDS views.<br />In other words, it allows you to <strong>restrict access to specific data records</strong> based on user roles, so that users can only see data they are authorized to see.</p>
<p>DCLs are written using the <strong><code>DEFINE ROLE</code></strong> syntax and stored as <strong>authorization objects</strong> in the ABAP Dictionary.<br />They work in combination with <strong>authorization checks</strong> performed automatically at runtime by the ABAP system — when the CDS view is queried through ABAP, OData, or analytical tools.</p>
<p><strong>Purpose of DCL</strong></p>
<ul>
<li>
<p>To <strong>control access</strong> to data at the CDS view level (not in ABAP code).</p>
</li>
<li>
<p>To ensure <strong>data security</strong> and <strong>compliance</strong> with organizational policies.</p>
</li>
<li>
<p>To <strong>centralize authorization logic</strong> so it’s reusable and not hardcoded in multiple reports or services.</p>
</li>
</ul>
<p>In simple terms:</p>
<blockquote data-start="1081" data-end="1136">
<p>DCL defines <em>who can access what data</em> in a CDS view.</p>
</blockquote>
<p><strong>How DCL Works</strong></p>
<ol>
<li>
<p>A CDS view is defined with an authorization check annotation:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">@AccessControl.authorizationCheck: #CHECK<br />
define view ZCDS_Employee as select from zemployee { &#8230; }</div>
<div></div>
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">2. A DCL (authorization rule) is created using <code>DEFINE ROLE</code>.</div>
</div>
</div>
</div>
<p>It specifies the conditions under which a user can access the data At runtime, when a user executes the CDS view (via report, OData, or Fiori app),<br />the system automatically filters data according to the DCL rule.</li>
</ol>
<p><strong>PFCG Authorization Object Link</strong></p>
<p>The function <code>aspect pfcg_auth('AUTH_OBJECT', 'FIELD')</code> links the DCL to a PFCG (Profile Generator) authorization object.<br />This ensures integration between CDS-level security and SAP’s standard role-based security.</p>
<p>Example authorization object definition:</p>
<ul>
<li>
<p>Authorization object: <code>ZEMP_AUTH_OBJ</code></p>
</li>
<li>
<p>Field: <code>DEPT</code></p>
</li>
<li>
<p>Values assigned in user role (e.g., user only has DEPT = ‘HR’)</p>
</li>
</ul>
<p>Then when user runs the view:</p>
<ul>
<li>
<p>They will only see rows where <code>department = 'HR'</code>.</p>
</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-are-dcls-in-cds/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
