A_PurchaseContract_2
Purchase Contract
A_PurchaseContract_2 is a Composite CDS View that provides data about "Purchase Contract" in SAP S/4HANA. It reads from 1 data source (I_PurchaseContract) and exposes 58 fields with key field PurchaseContract. It has 7 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseContract | I_PurchaseContract | from |
Associations (7)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | A_PurchaseContractItem_2 | _PurchaseContractItem | $projection.PurchaseContract = _PurchaseContractItem.PurchaseContract |
| [0..*] | A_PurchaseContractPartners_2 | _PurCtrPartners | $projection.PurchaseContract = _PurCtrPartners.PurchaseContract |
| [0..*] | A_PurContrHdrCndnValdty | _PurContrHdrCndnValdty | $projection.PurchaseContract = _PurContrHdrCndnValdty.PurchaseContract |
| [0..*] | A_PurchaseContractNotes | _Purctrnotes | $projection.PurchaseContract = _Purctrnotes.ArchitecturalObjectNumber ----Extension |
| [0..1] | E_PurchasingDocument | _PurchaseContractExtension | $projection.PurchaseContract = _PurchaseContractExtension.PurchasingDocument |
| [0..*] | I_PurchaseContractStatus | _PurchaseContractStatus | $projection.PurchasingProcessingStatus = _PurchaseContractStatus.PurchasingProcessingStatus |
| [1..1] | I_PurContrConsumptionDetail | _PurContrConsumptionDetail | $projection.PurchaseContract = _PurContrConsumptionDetail.PurchaseContract |
Annotations (19)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | APURCONTRACT2 | view | |
| VDM.lifecycle.contract.type | #PUBLIC_REMOTE_API | view | |
| VDM.viewType | #COMPOSITE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ObjectModel.compositionRoot | true | view | |
| ObjectModel.representativeKey | PurchaseContract | view | |
| ObjectModel.createEnabled | true | view | |
| ObjectModel.updateEnabled | true | view | |
| ObjectModel.deleteEnabled | false | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| EndUserText.label | Purchase Contract | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| OData.entitySet.name | A_PurchaseContract | view |
Fields (58)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseContract | ActivePurchasingDocument | Active Purchase Doc | |
| PurchaseContractType | PurchaseContractType | Order Type | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurchasingDocumentDeletionCode | PurchasingDocumentDeletionCode | Del. Indicator | ||
| CreationDate | CreationDate | Time Stamp | ||
| CreatedByUser | CreatedByUser | User Name | ||
| Supplier | Supplier | Supplier | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| PaymentTerms | PaymentTerms | Pyt Terms | ||
| CashDiscount1Days | CashDiscount1Days | Days from Baseline Date for Payment | ||
| CashDiscount2Days | CashDiscount2Days | Days from Baseline Date for Payment | ||
| NetPaymentDays | NetPaymentDays | Net Pmt Terms Period | ||
| CashDiscount1Percent | CashDiscount1Percent | Disc. Percent 1 | ||
| CashDiscount2Percent | CashDiscount2Percent | Disc. Percent 2 | ||
| DocumentCurrency | DocumentCurrency | Document Currency | ||
| ExchangeRate | Exchange rate | |||
| ExchangeRateIsFixed | ExchangeRateIsFixed | Fixed Exch.Rate | ||
| ValidityStartDate | ValidityStartDate | Validity Start Date | ||
| ValidityEndDate | ValidityEndDate | ValidTo | ||
| QuotationSubmissionDate | QuotationSubmissionDate | Quotation Date | ||
| CorrespncExternalReference | CorrespncExternalReference | Your Reference | ||
| SupplierQuotation | SupplierQuotation | RFQ | ||
| SupplierRespSalesPersonName | SupplierRespSalesPersonName | Salesperson | ||
| SupplierPhoneNumber | SupplierPhoneNumber | Telephone | ||
| SupplyingSupplier | SupplyingSupplier | Goods Supplier | ||
| IncotermsClassification | IncotermsClassification | Incoterms | ||
| IncotermsTransferLocation | IncotermsTransferLocation | Incoterms 2 | ||
| PurchaseContractTargetAmount | PurchaseContractTargetAmount | Target Value | ||
| InvoicingParty | InvoicingParty | Supplier | ||
| CorrespncInternalReference | CorrespncInternalReference | Our Reference | ||
| ReleaseCode | ReleaseCode | Release ind. | ||
| IncotermsVersion | IncotermsVersion | Inco. Version | ||
| IncotermsLocation1 | IncotermsLocation1 | Inco. Location1 | ||
| IncotermsLocation2 | IncotermsLocation2 | Inco. Location2 | ||
| IncotermsLocation1Identifier | ||||
| IncotermsLocation2Identifier | ||||
| IncotermsDvtgLocIdentifier | ||||
| IncotermsDvtgLocDescription | ||||
| IsEndOfPurposeBlocked | IsEndOfPurposeBlocked | Busin. Purp. Cmpltd. | ||
| LastChangeDateTime | LastChangeDateTime | Timestamp | ||
| PurContrLastChgdDteTimeValue | Timestamp | |||
| PurchasingProcessingStatus | PurchasingProcessingStatus | Proc. State | ||
| PurgAggrgdProdCmplncSuplrSts | PurgAggrgdProdCmplncSuplrSts | Supplier Check Sts | ||
| PurchasingProcessingStatusName | ||||
| PurgContractIsInPreparation | ||||
| PurgDocExternalReference | PurgDocExternalReference | Ext. Reference ID | ||
| PurchasingDocumentName | PurchasingDocumentName | Purch. Doc. Name | ||
| PurContrAttentionRequiredText | ||||
| ContractConsumptionInPct | _PurContrConsumptionDetail | ContractConsumptionInPct | Consumption Pct | |
| VersionIsEnabled | VersionIsEnabled | |||
| PurDocHasChgVers | PurDocHasChgVers | |||
| PurchasingDocumentVersion | PurchasingDocumentVersion | Version | ||
| PurchasingDocVersionReasonCode | PurchasingDocVersionReasonCode | Reason | ||
| _PurchaseContractItem | _PurchaseContractItem | |||
| _Purctrnotes | _Purctrnotes | |||
| _PurCtrPartners | _PurCtrPartners | |||
| _PurContrHdrCndnValdty | _PurContrHdrCndnValdty |
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 A_PurchaseContract_2.
-- 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: APURCONTRACT2
CREATE VIEW A_PurchaseContract_2 AS
SELECT
ActivePurchasingDocument AS PurchaseContract,
PurchaseContractType,
CompanyCode,
PurchasingDocumentDeletionCode,
CreationDate,
CreatedByUser,
Supplier,
PurchasingOrganization,
PurchasingGroup,
PaymentTerms,
CashDiscount1Days,
CashDiscount2Days,
NetPaymentDays,
CashDiscount1Percent,
CashDiscount2Percent,
DocumentCurrency,
cast(ExchangeRate as fis_absolute_exchangerate preserving type) AS ExchangeRate,
ExchangeRateIsFixed,
ValidityStartDate,
ValidityEndDate,
QuotationSubmissionDate,
CorrespncExternalReference,
SupplierQuotation,
SupplierRespSalesPersonName,
SupplierPhoneNumber,
SupplyingSupplier,
IncotermsClassification,
IncotermsTransferLocation,
PurchaseContractTargetAmount,
InvoicingParty,
CorrespncInternalReference,
ReleaseCode,
IncotermsVersion,
IncotermsLocation1,
IncotermsLocation2,
cast( ' ' as tminco_loc_1_id ) AS IncotermsLocation1Identifier,
cast( ' ' as tminco_loc_2_id ) AS IncotermsLocation2Identifier,
cast( ' ' as tminco_loc_d_id ) AS IncotermsDvtgLocIdentifier,
cast( ' ' as tminco_loc_d_descr ) AS IncotermsDvtgLocDescription,
IsEndOfPurposeBlocked,
LastChangeDateTime,
cast( LastChangeDateTime as abap.dec(21,7) ) AS PurContrLastChgdDteTimeValue,
PurchasingProcessingStatus,
PurgAggrgdProdCmplncSuplrSts,
_PurchaseContractStatus[1: Language = $session.system_language].PurchasingProcessingStatusName AS PurchasingProcessingStatusName,
cast ('' as boolean) AS PurgContractIsInPreparation,
PurgDocExternalReference,
PurchasingDocumentName,
_PurContrConsumptionDetail._PurContrCriticalityStatus.PurContrCriticalityStatusText AS PurContrAttentionRequiredText,
_PurContrConsumptionDetail.ContractConsumptionInPct AS ContractConsumptionInPct,
VersionIsEnabled,
PurDocHasChgVers,
PurchasingDocumentVersion,
PurchasingDocVersionReasonCode
FROM I_PurchaseContract
LEFT OUTER JOIN A_PurchaseContractItem_2 AS _PurchaseContractItem ON PurchaseContract = _PurchaseContractItem.PurchaseContract -- association [1..*]
LEFT OUTER JOIN A_PurchaseContractPartners_2 AS _PurCtrPartners ON PurchaseContract = _PurCtrPartners.PurchaseContract -- association [0..*]
LEFT OUTER JOIN A_PurContrHdrCndnValdty AS _PurContrHdrCndnValdty ON PurchaseContract = _PurContrHdrCndnValdty.PurchaseContract -- association [0..*]
LEFT OUTER JOIN A_PurchaseContractNotes AS _Purctrnotes ON PurchaseContract = _Purctrnotes.ArchitecturalObjectNumber -- association [0..*]
LEFT OUTER JOIN E_PurchasingDocument AS _PurchaseContractExtension ON PurchaseContract = _PurchaseContractExtension.PurchasingDocument -- association [0..1]
LEFT OUTER JOIN I_PurchaseContractStatus AS _PurchaseContractStatus ON PurchasingProcessingStatus = _PurchaseContractStatus.PurchasingProcessingStatus -- association [0..*]
LEFT OUTER JOIN I_PurContrConsumptionDetail AS _PurContrConsumptionDetail ON PurchaseContract = _PurContrConsumptionDetail.PurchaseContract -- association [1..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