A_CustomField

DDL: A_CUSTOMFIELD SQL: ACUSTOMFIELD Type: view

Custom Field

A_CustomField is a CDS View that provides data about "Custom Field" in SAP S/4HANA. It reads from 5 data sources (P_CustomFieldLatestVersion, tadir, cfd_w_rep_bus, P_CustomFieldStatus, cfd_w_rep) and exposes 24 fields with key field CustomFieldID. It has 9 associations to related views.

Data Sources (5)

SourceAliasJoin Type
P_CustomFieldLatestVersion _LatestVersion inner
tadir _MasterLanguage inner
cfd_w_rep_bus _PrimaryBusinessContext inner
P_CustomFieldStatus _Status inner
cfd_w_rep Header from

Associations (9)

CardinalityTargetAliasCondition
[1..*] A_CustomFieldBusinessContext _BusinessContext _BusinessContext.CustomFieldID = Header.external_name
[0..*] A_CustomFieldCDSUsage _CDSUsage _CDSUsage.CustomFieldID = Header.external_name
[0..*] A_CustomFieldODataUsage _ODataUsage _ODataUsage.CustomFieldID = Header.external_name
[0..*] A_CustomFieldBusinessScenario _BusinessScenario _BusinessScenario.CustomFieldID = Header.external_name
[0..*] A_CustomFieldDynproUsage _DynproUsage _DynproUsage.CustomFieldID = Header.external_name
[0..*] A_CustomFieldSOAPUsage _SOAPUsage _SOAPUsage.CustomFieldID = Header.external_name
[0..*] A_CustomFieldUIText _UIText _UIText.CustomFieldID = Header.external_name
[0..*] A_CustomFieldCodeListValue _CodeListValue _CodeListValue.CustomFieldID = Header.external_name
[0..*] A_CustomFieldUIExtendedText _UIExtendedText _UIExtendedText.CustomFieldID = Header.external_name

Annotations (5)

NameValueLevelField
AbapCatalog.sqlViewName ACUSTOMFIELD view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Custom Field view
VDM.lifecycle.contract.type #PUBLIC_REMOTE_API view

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY CustomFieldID cfd_w_rep external_name
TransportOrganizerItemName cfd_w_rep name
Status P_CustomFieldStatus Status
BusinessContext cfd_w_rep_bus business_context
MasterLanguage tadir masterlang
char255asType
Length
Scale
AssociatedBusinessObject cfd_w_rep associated_business_object
char255asAggregation
CodeListUppercaseOnly cfd_w_rep code_list_uppercase_only
CreatedBy cfd_w_rep created_by
clientNULLasCreatedAt
ChangedBy cfd_w_rep last_changed_by
clientNULLasChangedAt
_BusinessContext _BusinessContext
_CDSUsage _CDSUsage
_ODataUsage _ODataUsage
_BusinessScenario _BusinessScenario
_DynproUsage _DynproUsage
_SOAPUsage _SOAPUsage
_UIText _UIText
_CodeListValue _CodeListValue
_UIExtendedText _UIExtendedText
@AbapCatalog.sqlViewName: 'ACUSTOMFIELD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED // TODO: Authorization check?

@EndUserText.label: 'Custom Field'
@VDM.lifecycle.contract.type: #PUBLIC_REMOTE_API

