P_MLColl_AcctgDocItemOpen
P_MLColl_AcctgDocItemOpen is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_OperationalAcctgDocItem, P_MLColl_DirectPayers5) and exposes 19 fields with key fields AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_OperationalAcctgDocItem | _AccDoc | from |
| P_MLColl_DirectPayers5 | _DirectPayers | inner |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_ExchangeRateType | kurst | |
| P_TargetCurrency | vdm_v_target_currency | |
| P_SystemDate | sydate |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_BusinessPartnerCustomer | _CustomerToBusinessPartner | $projection.Customer = _CustomerToBusinessPartner.Customer |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMLACCTGDOCIOPEN | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| CompanyCode | ||||
| KEY | AccountingDocument | I_OperationalAcctgDocItem | AccountingDocument | |
| KEY | FiscalYear | I_OperationalAcctgDocItem | FiscalYear | |
| KEY | AccountingDocumentItem | I_OperationalAcctgDocItem | AccountingDocumentItem | |
| Customer | I_OperationalAcctgDocItem | Customer | ||
| BusinessPartner | _CustomerToBusinessPartner | BusinessPartner | ||
| ClearingDate | I_OperationalAcctgDocItem | ClearingDate | ||
| DueCalculationBaseDate | I_OperationalAcctgDocItem | DueCalculationBaseDate | ||
| LastDunningDate | I_OperationalAcctgDocItem | LastDunningDate | ||
| DunningLevel | I_OperationalAcctgDocItem | DunningLevel | ||
| NetDueDate | I_OperationalAcctgDocItem | NetDueDate | ||
| AmountInTransactionCurrency | I_OperationalAcctgDocItem | AmountInTransactionCurrency | ||
| TransactionCurrency | I_OperationalAcctgDocItem | TransactionCurrency | ||
| PaymentTerms | I_OperationalAcctgDocItem | PaymentTerms | ||
| P_SystemDatethen1else0endasIsOverdue | ||||
| P_SystemDateasOverdueDays | ||||
| TargetCurrency | ||||
| trueasAmountInTargetCurrency | ||||
| _Customer | I_OperationalAcctgDocItem | _Customer |
@AbapCatalog: { sqlViewName: 'PMLACCTGDOCIOPEN',
compiler: { compareFilter: true },
preserveKey: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@AccessControl: { authorizationCheck: #NOT_REQUIRED }
@VDM: { private: true,
viewType: #COMPOSITE }
define view P_MLColl_AcctgDocItemOpen
with parameters
P_ExchangeRateType : kurst,
P_TargetCurrency : vdm_v_target_currency,
@Environment: { systemField : #SYSTEM_DATE }
P_SystemDate : sydate
as select from I_OperationalAcctgDocItem as _AccDoc
inner join P_MLColl_DirectPayers5 as _DirectPayers on _AccDoc.CompanyCode = _DirectPayers.CompanyCode
and _AccDoc.Customer = _DirectPayers.Customer
// VDM associations
// Customer to Business Partner
association [0..1] to I_BusinessPartnerCustomer as _CustomerToBusinessPartner on $projection.Customer = _CustomerToBusinessPartner.Customer
{
// VDM fields
key _AccDoc.CompanyCode,
key _AccDoc.AccountingDocument,
key _AccDoc.FiscalYear,
key _AccDoc.AccountingDocumentItem,
_AccDoc.Customer,
_CustomerToBusinessPartner.BusinessPartner,
_AccDoc.ClearingDate,
_AccDoc.DueCalculationBaseDate,
_AccDoc.LastDunningDate,
_AccDoc.DunningLevel,
case when _AccDoc.DunningLevel > '0'
then 1
else 0 end as NumberOfDunnedAcctgDocItems,
_AccDoc.NetDueDate,
_AccDoc.AmountInTransactionCurrency,
_AccDoc.TransactionCurrency,
_AccDoc.PaymentTerms,
case when _AccDoc.NetDueDate < $parameters.P_SystemDate
then 1
else 0
end as IsOverdue,
dats_days_between( _AccDoc.NetDueDate,
$parameters.P_SystemDate) as OverdueDays,
:P_TargetCurrency as TargetCurrency,
@Semantics: { amount: { currencyCode: 'TargetCurrency' } }
currency_conversion(
amount => _AccDoc.AmountInTransactionCurrency,
source_currency => _AccDoc.TransactionCurrency,
target_currency => :P_TargetCurrency,
exchange_rate_date => _AccDoc.DueCalculationBaseDate,
exchange_rate_type => :P_ExchangeRateType,
error_handling => 'SET_TO_NULL',
decimal_shift => #CDSBoolean.true,
round => #CDSBoolean.true ) as AmountInTargetCurrency,
// VDM associations
_AccDoc._Customer
}
where
_AccDoc.DebitCreditCode = 'S'
and _AccDoc.NetDueDate <> '00000000'
and _AccDoc.DueCalculationBaseDate <> '00000000'
and _AccDoc.DocumentDate <= _AccDoc.DueCalculationBaseDate
and _AccDoc.InvoiceReference = ''
and _AccDoc.ClearingDate = '00000000'
and _AccDoc.FinancialAccountType = 'D'
and _AccDoc.AccountingDocumentCategory is initial
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