Posts

Showing posts from September, 2024

Call CDS view in Report

Image
Call CDS view in report * Create a report program and write code. Report      REPORT  zab_rp_cds_stu .      SELECT  *  FROM  zab_cds_stu  INTO  TABLE  @DATA ( lt_stu ) .      cl_demo_output => display (  lt_stu  ) . Output ************************** * ** Thank You ********************** ** **

Simple CDS view fetch data from single table

Image
 Fetch data from table in CDS view     * 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 and click on finish. 3. Give SQL view name. Code       @AbapCatalog.sqlViewName: 'ZAB_SQL_STU'   @AbapCatalog.compiler.compareFilter: true    @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'student details' define view ZAB_CDS_STU as select from zajay_zstu { key zst_id as ZstId , zst_name as ZstName , zst_dept as ZstDept , zst_fee as ZstFee } 4. Check and activate. Run as ABAP application. Output ************************** * ** Thank You ********************** ** **

Introduction to CDS views

  CDS Views * View: Combine data from more than one table. * Core data service. * There are 2 types of CDS views.          1. HANA CDS view.               - Data base dependent.          2. ABAP CDS view.               - Data base independent.  * In SAP GUI, you can use SDDLAR t-code for displaying CDS views. ************************** * ** Thank You ********************** ** **