Posts

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 ********************** ** **

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 ********************** ** **

Introduction to workflows in ABAP

  Workflow Definition: This is the blueprint of the workflow, specifying the sequence of tasks, the roles involved, and the conditions for each step. Workflow Tasks: These are individual activities or steps within the workflow. Tasks can be standard tasks provided by SAP or custom tasks developed by ABAP developers. Business Objects: Workflows often interact with business objects, which are SAP entities (e.g., Purchase Orders, Sales Orders) that represent real-world business items. Agents: These are the users or user groups responsible for completing specific tasks within the workflow. Agents are typically determined based on roles or attributes. Events: Workflows are triggered by events, which are specific actions or changes in the system (e.g., a purchase order is created). Workflow Templates: These are reusable models that define common processes. Templates can be used as the basis for creating new workflows. Workflow Builder: This is a graphical tool used to design and configure

Trigger a workflow when PR is changed

Image
                                          Steps to trigger workflow for PR                                        Object -  BUS2105 Step-1:  Goto T-code  SWDD. Step-2:  Click on  create workflow  button (left top corner) and  save  the workflow. Step-3:  Select  workflow container  in left side and double click on  click to create . Step-4:  Give  element name ,  name ,  short description  under D.type tab. Select  import  under properties tab.  Step-5:  Press  enter  and click on  save. Step-6:  Link the object --  Goto =>  Basic data => click on  start events tab. Step-7:  Select category  'BO'  give object type  'BUS2105 ' and select event  'CHANGED'. Step-8:  Click on  binding  and press enter and click on  active. Step-9:   Save  the workflow and  back  to workflow screen. Step-10:   Right click  on undefined and  click on create  double click on  user decision. Step-11:  Give title like this ( PR &1 Approve/Reject) .  &1 replaced with paramet

Trigger a workflow when Material data (MM01) is created

Image
                                                         Steps to trigger workflow for MM01                                      Object - BUS1001006 Step-1:  Goto T-code  SWDD. Step-2:  Click on  create workflow  button (left top corner) and  save  the workflow. Step-3:  Select  workflow container  in left side and double click on  click to create . Step-4:   Give   element name ,   name ,   short description   under D.type tab. Select   import   under properties tab.  Step-5:  Press  enter  and click on  save. Step-6:  Link the object --  Goto =>  Basic data => click on  start events tab. Step-7:  Select category  'BO'  give object type  'BUS1001006 ' and select event  'CREATED'. Step-8:  Click on  binding  and press enter and click on  active. Step-9:   Save  the workflow and  back  to workflow screen. Step-10:   Right click  on undefined and  click on create  double click on  user decision. Step-11:  Give title like this ( PR &1 Approve/Reject) .  &