P_PT_SelfBillingNumberRange

DDL: P_PT_SELFBILLINGNUMBERRANGE Type: view_entity COMPOSITE Package: ID-SIGN-PT-MM

Self Billing Invoice Number Range

P_PT_SelfBillingNumberRange is a Composite CDS View that provides data about "Self Billing Invoice Number Range" in SAP S/4HANA. It reads from 1 data source (I_PT_SelfBillingNumberRange) and exposes 14 fields with key fields CompanyCode, PT_VATRegistrationCompanyCode, Supplier, stceg318asstcegendasVATRegistration, PT_SeriesIdentifier. It has 5 associations to related views. Part of development package ID-SIGN-PT-MM.

Data Sources (1)

SourceAliasJoin Type
I_PT_SelfBillingNumberRange I_PT_SelfBillingNumberRange from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_NumberRangeInterval _NumberRange _NumberRange.NumberRangeObject = 'J_1AOFFDOC' and $projection.PT_SeriesNumberRangeSubObject = _NumberRange.NumberRangeSubObject and $projection.PT_SeriesNumberRangeInterval = _NumberRange.NumberRangeInterval
[0..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] I_PT_DgtlSgntrStrtSelfBillg _StartSelfBillg $projection.CompanyCode = _StartSelfBillg.CompanyCode and $projection.PT_SeriesNumberRangeInterval = _StartSelfBillg.PT_SeriesNumberRangeInterval and $projection.PT_SeriesNumberRangeSubObject = _StartSelfBillg.NumberRangeSubObject
[0..1] lfas _Vendor $projection.Supplier = _Vendor.lifnr and _Vendor.land1 = 'PT'

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Self Billing Invoice Number Range view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #CUSTOMIZING view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (14)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode Receiver Company Code
KEY PT_VATRegistrationCompanyCode
KEY Supplier Supplier Supplier
KEY stceg318asstcegendasVATRegistration
KEY PT_SeriesIdentifier PT_SeriesIdentifier Series ID
KEY PT_SeriesTypeCode
KEY PT_SeriesDocumentClass
PT_SeriesNumberRangeObject _NumberRange NumberRangeObject
PT_SeriesNumberRangeToYear _NumberRange NumberRangeToYear
PT_SeriesBusinessProcess
PT_SeriesLastNumber
PrmtHbAccountingDocumentType PrmtHbAccountingDocumentType Document Type
PT_SeriesNumberRangeSubObject PT_SeriesNumberRangeSubObject Triggering obj.
PT_SeriesNumberRangeInterval PT_SeriesNumberRangeInterval Number Range

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_PT_SelfBillingNumberRange.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.

CREATE VIEW P_PT_SelfBillingNumberRange AS
SELECT
  CompanyCode,
  cast( substring(_CompanyCode.VATRegistration, 3, 18) as stceg) AS PT_VATRegistrationCompanyCode,
  Supplier,
  case when _Supplier.Country = 'PT' then case when _Supplier.VATRegistration is not initial then cast( substring(_Supplier.VATRegistration, 3, 18) as stceg) else cast( substring(_Supplier.TaxNumber1, 3, 18) as stceg) end else cast( substring(_Vendor.stceg, 3, 18) as stceg) end as VATRegistration AS stceg318asstcegendasVATRegistration,
  PT_SeriesIdentifier,
  cast( 'S' as sipt_spectype ) AS PT_SeriesTypeCode,
  'MG' AS PT_SeriesDocumentClass,
  _NumberRange.NumberRangeObject AS PT_SeriesNumberRangeObject,
  _NumberRange.NumberRangeToYear AS PT_SeriesNumberRangeToYear,
  'S' AS PT_SeriesBusinessProcess,
  cast (_NumberRange.NumberRangeToNumber as glo_pt_series_ln) AS PT_SeriesLastNumber,
  PrmtHbAccountingDocumentType,
  PT_SeriesNumberRangeSubObject,
  PT_SeriesNumberRangeInterval
FROM I_PT_SelfBillingNumberRange
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_NumberRangeInterval AS _NumberRange ON _NumberRange.NumberRangeObject = 'J_1AOFFDOC' AND PT_SeriesNumberRangeSubObject = _NumberRange.NumberRangeSubObject AND PT_SeriesNumberRangeInterval = _NumberRange.NumberRangeInterval  -- association [0..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [0..1]
LEFT OUTER JOIN I_PT_DgtlSgntrStrtSelfBillg AS _StartSelfBillg ON CompanyCode = _StartSelfBillg.CompanyCode AND PT_SeriesNumberRangeInterval = _StartSelfBillg.PT_SeriesNumberRangeInterval AND PT_SeriesNumberRangeSubObject = _StartSelfBillg.NumberRangeSubObject  -- association [0..1]
LEFT OUTER JOIN lfas AS _Vendor ON Supplier = _Vendor.lifnr AND _Vendor.land1 = 'PT'  -- association [0..1]
;