P_HR_CompanyCodeAddress
P_HR_CompanyCodeAddress is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_CompanyCode, I_CompanyTaxDetail, I_CompanyTaxDetail) and exposes 34 fields with key fields CompanyCode, Country, Country, Country.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_CompanyCode | I_CompanyCode | union |
| I_CompanyTaxDetail | I_CompanyTaxDetail | from |
| I_CompanyTaxDetail | I_CompanyTaxDetail | union |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #MASTER | view |
Fields (34)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_CompanyTaxDetail | CompanyCode | Receiver Company Code |
| KEY | Country | I_CompanyTaxDetail | Country | Venue: Ctry/Reg |
| VATRegistration | I_CompanyTaxDetail | VATRegistration | VAT Registration No. | |
| VATRegistration_wo_prefix | ||||
| OrganizationName1endasCompanyCodeName | ||||
| AddressID | I_CompanyTaxDetail | AddressID | Ship-to address | |
| PostalCode | I_Address_2 | PostalCode | Postal Code | |
| CityName11asCompanyCodeAddress | ||||
| StreetName | I_Address_2 | StreetName | Text | |
| HouseNumber | I_Address_2 | HouseNumber | House Number | |
| CityName | I_Address_2 | CityName | Name | |
| CompanyCode | Receiver Company Code | |||
| KEY | Country | I_CompanyTaxDetail | Country | Venue: Ctry/Reg |
| VATRegistration | I_CompanyTaxDetail | VATRegistration | VAT Registration No. | |
| VATRegistration_wo_prefix | ||||
| OrganizationName1endasCompanyCodeName | ||||
| AddressID | I_CompanyCode | AddressID | Ship-to address | |
| PostalCode | I_Address_2 | PostalCode | Postal Code | |
| CityName11asCompanyCodeAddress | ||||
| StreetName | I_Address_2 | StreetName | Text | |
| HouseNumber | I_Address_2 | HouseNumber | House Number | |
| CityName | I_Address_2 | CityName | Name | |
| CompanyCode | Receiver Company Code | |||
| KEY | Country | I_CompanyCode | Country | Venue: Ctry/Reg |
| VATRegistration | I_CompanyCode | VATRegistration | VAT Registration No. | |
| VATRegistration_wo_prefix | ||||
| CompanyCodeName | I_CompanyCode | CompanyCodeName | Company Name | |
| AddressID | I_Address_2 | AddressID | Ship-to address | |
| PostalCode | I_Address_2 | PostalCode | Postal Code | |
| CityName11asCompanyCodeAddress | ||||
| StreetName | I_Address_2 | StreetName | Text | |
| HouseNumber | I_Address_2 | HouseNumber | House Number | |
| CityName | I_Address_2 | CityName | Name | |
| PhoneNumber |
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_HR_CompanyCodeAddress.
-- 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_HR_CompanyCodeAddress AS
SELECT
I_CompanyTaxDetail.CompanyCode AS CompanyCode,
I_CompanyTaxDetail.Country AS Country,
I_CompanyTaxDetail.VATRegistration AS VATRegistration,
cast ( (substring(I_CompanyTaxDetail.VATRegistration, 3, 11)) as fiisvat_vatreg_without_prefix) AS VATRegistration_wo_prefix,
case when I_CompanyTaxDetail.CompanyCodeName is not initial then I_CompanyTaxDetail.CompanyCodeName when I_Address_2.OrganizationName1 is not initial then I_Address_2.OrganizationName1 end as CompanyCodeName AS OrganizationName1endasCompanyCodeName,
I_CompanyTaxDetail.AddressID AS AddressID,
I_Address_2.PostalCode AS PostalCode,
concat_with_space( concat(concat_with_space( I_Address_2.StreetName, I_Address_2.HouseNumber, 1), ', ') , concat_with_space(I_Address_2.PostalCode, I_Address_2.CityName, 1), 1 ) as CompanyCodeAddress AS CityName11asCompanyCodeAddress,
I_Address_2.StreetName AS StreetName,
I_Address_2.HouseNumber AS HouseNumber,
I_Address_2.CityName AS CityName,
I_CompanyCode.CompanyCodeName AS CompanyCodeName,
I_Address_2._CurrentDfltLandlinePhoneNmbr.PhoneAreaCodeSubscriberNumber AS PhoneNumber
FROM I_CompanyTaxDetail
-- UNION with additional select branch(es): I_CompanyTaxDetail, I_CompanyCode
;
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