P_ACMTrdgContrItemTypeQty
P_ACMTrdgContrItemTypeQty is a Basic CDS View in SAP S/4HANA. It reads from 5 data sources (wbhd, wbhi, /accgo/t_cak_typ, wbhk, mara) and exposes 19 fields with key fields ContractNum, TradingContractItem, ContractSubItem.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| wbhd | Business | inner |
| wbhi | ContractItem | inner |
| /accgo/t_cak_typ | ContractTypeDetails | inner |
| wbhk | Header | from |
| mara | Material | inner |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PCONTRITEM | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.type | #INHERITED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.viewType | #BASIC | view | |
| VDM.private | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | ContractNum | wbhi | tkonn | |
| KEY | TradingContractItem | wbhi | tposn | |
| KEY | ContractSubItem | wbhi | tposn_sub | |
| mengeendasTradingContractItemQuantity | ||||
| meinsendasTrdgContractItemUnitOfMeasure | ||||
| ContractMaterial | wbhi | matnr | ||
| ContractPlant | wbhi | werks | ||
| TradingContractType | wbhk | tctyp | ||
| CompanyCode | wbhk | company_code | ||
| DocumentDate | wbhk | erdat | ||
| TradingContractCreatedBy | wbhk | ernam | ||
| SalesOrganization | wbhk | vkorg | ||
| DistributionChannel | wbhk | vtweg | ||
| Division | wbhk | spart | ||
| PurchasingOrganization | wbhd | ekorg | ||
| PurchasingGroup | wbhd | ekgrp | ||
| Commodity | mara | commodity | ||
| CustomerName | wbhk | kunnr | ||
| SupplierName | wbhd | elifn |
@AbapCatalog.sqlViewName: 'PCONTRITEM'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.type: #INHERITED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #BASIC
@VDM.private: true
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
define view P_ACMTrdgContrItemTypeQty
as select from wbhk as Header
inner join /accgo/t_cak_typ as ContractTypeDetails on Header.tctyp = ContractTypeDetails.tctyp
inner join wbhi as ContractItem on Header.tkonn = ContractItem.tkonn
inner join wbhd as Business on Header.tkonn = Business.tkonn
inner join mara as Material on ContractItem.matnr = Material.matnr
{
key ContractItem.tkonn as ContractNum,
key ContractItem.tposn as TradingContractItem,
key ContractItem.tposn_sub as ContractSubItem,
@Semantics.quantity.unitOfMeasure: 'TrdgContractItemUnitOfMeasure'
case ContractItem.menge
when 0
then ContractItem.kwmeng
else ContractItem.menge
end as TradingContractItemQuantity,
@Semantics.unitOfMeasure: true
case ContractItem.meins
when ''
then ContractItem.vrkme
else ContractItem.meins
end as TrdgContractItemUnitOfMeasure,
ContractItem.matnr as ContractMaterial,
ContractItem.werks as ContractPlant,
Header.tctyp as TradingContractType,
Header.company_code as CompanyCode,
Header.erdat as DocumentDate,
Header.ernam as TradingContractCreatedBy,
Header.vkorg as SalesOrganization,
Header.vtweg as DistributionChannel,
Header.spart as Division,
Business.ekorg as PurchasingOrganization,
Business.ekgrp as PurchasingGroup,
Material.commodity as Commodity,
Header.kunnr as CustomerName,
Business.elifn as SupplierName
}
where
(
ContractTypeDetails.contract_type = 'R'
or ContractTypeDetails.contract_type = 'C'
or ContractTypeDetails.contract_type = 'I'
or ContractTypeDetails.contract_type = 'S'
or ContractTypeDetails.contract_type = 'T'
)
and Business.tposn = '000000'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"/ACCGO/T_CAK_TYP",
"MARA",
"WBHD",
"WBHI",
"WBHK"
],
"ASSOCIATED":
[],
"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