P_CollsAcctDoc
P_CollsAcctDoc is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_CollsSgmtCompanyCodeAssgmt, I_OperationalAcctgDocItem) and exposes 10 fields with key fields CollectionSegment, CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_CollsSgmtCompanyCodeAssgmt | I_CollsSgmtCompanyCodeAssgmt | from |
| I_OperationalAcctgDocItem | I_OperationalAcctgDocItem | inner |
Annotations (12)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PCOLLSACCTDOC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #A | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.representativeKey | AccountingDocument | view |
Fields (10)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CollectionSegment | CollectionSegment | ||
| KEY | CompanyCode | I_CollsSgmtCompanyCodeAssgmt | CompanyCode | |
| KEY | AccountingDocument | AccountingDocument | ||
| KEY | FiscalYear | FiscalYear | ||
| KEY | AccountingDocumentItem | AccountingDocumentItem | ||
| Customer | Customer | |||
| NetDueDate | NetDueDate | |||
| AmountInTransactionCurrency | AmountInTransactionCurrency | |||
| TransactionCurrency | TransactionCurrency | |||
| clientNULLNetDueDateasDaysToDueDate |
@AbapCatalog: { sqlViewName: 'PCOLLSACCTDOC',
compiler: { compareFilter: true },
preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
personalData: { blocking: #BLOCKED_DATA_EXCLUDED } }
@VDM: { viewType: #COMPOSITE,
private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #A,
sizeCategory: #L,
dataClass: #TRANSACTIONAL },
representativeKey: 'AccountingDocument' }
define view P_CollsAcctDoc
as select from I_CollsSgmtCompanyCodeAssgmt
inner join I_OperationalAcctgDocItem on I_CollsSgmtCompanyCodeAssgmt.CompanyCode = I_OperationalAcctgDocItem.CompanyCode
{
// VDM Fields
key CollectionSegment,
key I_CollsSgmtCompanyCodeAssgmt.CompanyCode,
key AccountingDocument,
key FiscalYear,
key AccountingDocumentItem,
Customer,
NetDueDate,
@Semantics: { amount: { currencyCode: 'TransactionCurrency' } }
AmountInTransactionCurrency,
@Semantics: { currencyCode: true }
TransactionCurrency,
// Calculate due/Overdue dates (Positive -> Due in, Negative -> Overdue since
dats_days_between( tstmp_to_dats( tstmp_current_utctimestamp(),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ), NetDueDate ) as DaysToDueDate
}
where
FinancialAccountType = 'D'
and ClearingDate = '00000000'
and TransactionCurrency is not initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COLLSSGMTCOMPANYCODEASSGMT",
"I_OPERATIONALACCTGDOCITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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