P_PurOrdMaintainItemActAddr

DDL: P_PURORDMAINTAINITEMACTADDR SQL: PPOMAINTITMACTAD Type: view CONSUMPTION Package: ODATA_MM_PUR_PO_MAINTAIN

PO Maintenance: Purchase Order Item Address (Active)

P_PurOrdMaintainItemActAddr is a Consumption CDS View that provides data about "PO Maintenance: Purchase Order Item Address (Active)" in SAP S/4HANA. It reads from 7 data sources and exposes 10 fields with key fields PurchaseOrder, PurchaseOrderItem. Part of development package ODATA_MM_PUR_PO_MAINTAIN.

Data Sources (7)

SourceAliasJoin Type
I_Address adrn2_address left_outer
I_Customer customer left_outer
I_Address customer_address left_outer
I_Address ekpo_address left_outer
ekpo item from
I_Plant plant left_outer
I_Address plant_address left_outer

Annotations (4)

NameValueLevelField
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PPOMAINTITMACTAD view
VDM.private true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder ekpo ebeln Source PurchDoc
KEY PurchaseOrderItem ekpo ebelp Item pur. doc.
PurchaseOrderItemAddressNumber ekpo adrnr Sold-To Address
adrnrendasManualDeliveryAddressID
FullNameendasDeliveryAddressName
StreetNameendasDeliveryAddressStreetName
PostalCodeendasDeliveryAddressPostalCode
CityNameendasDeliveryAddressCityName
RegionendasDeliveryAddressRegion
CountryendasDeliveryAddressCountry

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_PurOrdMaintainItemActAddr.
-- 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: PPOMAINTITMACTAD

CREATE VIEW P_PurOrdMaintainItemActAddr AS
SELECT
  item.ebeln AS PurchaseOrder,
  item.ebelp AS PurchaseOrderItem,
  item.adrnr AS PurchaseOrderItemAddressNumber,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant.AddressID else customer_address.AddressID end else item.adrn2 end else item.adrnr end as ManualDeliveryAddressID AS adrnrendasManualDeliveryAddressID,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant.PlantName else customer_address.FullName end else adrn2_address.FullName end else ekpo_address.FullName end as DeliveryAddressName AS FullNameendasDeliveryAddressName,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant_address.StreetName else customer_address.StreetName end else adrn2_address.StreetName end else ekpo_address.StreetName end as DeliveryAddressStreetName AS StreetNameendasDeliveryAddressStreetName,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant_address.PostalCode else customer_address.PostalCode end else adrn2_address.PostalCode end else ekpo_address.PostalCode end as DeliveryAddressPostalCode AS PostalCodeendasDeliveryAddressPostalCode,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant_address.CityName else customer_address.CityName end else adrn2_address.CityName end else ekpo_address.CityName end as DeliveryAddressCityName AS CityNameendasDeliveryAddressCityName,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant_address.Region else customer_address.Region end else adrn2_address.Region end else ekpo_address.Region end as DeliveryAddressRegion AS RegionendasDeliveryAddressRegion,
  case when item.adrnr = '' or item.adrnr is null then case when item.adrn2 = '' or item.adrn2 is null then case when item.kunnr = '' or item.kunnr is null then plant_address.Country else customer_address.Country end else adrn2_address.Country end else ekpo_address.Country end as DeliveryAddressCountry AS CountryendasDeliveryAddressCountry
FROM ekpo AS item
LEFT OUTER JOIN I_Address AS ekpo_address ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Address AS adrn2_address ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Plant AS plant ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Customer AS customer ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Address AS plant_address ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Address AS customer_address ON /* join condition not captured in parsed metadata */
;