P_PT_DeliveryNumberRange
Delivery Document Number Range
P_PT_DeliveryNumberRange is a Composite CDS View that provides data about "Delivery Document Number Range" in SAP S/4HANA. It reads from 1 data source (I_PT_DeliveryNumberRange) and exposes 11 fields with key fields CompanyCode, VATRegistration, PT_SeriesIdentifier, PT_SeriesDocumentClass. It has 4 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PT_DeliveryNumberRange | I_PT_DeliveryNumberRange | from |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_CompanyCode | _CompanyCode | $projection.CompanyCode = _CompanyCode.CompanyCode |
| [0..1] | P_PT_SimplifiedDelivDocType | _DocType | _DocType.DeliveryDocumentType = $projection.DeliveryDocumentType |
| [0..1] | I_NumberRangeInterval | _NumberRange | _NumberRange.NumberRangeObject = 'GLO_PT_OBD' and _NumberRange.NumberRangeSubObject = $projection.CompanyCode and _NumberRange.NumberRangeInterval = $projection.PT_SeriesNumberRangeInterval |
| [0..1] | P_PT_DgtlSgntrStartDeliveries | _StartDeliv | $projection.CompanyCode = _StartDeliv.CompanyCode and $projection.PT_SeriesNumberRangeInterval = _StartDeliv.PT_SeriesNumberRangeInterval |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Delivery Document Number Range | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #M | view | |
| ObjectModel.usageType.dataClass | #CUSTOMIZING | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (11)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | CompanyCode | ||
| KEY | VATRegistration | |||
| KEY | PT_SeriesIdentifier | PortugueseDgtlSignatureSeries | ||
| KEY | PT_SeriesDocumentClass | |||
| PT_SeriesNumberRangeObject | _NumberRange | NumberRangeObject | ||
| PT_SeriesNumberRangeSubObject | _NumberRange | NumberRangeSubObject | ||
| PT_SeriesNumberRangeToYear | _NumberRange | NumberRangeToYear | ||
| PT_SeriesBusinessProcess | ||||
| PT_SeriesLastNumber | ||||
| DeliveryDocumentType | DeliveryDocumentType | |||
| PT_SeriesNumberRangeInterval | NumberRange |
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Delivery Document Number Range'
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #M,
dataClass: #CUSTOMIZING
}
@VDM.viewType: #COMPOSITE
@VDM.private: true
define view entity P_PT_DeliveryNumberRange
as select from I_PT_DeliveryNumberRange
association [0..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
// Plant abroad scenrio
//association [0..1] to I_CountrySalesTax as _PlantAbroad on _PlantAbroad.CompanyCode = $projection.CompanyCode
// and _PlantAbroad.VATRegistrationCountry = 'PT'
association [0..1] to P_PT_SimplifiedDelivDocType as _DocType on _DocType.DeliveryDocumentType = $projection.DeliveryDocumentType
association [0..1] to I_NumberRangeInterval as _NumberRange on _NumberRange.NumberRangeObject = 'GLO_PT_OBD'
and _NumberRange.NumberRangeSubObject = $projection.CompanyCode
and _NumberRange.NumberRangeInterval = $projection.PT_SeriesNumberRangeInterval
association [0..1] to P_PT_DgtlSgntrStartDeliveries as _StartDeliv on $projection.CompanyCode = _StartDeliv.CompanyCode
and $projection.PT_SeriesNumberRangeInterval = _StartDeliv.PT_SeriesNumberRangeInterval
{
key CompanyCode,
//key coalesce(_CompanyCode.VATRegistration, _PlantAbroad.CompanyVATRegistration) as VATRegistration,
key cast( substring(_CompanyCode.VATRegistration, 3, 18) as stceg) as VATRegistration,
key PortugueseDgtlSignatureSeries as PT_SeriesIdentifier,
key case _DocType.SpecialDocumentType
when 'D'
then 'R'
else 'N'
end as PT_SeriesTypeCode,
key 'MG' as PT_SeriesDocumentClass,
key case
when _StartDeliv.PT_SeriesDocumentType is not initial
then _StartDeliv.PT_SeriesDocumentType
else DeliveryType
end as PT_SeriesDocumentType,
_NumberRange.NumberRangeObject as PT_SeriesNumberRangeObject,
_NumberRange.NumberRangeSubObject as PT_SeriesNumberRangeSubObject,
_NumberRange.NumberRangeToYear as PT_SeriesNumberRangeToYear,
'D' as PT_SeriesBusinessProcess,
cast( case
when LTRIM(_NumberRange.NumberRangeLevel, '0') = ''
then _NumberRange.NumberRangeFromNumber
else
LTRIM(_NumberRange.NumberRangeLevel, '0')
end as glo_pt_series_sn) as PT_SeriesStartNumber,
cast (_NumberRange.NumberRangeToNumber as glo_pt_series_ln) as PT_SeriesLastNumber,
// set editable based on if any documents posted already for this series
// case
// when _SrsDocCount.DocumentCount > 0
// then ''
// else
// 'X'
// end as PT_SeriesValdtnCodeIsEditable,
case
when _StartDeliv.PT_SeriesValdtnCode <> ''
then ''
else
'X'
end as PT_SeriesValdtnCodeIsEditable,
DeliveryDocumentType,
NumberRange as PT_SeriesNumberRangeInterval
}
where
PortugueseDgtlSignatureSeries like 'D___'
and DeliveryType is not initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_NUMBERRANGEINTERVAL",
"I_PT_DELIVERYNUMBERRANGE",
"P_PT_DGTLSGNTRSTARTDELIVERIES",
"P_PT_SIMPLIFIEDDELIVDOCTYPE"
],
"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