Posts

Showing posts from October, 2024

Joins in CDS view

Inner Join - Inner join returns common entries from both the tables. Left Outer join - Left Outer Join returns all entries from left table even when there is no matching record/entry in right table.  Right Outer join - Right outer join returns all entries from right table even when there is no matching entry in left table.                                                   Refer Joins -   Joins in CDS view ************************** * ** Thank You ********************** ** **

Call CDS view in another CDS view

Image
                             Refer created CDS view -  Created CDS view Create 2 CDS view 1. Right click on  object  and select  new.  Click on  other repository objects . Expand  core data service  and double click on  data definition. 2. Give CDS entity  name  and  description.  Click on  next  select  package/TR  and select  define view  and click on  finish. 3. Give  SQL  view name. CDS view 1-  ZAB_CDS_STU CDS view 2-  zab_cds_call_view Code  @AbapCatalog.sqlViewName: 'ZAB_SQL_CALL' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Call cds view in another cds view' define view zab_cds_call_view as select from ZAB_CDS_STU { key ZstId , ZstName , ZstDept , ZstFee } Output ************************** * ** Thank You ********************** ** **

Alias in CDS view

Image
  * Data in  SE11. Create CDS view 1. Right click on  object  and select  new.  Click on  other repository objects . Expand  core data service  and double click on  data definition. 2. Give CDS entity  name  and  description.  Click on  next  select  package/TR  and select  define view with parameters  and click on  finish. 3. Give  SQL  view name. Code @AbapCatalog.sqlViewName: 'ZAB_SQL_ALIAS' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Alias in cds views' define view zab_cds_alias with parameters p_dept : zst_dept as select from zajay_zstu { key zst_id as Student_ID , zst_name as Student_name , zst_dept as Student_dept , zst_fee as Student_fee } where zst_dept = : p_dept Input Output ************************** * ** Thank You ********************** ** **

CDS view with input parameters

Image
  * Data in  SE11. Create CDS view 1. Right click on  object  and select  new.  Click on  other repository objects . Expand  core data service  and double click on  data definition. 2. Give CDS entity  name  and  description.  Click on  next  select  package/TR  and select  define view with parameters  and click on  finish. 3. Give  SQL  view name. Code @AbapCatalog.sqlViewName: 'ZAB_SQL_IP_STU' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'input parameters in cds views' define view zab_cds_ip_stu with parameters p_dept : zst_dept as select from zajay_zstu { key zst_id as ZstId , zst_name as ZstName , zst_dept as ZstDept , zst_fee as ZstFee } where zst_dept = : p_dept 4. Check and activate. Run as ABAP application. Input Output ************************** * ** Thank You ********************** ** **