zoukankan      html  css  js  c++  java
  • ABAP CDS

    Syntax

    ... @annotation ...

    Effect

    Specifies Annotation annotation in the definition of a CDS view of the ABAP CDS before statement DEFINE VIEW. The character @ must be placed before the name annotation of the annotation. The table below shows the possible predefined annotations, which can be specified, and their meanings. All other annotations are user-defined annotations.

    annotation value Default Value Meaning
    AbapCatalog.buffering.status #ACTIVE, #SWITCHED_OFF, #NOT_ALLOWED #SWITCHED_OFF SAP buffering active, allowed but not active, not allowed.
    AbapCatalog.buffering.type #SINGLE, #GENERIC, #FULL, #NONE #NONE Buffering type: Single records, generic area, complete or no SAP buffering.
    AbapCatalog.buffering.numberOfKeyFields Number between 0 and k-1 (k is the number of key elements) 0 Number of key elements for buffering generic areas
    AbapCatalog.compiler.compareFilter true, false false If true, the filter conditions of the path expressions of the view are compared. If the same filter condition occurs, the associated join expression is only evaluated once. Otherwise a separate join expression is created and evaluated for each filter condition.
    AbapCatalog.sqlViewName Character string, maximum 16 characters, which consists of letters, numbers and underscores and starts with a namespace prefix. - Mandatory. Name of the view in ABAP Dictionary.
    ClientDependent true, false true true means that the CDS view is client-specific. When accessed using SELECT, automatic client handling is performed.
    DataAging.noAgingRestriction true, false false false means that outdated data is not read.
    EndUserText.label Character string with maximum 60 characters - Descriptive short text of the CDS view.

    The first column shows the annotation name annotation of predefined annotations, the second column shows the possible values value and the third column shows the value, which is implicitly set for value (if the annotation is not explicitly used). If nothing is specified for value, the annotation should be specified without a value.

    Notes

    • The definition of a CDS view for ABAP Dictionary must always contain the predefined annotation AbapCatalog.sqlViewName, which defines the name of the view in the ABAP repository.
    • If a CDS view is configured to be not client-specific with the predefined annotation ClientDependent false, all CDS views that use this view as a data source are also not client-specific.
    • Predefined annotations with multiple-part names, which are introduced with the same names, can be listed together in the relevant annotation list in curly brackets and have the same meaning; for example, @AbapCatalog.buffering:{ status:... type:... }.

    Example

    Additional properties with predefined annotations are defined for the CDS view business_partner (except for the mandatory @AbapCatalog.sqlViewName with the name BPA_VW for the ABAP repository). The short text Business partner and the CDS view is not client-specific.

    @AbapCatalog.sqlViewName: 'BPA_VW'
    @EndUserText.label:       'Business partner'
    @ClientDependent:         false
    define view business_partner as
      select from snwd_bpa
             { key snwd_bpa.bp_id as id,
                   snwd_bpa.bp_role as role,
                   snwd_bpa.company_name,
                   snwd_bpa.phone_number }

    Example

    SAP buffering with single record buffering is activated for the CDS view business_partner.

    @AbapCatalog.sqlViewName:      'BPA_VW'
    @AbapCatalog.buffering.status: #ACTIVE
    @AbapCatalog.buffering.type:   #SINGLE
    define view business_partner as
      select from snwd_bpa
             { key snwd_bpa.bp_id as id,
                   snwd_bpa.bp_role as role,
                   snwd_bpa.company_name,
                   snwd_bpa.phone_number }

    Example

    SAP buffering for a generic area and a key element is activated for the CDS view business_partner.

    @AbapCatalog.sqlViewName:                 'BPA_VW'
    @AbapCatalog.buffering.status:            #ACTIVE
    @AbapCatalog.buffering.type:              #GENERIC
    @AbapCatalog.buffering.numberOfKeyFields: 1
    define view business_partner as
      select from snwd_bpa
            { key snwd_bpa.bp_id as id,
                  snwd_bpa.bp_role as role,
                  snwd_bpa.company_name,
                  snwd_bpa.phone_number }

    Example

    For user-defined annotations, see the example under annotations

  • 相关阅读:
    [LeetCode] Best Time to Buy and Sell Stock with Transaction Fee 买股票的最佳时间含交易费
    Visual Studio Many Projects in One Solution VS中多工程开发
    [LeetCode] 713. Subarray Product Less Than K 子数组乘积小于K
    [LeetCode] Minimum ASCII Delete Sum for Two Strings 两个字符串的最小ASCII删除和
    [LeetCode] Erect the Fence 竖立栅栏
    3D Slicer Reconstruct CT/MRI
    [LeetCode] Partition to K Equal Sum Subsets 分割K个等和的子集
    [LeetCode] Degree of an Array 数组的度
    [LeetCode] Count Binary Substrings 统计二进制子字符串
    [LeetCode] Max Area of Island 岛的最大面积
  • 原文地址:https://www.cnblogs.com/JackeyLove/p/13496747.html
Copyright © 2011-2022 走看看