Posts

Showing posts from August, 2023

Taking input from user in cds view

Image
  @AbapCatalog.sqlViewName: 'ZCDS_VIEW_INPUT1' define view zajay_cds_view_input1 with parameters p_mgroup : matkl , p_mtype : mtart as select from mara { matnr , matkl , mtart , ntgew } where mtart = : p_mtype and matkl =: p_mgroup Input           output

association in cds views

Image
  Sale Order Item @AbapCatalog.sqlViewName: 'ZSO_VBAP' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'sale order item' define view zso_vbap1 as select from vbap { key vbeln as Sale_Order , key posnr as Item_num , matnr as Material_num , matwa as Material_Entered } Sale Order Header @AbapCatalog.sqlViewName: 'ZSALE_VBAK' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'sale order header' define view zso_vbak1 as select from vbak as a association [ 1 ..*] to zso_vbap1 as b on a . vbeln = b . Sale_Order { key a . vbeln as Sale_Order , a . erdat as Creation_date , a . erzet as Creation_time , b . Item_num as Item_num , b . Material_num as Material_num , b . Material_Entered as

Joins in cds views

Image
Take two tables  1)  zajay_stu           2) zajay_stu1                               Apply inner join   @AbapCatalog.sqlViewName: 'ZST_INNER' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'student innerjoin' define view zast_inner as select from zajay_stu as a inner join zajay_stu1 as b on a . zst_id = b . zst_id { key a . zst_id as ZstId , a . zst_name as ZstName , a . zst_dept as ZstDept , a . zst_fee as ZstFee , b . zst_fn as ZstFn , b . zst_ln as ZstLn } output         Apply Left outer join @AbapCatalog.sqlViewName: 'ZST_INNER' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'student innerjoin' define view zast_inner as select from zajay_stu as a left outer join zajay_stu1 as b on a . zst_i

fetch data from single table using cds views

  @AbapCatalog.sqlViewName: 'ZST_DETAILS' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'student deatils' define view zstu_details as select from zajay_stu { key zst_id as Student_Id , zst_name as Student_tName , zst_dept as Student_Dept , zst_fee as Student_Fee }