I_PT_SAFTDeliveryCustDetail

DDL: I_PT_SAFTDELIVERYCUSTDETAIL SQL: IPTSAFTCUSTDET Type: view COMPOSITE

Details of Portugal SAFT Customer

I_PT_SAFTDeliveryCustDetail is a Composite CDS View that provides data about "Details of Portugal SAFT Customer" in SAP S/4HANA. It reads from 3 data sources (I_Customer, I_DeliveryDocument, I_PT_DeliveryDgtlSgntr) and exposes 17 fields with key field PortugueseDeliveryNumber. It has 2 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_Customer Cust inner
I_DeliveryDocument deldoc inner
I_PT_DeliveryDgtlSgntr sig from

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_PT_SAFTDeliveryCustomer _NormalCustomer _NormalCustomer.CompanyCode = sig.CompanyCode and _NormalCustomer.PortugueseDeliveryNumber = sig.PortugueseDeliveryNumber
[0..1] I_PT_SAFTDeliveryOneTimeCust _OnetimeCustomer _OnetimeCustomer.CompanyCode = sig.CompanyCode and _OnetimeCustomer.PortugueseDeliveryNumber = sig.PortugueseDeliveryNumber

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName IPTSAFTCUSTDET view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label Details of Portugal SAFT Customer view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY PortugueseDeliveryNumber I_PT_DeliveryDgtlSgntr PortugueseDeliveryNumber Delivery No
DeliveryDocument I_PT_DeliveryDgtlSgntr DeliveryDocument Outbound Delivery
CompanyCode I_PT_DeliveryDgtlSgntr CompanyCode Receiver Company Code
Customer I_Customer Customer Sold-to Party
CityName
Country
PostalCode
StreetName
HouseNumberelseendasHouseNumber
RegionelseendasRegion
HouseNumberelseendasCustAddressNumber
IsOneTimeAccount I_Customer IsOneTimeAccount One-time acct
AddressID I_Customer AddressID Ship-to address
PortugueseCustomerWithVersion _NormalCustomer PortugueseCustomerWithVersion
_NormalCustomer _NormalCustomer
_OnetimeCustomer _OnetimeCustomer
_Addr I_Customer _AddressRepresentation

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 I_PT_SAFTDeliveryCustDetail.
-- 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.
-- SQL view name: IPTSAFTCUSTDET

CREATE VIEW I_PT_SAFTDeliveryCustDetail AS
SELECT
  sig.PortugueseDeliveryNumber AS PortugueseDeliveryNumber,
  sig.DeliveryDocument AS DeliveryDocument,
  sig.CompanyCode AS CompanyCode,
  Cust.Customer AS Customer,
  coalesce ( _NormalCustomer.CityName, Cust._AddressRepresentation.CityName) AS CityName,
  coalesce ( _NormalCustomer.Country, Cust._AddressRepresentation.Country) AS Country,
  coalesce ( _NormalCustomer.PostalCode, Cust._AddressRepresentation.PostalCode) AS PostalCode,
  coalesce ( _NormalCustomer.StreetName, Cust._AddressRepresentation.StreetName) AS StreetName,
  case when _NormalCustomer.CompanyCode is null then Cust._AddressRepresentation.HouseNumber else '' end as HouseNumber AS HouseNumberelseendasHouseNumber,
  case when _NormalCustomer.CompanyCode is null then Cust._AddressRepresentation.Region else '' end as Region AS RegionelseendasRegion,
  case when _NormalCustomer.CompanyCode is null then concat ( Cust._AddressRepresentation.StreetName, Cust._AddressRepresentation.HouseNumber) else '' end as CustAddressNumber AS HouseNumberelseendasCustAddressNumber,
  Cust.IsOneTimeAccount AS IsOneTimeAccount,
  Cust.AddressID AS AddressID,
  _NormalCustomer.PortugueseCustomerWithVersion AS PortugueseCustomerWithVersion,
  Cust._AddressRepresentation AS _Addr
FROM I_PT_DeliveryDgtlSgntr AS sig
INNER JOIN I_DeliveryDocument AS deldoc ON /* join condition not captured in parsed metadata */
INNER JOIN I_Customer AS Cust ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_SAFTDeliveryCustomer AS _NormalCustomer ON _NormalCustomer.CompanyCode = sig.CompanyCode AND _NormalCustomer.PortugueseDeliveryNumber = sig.PortugueseDeliveryNumber  -- association [0..1]
LEFT OUTER JOIN I_PT_SAFTDeliveryOneTimeCust AS _OnetimeCustomer ON _OnetimeCustomer.CompanyCode = sig.CompanyCode AND _OnetimeCustomer.PortugueseDeliveryNumber = sig.PortugueseDeliveryNumber  -- association [0..1]
;