R_PrelimBillgDocPartnerTP
Prelim Billing Document Partner - TP
R_PrelimBillgDocPartnerTP is a Transactional CDS View that provides data about "Prelim Billing Document Partner - TP" in SAP S/4HANA. It reads from 1 data source (I_PrelimBillingDocPartner) and exposes 45 fields with key fields PrelimBillingDocument, PartnerFunction. It has 15 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PrelimBillingDocPartner | Partner | from |
Associations (15)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_ContactPerson | _ContactPerson | $projection.ContactPerson = _ContactPerson.ContactPerson |
| [0..1] | I_PartnerFunction | _PartnerFunction | $projection.PartnerFunction = _PartnerFunction.PartnerFunction |
| [0..1] | I_Language | _CorrespondenceLanguage | $projection.CorrespondenceLanguage = _CorrespondenceLanguage.Language |
| [0..1] | I_FormOfAddress | _FormOfAddress | $projection.FormOfAddress = _FormOfAddress.FormOfAddress |
| [0..1] | I_TransportationZone | _TransportationZone | $projection.transportzone = _TransportationZone.TransportZone and $projection.country = _TransportationZone.CountryCode |
| [1] | I_WorkAssignment | _WorkAssignment | $projection.Personnel = _WorkAssignment.WorkAssignment |
| [0..1] | I_OrganizationAddress | _OrganizationAddress | $projection.AddressID = _OrganizationAddress.AddressID and $projection.AddressPersonID = _OrganizationAddress.AddressPersonID and $projection.AddressObjectType = '1' and _OrganizationAddress.AddressRepresentationCode is initial |
| [0..1] | I_PersonAddress | _PersonAddress | $projection.AddressID = _PersonAddress.AddressID and $projection.AddressPersonID = _PersonAddress.AddressPersonID and $projection.AddressObjectType = '2' and _PersonAddress.AddressRepresentationCode is initial |
| [0..1] | I_PersonWorkplaceAddress | _PersonWorkplaceAddress | $projection.AddressID = _PersonWorkplaceAddress.AddressID and $projection.AddressPersonID = _PersonWorkplaceAddress.AddressPersonID and $projection.AddressObjectType = '3' and _PersonWorkplaceAddress.AddressRepresentationCode is initial |
| [0..1] | I_AddrOrgNamePostalAddress | _OrgNamePostalAddress | $projection.AddressID = _OrgNamePostalAddress.AddressID and _OrgNamePostalAddress.AddressRepresentationCode is initial |
| [0..1] | I_AddressPersonName | _PersonName | $projection.AddressPersonID = _PersonName.AddressPersonID and _PersonName.AddressRepresentationCode is initial |
| [0..1] | I_AddrCurDfltLandlinePhoneNmbr | _CurrentDfltLandlinePhoneNmbr | $projection.AddressID = _CurrentDfltLandlinePhoneNmbr.AddressID and $projection.AddressPersonID = _CurrentDfltLandlinePhoneNmbr.AddressPersonID |
| [0..1] | I_AddrCurDefaultEmailAddress | _CurrentDfltEmailAddress | $projection.AddressID = _CurrentDfltEmailAddress.AddressID and $projection.AddressPersonID = _CurrentDfltEmailAddress.AddressPersonID |
| [0..1] | I_AddrCurDfltMobilePhoneNumber | _CurrentDfltMobilePhoneNumber | $projection.AddressID = _CurrentDfltMobilePhoneNumber.AddressID and $projection.AddressPersonID = _CurrentDfltMobilePhoneNumber.AddressPersonID |
| [0..1] | I_AddrCurDefaultFaxNumber | _CurrentDfltFaxNumber | $projection.AddressID = _CurrentDfltFaxNumber.AddressID and $projection.AddressPersonID = _CurrentDfltFaxNumber.AddressPersonID |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view | |
| VDM.viewType | #TRANSACTIONAL | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| EndUserText.label | Prelim Billing Document Partner - TP | view |
Fields (45)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PrelimBillingDocument | |||
| KEY | PartnerFunction | Partner Functn | ||
| Customer | Customer | Sold-to Party | ||
| Supplier | Supplier | Supplier | ||
| Personnel | Personnel | Personnel No. | ||
| ContactPerson | ContactPerson | Contact Person Key | ||
| ReferenceBusinessPartner | ReferenceBusinessPartner | Busn. Partner | ||
| ContactPersonaskunnrelseendasPartner | ||||
| PersonFullNameelseendendasFullName | ||||
| SDDocumentPartnerType | _PartnerFunction | SDDocumentPartnerType | Partner Type | |
| StreetName | _OrgNamePostalAddress | StreetName | Text | |
| HouseNumber | _OrgNamePostalAddress | HouseNumber | House Number | |
| PostalCode | _OrgNamePostalAddress | PostalCode | Postal Code | |
| Country | _OrgNamePostalAddress | Country | Venue: Ctry/Reg | |
| Region | _OrgNamePostalAddress | Region | Venue Region | |
| DistrictName | _OrgNamePostalAddress | DistrictName | District | |
| CityName | _OrgNamePostalAddress | CityName | Name | |
| POBox | _OrgNamePostalAddress | POBox | PO Box | |
| POBoxPostalCode | _OrgNamePostalAddress | POBoxPostalCode | PO Box Postal Code | |
| TaxJurisdiction | _OrgNamePostalAddress | TaxJurisdiction | Tax Jurisdiction | |
| TransportZone | _OrgNamePostalAddress | TransportZone | Transport Zone | |
| AddressID | AddressID | Ship-to address | ||
| AddressPersonID | AddressPersonID | Person Number | ||
| AddressObjectType | AddressObjectType | Address Type | ||
| VATRegistration | VATRegistration | VAT Registration No. | ||
| UnloadingPointName | UnloadingPointName | Unloading Point Name | ||
| BusinessPartnerName1 | _OrgNamePostalAddress | AddresseeName1 | ||
| BusinessPartnerName2 | _OrgNamePostalAddress | AddresseeName2 | ||
| BusinessPartnerName3 | _OrgNamePostalAddress | AddresseeName3 | ||
| BusinessPartnerName4 | _OrgNamePostalAddress | AddresseeName4 | ||
| SDDocPartnerAddressRefType | SDDocPartnerAddressRefType | Adress ind. | ||
| SalesOrganization | _PrelimBillingDocument | SalesOrganization | Sales Organization | |
| BillingDocumentType | _PrelimBillingDocument | BillingDocumentType | Billing Type | |
| IsRelevantForAccrual | _PrelimBillingDocument | IsRelevantForAccrual | Accruals | |
| PBDIsInMyResponsibility | _PrelimBillingDocument | PBDIsInMyResponsibility | ||
| PersonExternalID | ||||
| _PrelimBillingDocument | _PrelimBillingDocument | |||
| _PartnerFunction | _PartnerFunction | |||
| _DfltAddrRprstn | _DfltAddrRprstn | |||
| _CorrespondenceLanguage | _CorrespondenceLanguage | |||
| _FormOfAddress | _FormOfAddress | |||
| _TransportationZone | _TransportationZone | |||
| _ContactPerson | _ContactPerson | |||
| _Country | _OrgNamePostalAddress | _Country | ||
| _Region | _OrgNamePostalAddress | _Region |
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 R_PrelimBillgDocPartnerTP.
-- 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 R_PrelimBillgDocPartnerTP AS
SELECT
cast(Partner.PrelimBillingDocument as prelim_billing_document preserving type) AS PrelimBillingDocument,
cast(PartnerFunction as parvw_unv preserving type ) AS PartnerFunction,
Customer,
Supplier,
Personnel,
ContactPerson,
ReferenceBusinessPartner,
case when Partner.Customer != '' then Partner.Customer when Partner.Supplier != '' then Partner.Supplier when Partner.Personnel != '00000000' then cast(Partner.Personnel as kunnr) when Partner.ContactPerson != '0000000000' then cast(Partner.ContactPerson as kunnr) else '' end as Partner AS ContactPersonaskunnrelseendasPartner,
case Partner.AddressID when '' then case when Partner.ContactPerson != '0000000000' then cast(substring(replace(concat(_ContactPerson.FirstName, concat(' &', _ContactPerson.LastName)), '&', '') ,1,80) as ad_namtext preserving type) when Partner.Personnel != '00000000' then coalesce(_WorkAssignment.PersonFullName, _WorkAssignment._WorkforcePerson.LastName) else '' end else case when Partner.AddressObjectType = '1' then cast(concat_with_space(_OrganizationAddress.AddresseeName1, _OrganizationAddress.AddresseeName2, 1) as ad_namtext) when Partner.AddressObjectType = '2' then _PersonAddress.PersonFullName when Partner.AddressObjectType = '3' then _PersonWorkplaceAddress.PersonFullName else '' end end as FullName AS PersonFullNameelseendendasFullName,
_PartnerFunction.SDDocumentPartnerType AS SDDocumentPartnerType,
_OrgNamePostalAddress.StreetName AS StreetName,
_OrgNamePostalAddress.HouseNumber AS HouseNumber,
_OrgNamePostalAddress.PostalCode AS PostalCode,
_OrgNamePostalAddress.Country AS Country,
_OrgNamePostalAddress.Region AS Region,
_OrgNamePostalAddress.DistrictName AS DistrictName,
_OrgNamePostalAddress.CityName AS CityName,
_OrgNamePostalAddress.POBox AS POBox,
_OrgNamePostalAddress.POBoxPostalCode AS POBoxPostalCode,
_OrgNamePostalAddress.TaxJurisdiction AS TaxJurisdiction,
_OrgNamePostalAddress.TransportZone AS TransportZone,
AddressID,
AddressPersonID,
AddressObjectType,
VATRegistration,
UnloadingPointName,
_OrgNamePostalAddress.AddresseeName1 AS BusinessPartnerName1,
_OrgNamePostalAddress.AddresseeName2 AS BusinessPartnerName2,
_OrgNamePostalAddress.AddresseeName3 AS BusinessPartnerName3,
_OrgNamePostalAddress.AddresseeName4 AS BusinessPartnerName4,
SDDocPartnerAddressRefType,
_PrelimBillingDocument.SalesOrganization AS SalesOrganization,
_PrelimBillingDocument.BillingDocumentType AS BillingDocumentType,
_PrelimBillingDocument.IsRelevantForAccrual AS IsRelevantForAccrual,
_PrelimBillingDocument.PBDIsInMyResponsibility AS PBDIsInMyResponsibility,
_WorkAssignment._WorkforcePerson.PersonExternalID AS PersonExternalID,
_OrgNamePostalAddress._Country AS _Country,
_OrgNamePostalAddress._Region AS _Region
FROM I_PrelimBillingDocPartner AS Partner
LEFT OUTER JOIN I_ContactPerson AS _ContactPerson ON ContactPerson = _ContactPerson.ContactPerson -- association [0..1]
LEFT OUTER JOIN I_PartnerFunction AS _PartnerFunction ON PartnerFunction = _PartnerFunction.PartnerFunction -- association [0..1]
LEFT OUTER JOIN I_Language AS _CorrespondenceLanguage ON CorrespondenceLanguage = _CorrespondenceLanguage.Language -- association [0..1]
LEFT OUTER JOIN I_FormOfAddress AS _FormOfAddress ON FormOfAddress = _FormOfAddress.FormOfAddress -- association [0..1]
LEFT OUTER JOIN I_TransportationZone AS _TransportationZone ON transportzone = _TransportationZone.TransportZone AND country = _TransportationZone.CountryCode -- association [0..1]
LEFT OUTER JOIN I_WorkAssignment AS _WorkAssignment ON Personnel = _WorkAssignment.WorkAssignment -- association [1]
LEFT OUTER JOIN I_OrganizationAddress AS _OrganizationAddress ON AddressID = _OrganizationAddress.AddressID AND AddressPersonID = _OrganizationAddress.AddressPersonID AND AddressObjectType = '1' AND _OrganizationAddress.AddressRepresentationCode is initial -- association [0..1]
LEFT OUTER JOIN I_PersonAddress AS _PersonAddress ON AddressID = _PersonAddress.AddressID AND AddressPersonID = _PersonAddress.AddressPersonID AND AddressObjectType = '2' AND _PersonAddress.AddressRepresentationCode is initial -- association [0..1]
LEFT OUTER JOIN I_PersonWorkplaceAddress AS _PersonWorkplaceAddress ON AddressID = _PersonWorkplaceAddress.AddressID AND AddressPersonID = _PersonWorkplaceAddress.AddressPersonID AND AddressObjectType = '3' AND _PersonWorkplaceAddress.AddressRepresentationCode is initial -- association [0..1]
LEFT OUTER JOIN I_AddrOrgNamePostalAddress AS _OrgNamePostalAddress ON AddressID = _OrgNamePostalAddress.AddressID AND _OrgNamePostalAddress.AddressRepresentationCode is initial -- association [0..1]
LEFT OUTER JOIN I_AddressPersonName AS _PersonName ON AddressPersonID = _PersonName.AddressPersonID AND _PersonName.AddressRepresentationCode is initial -- association [0..1]
LEFT OUTER JOIN I_AddrCurDfltLandlinePhoneNmbr AS _CurrentDfltLandlinePhoneNmbr ON AddressID = _CurrentDfltLandlinePhoneNmbr.AddressID AND AddressPersonID = _CurrentDfltLandlinePhoneNmbr.AddressPersonID -- association [0..1]
LEFT OUTER JOIN I_AddrCurDefaultEmailAddress AS _CurrentDfltEmailAddress ON AddressID = _CurrentDfltEmailAddress.AddressID AND AddressPersonID = _CurrentDfltEmailAddress.AddressPersonID -- association [0..1]
LEFT OUTER JOIN I_AddrCurDfltMobilePhoneNumber AS _CurrentDfltMobilePhoneNumber ON AddressID = _CurrentDfltMobilePhoneNumber.AddressID AND AddressPersonID = _CurrentDfltMobilePhoneNumber.AddressPersonID -- association [0..1]
LEFT OUTER JOIN I_AddrCurDefaultFaxNumber AS _CurrentDfltFaxNumber ON AddressID = _CurrentDfltFaxNumber.AddressID AND AddressPersonID = _CurrentDfltFaxNumber.AddressPersonID -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA