APS_COM_CHG_DOC_BASE
Change documents base view
APS_COM_CHG_DOC_BASE is a CDS View that provides data about "Change documents base view" in SAP S/4HANA. It reads from 7 data sources and exposes 19 fields with key fields CDocClass, CDocKey, CDoc, DBTable, DBTableKey. It has 1 association to related views. Part of development package SR_APS_COM_COMMON.
Data Sources (7)
| Source | Alias | Join Type |
|---|---|---|
| t100 | _Text_Changed | left_outer |
| t100 | _Text_Created | left_outer |
| t100 | _Text_Deleted | left_outer |
| I_ChangeDocument | changedoc | from |
| I_ChangeDocumentItem | p | inner |
| dd02t | StructureText | left_outer |
| APS_COM_STRUCT_COMP_DTEL_TXT | tablFields | left_outer |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | aps_user_ddl | _user | changedoc.CreatedByUser = _user.UserID |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Change documents base view | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #M | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CDocClass | I_ChangeDocument | ChangeDocObjectClass | |
| KEY | CDocKey | I_ChangeDocument | ChangeDocObject | |
| KEY | CDoc | I_ChangeDocument | ChangeDocument | |
| KEY | DBTable | I_ChangeDocumentItem | DatabaseTable | |
| KEY | DBTableKey | I_ChangeDocumentItem | ChangeDocTableKey | |
| KEY | FieldName | I_ChangeDocumentItem | ChangeDocDatabaseTableField | |
| KEY | Action | I_ChangeDocumentItem | ChangeDocItemChangeType | |
| textelseendasActionTxt | ||||
| DBTableText | dd02t | ddtext | ||
| CreatedByUser | I_ChangeDocument | CreatedByUser | ||
| CreatedByUsrTxt | _user | UserDescription | ||
| CreationDate | I_ChangeDocument | CreationDate | ||
| CreationTime | I_ChangeDocument | CreationTime | ||
| ChangedAt | ||||
| Attribute | APS_COM_STRUCT_COMP_DTEL_TXT | DataElement | ||
| AttributeText | APS_COM_STRUCT_COMP_DTEL_TXT | DataElementLongText | ||
| NewValue | I_ChangeDocumentItem | ChangeDocNewFieldValue | ||
| OldValue | I_ChangeDocumentItem | ChangeDocPreviousFieldValue | ||
| DBTableKeyUUID |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Change documents base view'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #M,
dataClass: #MIXED
}
define view entity APS_COM_CHG_DOC_BASE
as select from I_ChangeDocument as changedoc
inner join I_ChangeDocumentItem as p on(
p.ChangeDocObject = changedoc.ChangeDocObject
and p.ChangeDocument = changedoc.ChangeDocument
)
left outer join APS_COM_STRUCT_COMP_DTEL_TXT as tablFields on tablFields.TableName = p.DatabaseTable
and tablFields.FieldName = p.ChangeDocDatabaseTableField
left outer join dd02t as StructureText on StructureText.tabname = p.DatabaseTable
and StructureText.as4local = 'A'
and StructureText.as4vers = '0000'
and StructureText.ddlanguage = $session.system_language
left outer join t100 as _Text_Created on _Text_Created.sprsl = $session.system_language
and _Text_Created.arbgb = 'APS_COM_COMMON'
and _Text_Created.msgnr = '027'
left outer join t100 as _Text_Changed on _Text_Changed.sprsl = $session.system_language
and _Text_Changed.arbgb = 'APS_COM_COMMON'
and _Text_Changed.msgnr = '028'
left outer join t100 as _Text_Deleted on _Text_Deleted.sprsl = $session.system_language
and _Text_Deleted.arbgb = 'APS_COM_COMMON'
and _Text_Deleted.msgnr = '029'
association [0..1] to aps_user_ddl as _user on changedoc.CreatedByUser = _user.UserID
{
key changedoc.ChangeDocObjectClass as CDocClass,
key changedoc.ChangeDocObject as CDocKey,
key changedoc.ChangeDocument as CDoc,
key p.DatabaseTable as DBTable,
key p.ChangeDocTableKey as DBTableKey,
key p.ChangeDocDatabaseTableField as FieldName,
key p.ChangeDocItemChangeType as Action,
case $projection.Action
when 'I' then _Text_Created.text
when 'J' then _Text_Created.text
when 'U' then _Text_Changed.text
when 'D' then _Text_Deleted.text
when 'E' then _Text_Deleted.text
else ''
end as ActionTxt,
StructureText.ddtext as DBTableText,
changedoc.CreatedByUser as CreatedByUser,
_user.UserDescription as CreatedByUsrTxt,
changedoc.CreationDate as CreationDate,
changedoc.CreationTime as CreationTime,
concat($projection.CreationDate, $projection.CreationTime) as ChangedAt,
tablFields.DataElement as Attribute,
tablFields.DataElementLongText as AttributeText,
p.ChangeDocNewFieldValue as NewValue,
p.ChangeDocPreviousFieldValue as OldValue,
// if db table key is a uuid, cast it to according length. can be used in other views
cast( ltrim( $projection.DBTableKey, ' ' ) as abap.char(32) ) as DBTableKeyUUID
}
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA