P_PurOrdMaintainHeaderActive
P_PurOrdMaintainHeaderActive is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrder) and exposes 45 fields with key field PurchaseOrder. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrder | ekko | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_PurOrdMaintainHeaderDraft | _HeaderDraft | ekko.PurchaseOrder = _HeaderDraft.PurchaseOrder and _HeaderDraft.CreatedByUser != '' |
| [0..1] | P_PurOrdMaintainHeaderActAddr | _HeaderActAddr | ekko.PurchaseOrder = _HeaderActAddr.PurchaseOrder |
Annotations (4)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AbapCatalog.sqlViewName | PPOMAINTHDRACT | view | |
| AccessControl.authorizationCheck | #CHECK | view |
Fields (45)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | I_PurchaseOrder | PurchaseOrder | |
| PurchasingDocumentCategory | ||||
| PurchasingDocumentType | I_PurchaseOrder | PurchaseOrderType | ||
| CompanyCode | I_PurchaseOrder | CompanyCode | ||
| PurchasingOrganization | I_PurchaseOrder | PurchasingOrganization | ||
| PurchasingGroup | I_PurchaseOrder | PurchasingGroup | ||
| Supplier | I_PurchaseOrder | Supplier | ||
| Currency | I_PurchaseOrder | DocumentCurrency | ||
| PaymentTerms | I_PurchaseOrder | PaymentTerms | ||
| CashDiscount1Days | I_PurchaseOrder | CashDiscount1Days | ||
| CashDiscount2Days | I_PurchaseOrder | CashDiscount2Days | ||
| NetPaymentDays | I_PurchaseOrder | NetPaymentDays | ||
| CashDiscount1Percent | I_PurchaseOrder | CashDiscount1Percent | ||
| CashDiscount2Percent | I_PurchaseOrder | CashDiscount2Percent | ||
| ExchangeRate | ||||
| IncotermsClassification | I_PurchaseOrder | IncotermsClassification | ||
| IncotermsTransferLocation | I_PurchaseOrder | IncotermsTransferLocation | ||
| IncotermsVersion | I_PurchaseOrder | IncotermsVersion | ||
| IncotermsLocation1 | I_PurchaseOrder | IncotermsLocation1 | ||
| IncotermsLocation2 | I_PurchaseOrder | IncotermsLocation2 | ||
| CreatedByUser | I_PurchaseOrder | CreatedByUser | ||
| PurchaseOrderDate | I_PurchaseOrder | PurchaseOrderDate | ||
| LastChangeDateTime | ||||
| LastChangeUser | ||||
| InvoicingParty | I_PurchaseOrder | InvoicingParty | ||
| ReleaseIsNotCompleted | I_PurchaseOrder | ReleaseIsNotCompleted | ||
| IsHeld | I_PurchaseOrder | PurchasingCompletenessStatus | ||
| PurchasingDocumentCondition | I_PurchaseOrder | PurchasingDocumentCondition | ||
| PricingProcedure | I_PurchaseOrder | PricingProcedure | ||
| ValidityEndDate | I_PurchaseOrder | ValidityEndDate | ||
| IsEndOfPurposeBlocked | I_PurchaseOrder | IsEndOfPurposeBlocked | ||
| AddressID | _HeaderActAddr | AddressID | ||
| PurchaseOrderAddressNumber | _HeaderActAddr | PurchaseOrderAddressNumber | ||
| AddressName | _HeaderActAddr | AddressName | ||
| AddressStreetName | _HeaderActAddr | AddressStreetName | ||
| AddressHouseNumber | _HeaderActAddr | AddressHouseNumber | ||
| AddressPostalCode | _HeaderActAddr | AddressPostalCode | ||
| AddressCityName | _HeaderActAddr | AddressCityName | ||
| AddressPhoneNumber | _HeaderActAddr | AddressPhoneNumber | ||
| AddressFaxNumber | _HeaderActAddr | AddressFaxNumber | ||
| AddressRegion | _HeaderActAddr | AddressRegion | ||
| AddressCountry | _HeaderActAddr | AddressCountry | ||
| AddressCorrespondenceLanguage | _HeaderActAddr | AddressCorrespondenceLanguage | ||
| char1endasEditState | ||||
| char1endasHasTwin |
// =========================================================================
// PO Maintenance: Purchase Order Header (Active Documents)
// =========================================================================
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AbapCatalog.sqlViewName: 'PPOMAINTHDRACT'
@AccessControl.authorizationCheck: #CHECK
define view P_PurOrdMaintainHeaderActive
as select from I_PurchaseOrder as ekko
association [0..1] to P_PurOrdMaintainHeaderDraft as _HeaderDraft on ekko.PurchaseOrder = _HeaderDraft.PurchaseOrder and _HeaderDraft.CreatedByUser != ''
association [0..1] to P_PurOrdMaintainHeaderActAddr as _HeaderActAddr on ekko.PurchaseOrder = _HeaderActAddr.PurchaseOrder
{
key ekko.PurchaseOrder as PurchaseOrder,
'F' as PurchasingDocumentCategory,
ekko.PurchaseOrderType as PurchasingDocumentType,
ekko.CompanyCode as CompanyCode,
ekko.PurchasingOrganization as PurchasingOrganization,
ekko.PurchasingGroup as PurchasingGroup,
ekko.Supplier as Supplier,
ekko.DocumentCurrency as Currency,
ekko.PaymentTerms as PaymentTerms,
ekko.CashDiscount1Days as CashDiscount1Days,
ekko.CashDiscount2Days as CashDiscount2Days,
ekko.NetPaymentDays as NetPaymentDays,
ekko.CashDiscount1Percent as CashDiscount1Percent,
ekko.CashDiscount2Percent as CashDiscount2Percent,
cast(ekko.ExchangeRate as abap.dec(19,5)) as ExchangeRate,
ekko.IncotermsClassification as IncotermsClassification,
ekko.IncotermsTransferLocation as IncotermsTransferLocation,
ekko.IncotermsVersion as IncotermsVersion,
ekko.IncotermsLocation1 as IncotermsLocation1,
ekko.IncotermsLocation2 as IncotermsLocation2,
ekko.CreatedByUser as CreatedByUser,
ekko.PurchaseOrderDate as PurchaseOrderDate,
cast('19000101120000' as abap.dec(21,7)) as LastChangeDateTime, //default value for active POs for ETag handling
cast('' as abap.char(12)) as LastChangeUser,
ekko.InvoicingParty as InvoicingParty,
ekko.ReleaseIsNotCompleted as ReleaseIsNotCompleted,
ekko.PurchasingCompletenessStatus as IsHeld,
ekko.PurchasingDocumentCondition as PurchasingDocumentCondition,
ekko.PricingProcedure as PricingProcedure,
ekko.ValidityEndDate as ValidityEndDate,
ekko.IsEndOfPurposeBlocked as IsEndOfPurposeBlocked,
_HeaderActAddr.AddressID as AddressID,
_HeaderActAddr.PurchaseOrderAddressNumber as PurchaseOrderAddressNumber,
_HeaderActAddr.AddressName as AddressName,
_HeaderActAddr.AddressStreetName as AddressStreetName,
_HeaderActAddr.AddressHouseNumber as AddressHouseNumber,
_HeaderActAddr.AddressPostalCode as AddressPostalCode,
_HeaderActAddr.AddressCityName as AddressCityName,
_HeaderActAddr.AddressPhoneNumber as AddressPhoneNumber,
_HeaderActAddr.AddressFaxNumber as AddressFaxNumber,
_HeaderActAddr.AddressRegion as AddressRegion,
_HeaderActAddr.AddressCountry as AddressCountry,
_HeaderActAddr.AddressCorrespondenceLanguage as AddressCorrespondenceLanguage,
case when _HeaderDraft.PurchaseOrder is null then cast('0' as abap.char(1))
else cast('2' as abap.char(1))
end as EditState,
case when _HeaderDraft.PurchaseOrder is null then cast('' as abap.char(1))
else cast('X' as abap.char(1))
end as HasTwin
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASEORDER",
"P_PURORDMAINTAINHEADERACTADDR",
"P_PURORDMAINTAINHEADERDRAFT"
],
"ASSOCIATED":
[
"P_PURORDMAINTAINHEADERACTADDR",
"P_PURORDMAINTAINHEADERDRAFT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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