Skip to Content

Writing DCLs on Union Views in CDS – Part 2

Continuing from “Writing DCLs on Union Views in CDS – Part 1” ,

  1. Now , let’s try giving no authorization to display Refregirator products under this role .

2. Let’s create DCL ( Access Control ) on the union view :


CASE 1 : AND condition with aspect_pfcg statements in DCL

Let’s execute the union view and see the result :

RESULT : Since, Refregirator view did not pass through authorization, none of the other product records are displayed too. 

This is not what we wanted.

CASE 2 : OR condition with aspect_pfcg statements in DCL

Let’s execute the union view and see the result :

RESULT : Since Other product views passed the authorization, even refregirator product records are visible to user due to OR condition. 

This is not what we wanted .

CASE 3 (Solution) : Multiple grant select statements with where condition in a DCL

Here multiple grant select statements are written on same view . See the difference from above cases. 

Let’s execute the union view and see the result :


The refregirator products are not displayed to the user since there is no authorization and rest all products are visible. 

This is what we wanted and meeting our expected requirement.


You must be Logged on to comment or reply to a post.
  • Sorry but I'm rather confused why did this require a two-part blog? This could've been simply stated in 2-3 paragraphs IMHO.

    Case 1 and 2 here are the predictable result of using AND and OR conditions. This is computer science 101 (I'm pretty sure these days this is covered even in high school program).

    It's nice of you to share but I feel including so much redundant information and splitting this into two blogs (without providing links to navigate between them) does disservice to the readers.

    Thank you.

      • I understand that but 2/3 of the blog (Case 1 and 2) is basically an explanation of how the logical conditions AND and OR work. How far does the "beginning" need to go? I'd think an average SCN member should already know this by the time they get a degree. And it has nothing to do with CDS specifically.

        I'm not saying there should be no blogs for beginners on SCN but I feel it's not really necessary to explain basic concepts at length. Single page blogs are easier to consume, bookmark and follow.

        This is all just IMHO, of course. If you search in Google for "DCL" though you'll find a blog on the same subject posted back in February. It seems to be more informative. I might as well count myself as CDS beginner (don't have access to such advanced SAP system yet) but had no trouble understanding what was written there.

  • Personally I think this is fine, its clearly an introductory blog on CDS, and its simple and easy to follow, and I easily found the links from the first blog to the second.  I don't see any problem with SDN being a place to educate beginners too, and most CS courses do not include CDS ( or anything SAP for that matter ).

    • My comment was about AND/OR conditions. This is not a CDS concept and is covered in CS program if not in high school these days.

      There is nothing wrong with the introductory blogs in general.