define view A_CustomField
  as select from cfd_w_rep                            as Header
  inner join P_CustomFieldLatestVersion               as _LatestVersion          on  _LatestVersion.name              = Header.name
  inner join P_CustomFieldStatus                      as _Status                 on  _Status.name                     = Header.name      
  inner join cfd_w_rep_bus                            as _PrimaryBusinessContext on  _PrimaryBusinessContext.name     = Header.name 
                                                                                 and _PrimaryBusinessContext.version  = Header.version
                                                                                 and _PrimaryBusinessContext.is_added = ''
  inner join tadir                                    as _MasterLanguage         on  _MasterLanguage.pgmid            = 'R3TR'
                                                                                 and _MasterLanguage.object           = 'CFDF'
                                                                                 and _MasterLanguage.obj_name         = Header.name                                                                     
  association [1..*] to A_CustomFieldBusinessContext  as _BusinessContext        on  _BusinessContext.CustomFieldID   = Header.external_name
  association [0..*] to A_CustomFieldCDSUsage         as _CDSUsage               on  _CDSUsage.CustomFieldID          = Header.external_name
  association [0..*] to A_CustomFieldODataUsage       as _ODataUsage             on  _ODataUsage.CustomFieldID        = Header.external_name
  association [0..*] to A_CustomFieldBusinessScenario as _BusinessScenario       on  _BusinessScenario.CustomFieldID  = Header.external_name
  association [0..*] to A_CustomFieldDynproUsage      as _DynproUsage            on  _DynproUsage.CustomFieldID       = Header.external_name  
  association [0..*] to A_CustomFieldSOAPUsage        as _SOAPUsage              on  _SOAPUsage.CustomFieldID         = Header.external_name  
  association [0..*] to A_CustomFieldUIText           as _UIText                 on  _UIText.CustomFieldID            = Header.external_name
  association [0..*] to A_CustomFieldCodeListValue    as _CodeListValue          on  _CodeListValue.CustomFieldID     = Header.external_name    
  association [0..*] to A_CustomFieldUIExtendedText   as _UIExtendedText         on  _UIExtendedText.CustomFieldID    = Header.external_name   
 {
  key Header.external_name                                                             as CustomFieldID,
      Header.name                                                                      as TransportOrganizerItemName,
      _Status.Status                                                                   as Status,
      _PrimaryBusinessContext.business_context                                         as BusinessContext,
      _MasterLanguage.masterlang                                                       as MasterLanguage,
      cast( case when Header.type = #CFD_FIELD_TYPE.AMOUNT        then 'Amount'
                 when Header.type = #CFD_FIELD_TYPE.ASC_TO_STD or
                      Header.type = #CFD_FIELD_TYPE.ASC_TO_CBO    then 'Association'       
                 when Header.type = #CFD_FIELD_TYPE.BOOLEAN       then 'Boolean'       
                 when Header.type = #CFD_FIELD_TYPE.DATE          then 'Date'
                 when Header.type = #CFD_FIELD_TYPE.EMAIL         then 'EmailAddress'
                 when Header.type = #CFD_FIELD_TYPE.LIST          then 'CodeList'
                 when Header.type = #CFD_FIELD_TYPE.NUMBER        then 'Number'
                 when Header.type = #CFD_FIELD_TYPE.NUMC_TEXT     then 'NumericalText'
                 when Header.type = #CFD_FIELD_TYPE.PHONE         then 'Phone'                      
                 when Header.type = #CFD_FIELD_TYPE.QUANTITY      then 'Quantity'
                 when Header.type = #CFD_FIELD_TYPE.TEXT          then 'Text'
                 when Header.type = #CFD_FIELD_TYPE.TIME          then 'Time'
                 when Header.type = #CFD_FIELD_TYPE.TIMESTAMP     then 'Timestamp'           
                 when Header.type = #CFD_FIELD_TYPE.URL           then 'WebAddress'                      
                 else Header.type end as abap.char( 255 ) )                            as Type,
      cast( Header.length as abap.int4 )                                               as Length,
      cast( Header.scale  as abap.int4 )                                               as Scale,
      Header.associated_business_object                                                as AssociatedBusinessObject,
      cast( case when Header.aggregation = #CFD_FIELD_AGGREGATION.'MAX'  then 'Maximum'
                 when Header.aggregation = #CFD_FIELD_AGGREGATION.'MIN'  then 'Minimum'
                 when Header.aggregation = #CFD_FIELD_AGGREGATION.'NONE' then 'None'
                 when Header.aggregation = #CFD_FIELD_AGGREGATION.'SUM'  then 'Sum'
                 else Header.aggregation end as abap.char( 255 ) )                     as Aggregation,
      Header.code_list_uppercase_only                                                  as CodeListUppercaseOnly,            
      Header.created_by                                                                as CreatedBy,
      dats_tims_to_tstmp( Header.created_on, Header.created_at, 
                          'UTC', $session.client, 'NULL' )                             as CreatedAt, 
      Header.last_changed_by                                                           as ChangedBy,
      dats_tims_to_tstmp( Header.last_changed_on, Header.last_changed_at,   
                          'UTC', $session.client, 'NULL' )                             as ChangedAt, 
      _BusinessContext,
      _CDSUsage,
      _ODataUsage,
      _BusinessScenario,
      _DynproUsage,
      _SOAPUsage,      
      _UIText,
      _CodeListValue,
      _UIExtendedText      
 }
 where Header.version        = _LatestVersion.Version
   and _LatestVersion.origin = #CFD_FIELD_ORIGIN.' '   // consider only Custom Fields (not ABAP Managed Fields)

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_CUSTOMFIELDLATESTVERSION",
"P_CUSTOMFIELDSTATUS",
"CFD_W_REP",
"CFD_W_REP_BUS",
"TADIR"
],
"ASSOCIATED":
[
"A_CUSTOMFIELDBUSINESSCONTEXT",
"A_CUSTOMFIELDBUSINESSSCENARIO",
"A_CUSTOMFIELDCDSUSAGE",
"A_CUSTOMFIELDCODELISTVALUE",
"A_CUSTOMFIELDDYNPROUSAGE",
"A_CUSTOMFIELDODATAUSAGE",
"A_CUSTOMFIELDSOAPUSAGE",
"A_CUSTOMFIELDUIEXTENDEDTEXT",
"A_CUSTOMFIELDUITEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/