@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.sqlViewName: 'CCONTRACTFS'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Purchase Contract'
@AbapCatalog.preserveKey: true
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@VDM.viewType: #CONSUMPTION
@AccessControl.authorizationCheck: #CHECK
@UI.headerInfo: {
typeName: 'Purchase Contract', typeName_AsOtr: '005056B2532A1EE588FAB969558059B1',
typeNamePlural: 'Purchase Contract', typeNamePlural_asOtr: '005056B2532A1EE588FAB969558059B1',
typeImageUrl: '/sap/bc/ui5_ui5/sap/mm_contrs1/images/contract.jpg',
title.value: 'PurchasingDocumentTypeName',
description.value: 'ActivePurchasingDocument' }
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #MIXED
define view C_ContractFs
as select from I_PurchaseContractVersion
association [1..*] to I_PurchaseContractHistory as _PurchaseContractHistory on $projection.PurchaseContract = _PurchaseContractHistory.PurchaseContract
association [1..*] to C_ContractItemFs as _PurchaseContractItem on $projection.PurchaseContract = _PurchaseContractItem.PurchaseContract
association [1..*] to C_PurContractItemHierFactSheet as _PurContractItemHierFs on $projection.PurchaseContract = _PurContractItemHierFs.PurchaseContract
association [0..*] to C_ContractFactSheetHeaderText as _ContractFactSheetHeaderText on $projection.PurchaseContract = _ContractFactSheetHeaderText.PurchaseContract
association [0..*] to I_PurchasingDocumentTypeText as _PurchasingDocumentTypeText on $projection.PurchasingDocumentCategory = _PurchasingDocumentTypeText.PurchasingDocumentCategory
and $projection.PurchaseContractType = _PurchasingDocumentTypeText.PurchasingDocumentType
association [0..1] to I_PurchasingDocumentTypeText as _PurchasingDocumentTypeName on $projection.PurchasingDocumentCategory = _PurchasingDocumentTypeName.PurchasingDocumentCategory
and $projection.PurchaseContractType = _PurchasingDocumentTypeName.PurchasingDocumentType
and _PurchasingDocumentTypeName.Language = $session.system_language
association [0..*] to I_PurgDocumentCategoryText as _PurgDocumentCategoryText on $projection.PurchasingDocumentCategory = _PurgDocumentCategoryText.PurchasingDocumentCategory
association [0..*] to I_IncotermsClassificationText as _IncotermsClassificationText on $projection.IncotermsClassification = _IncotermsClassificationText.IncotermsClassification
association [0..*] to I_ReleaseCodeText as _ReleaseCodeText on $projection.ReleaseCode = _ReleaseCodeText.ReleaseCode
association [0..*] to I_PaymentTermsText as _PaymentTermsText on $projection.PaymentTerms = _PaymentTermsText.PaymentTerms
association [1..1] to I_PurCtrIncoVersion as _PurCtrIncotermsVersion on $projection.IncotermsVersion = _PurCtrIncotermsVersion.IncotermsVersion
// association [0..*] to I_PurchasingDocContactCard as _ContactCard on (
// _ContactCard.ContactCardType = 'User'
// and _ContactCard.ContactCardID = $projection.CreatedByUser
// and _ContactCard.ContactCardRole = 'Purchaser'
// )
// or(
// _ContactCard.ContactCardType = 'User'
// and _ContactCard.ContactCardID = $projection.CreatedByUser
// and _ContactCard.ContactCardRole = 'Creator'
// )
// or(
// _ContactCard.ContactCardType = 'Address'
// and _ContactCard.ContactCardID = $projection.SupplierAddressID
// and _ContactCard.ContactCardRole = 'Supplier'
// )
// or(
// _ContactCard.ContactCardType = 'Supplier'
// and _ContactCard.ContactCardID = $projection.Supplier
// and _ContactCard.ContactCardRole = 'Supplier'
// )
// or(
// _ContactCard.ContactCardType = 'Supplier'
// and _ContactCard.ContactCardID = $projection.SupplyingSupplier
// and _ContactCard.ContactCardRole = 'Goods Supplier'
// )
// or(
// _ContactCard.ContactCardType = 'Supplier'
// and _ContactCard.ContactCardID = $projection.InvoicingParty
// and _ContactCard.ContactCardRole = 'Invoicing Party'
// )
// // or (_ContactCard.ContactCardType = 'SupplierContact' and _ContactCard.ContactCardID = $projection.Supplier)
// // or (_ContactCard.ContactCardType = 'PurchasingDocument' and _ContactCard.ContactCardID = $projection.PurchaseContract)
association [1..1] to I_SupplierOrAddressContactCard as _SupplierHeadOffice on (
_SupplierHeadOffice.ContactCardType = 'Address'
and _SupplierHeadOffice.ContactCardID = $projection.SupplierAddressID
and _SupplierHeadOffice.ContactCardRole = 'Supplier'
)
association [1..1] to I_SupplierOrAddressContactCard as _SupplierHeadOffice1 on (
// _SupplierHeadOffice.ContactCardType = 'Address'
// and _SupplierHeadOffice.ContactCardID = $projection.SupplierAddressID
// and _SupplierHeadOffice.ContactCardRole = 'Supplier'
// )
//or(
_SupplierHeadOffice1.ContactCardType = 'Supplier'
and _SupplierHeadOffice1.ContactCardID = $projection.Supplier
and _SupplierHeadOffice1.ContactCardRole = 'Supplier'
)
//Extension Association
association [1] to E_PurchasingDocument as _Extension on $projection.PurchaseContract = _Extension.PurchasingDocument
{
@UI.lineItem: [{
// qualifier: 'Contract', //In a ListReport will be shown LineItem annotated fields without a qualifier only
position: 10,
importance: #HIGH }]
@UI.identification: {position: 5, importance: #HIGH }
@Consumption.semanticObject: 'PurchaseContract'
@UI.hidden: true
key I_PurchaseContractVersion.PurchaseContract,
@UI.lineItem: [{ position: 10, label: 'Purchase Contract', importance: #HIGH }]
@UI.identification: {position: 5, importance: #HIGH }
@Consumption.semanticObject: 'PurchaseContract'
@EndUserText.label: 'Purchase Contract'
I_PurchaseContractVersion.ActivePurchasingDocument,
@ObjectModel.readOnly: true
@EndUserText.label: 'Version'
@UI: { dataPoint : {title: 'Version'} }
@ObjectModel.text.element: ['ChangeRequestNote']
@UI.textArrangement: #TEXT_FIRST
PurchasingDocumentVersion,
@UI.hidden: true
@Semantics.text: true
_VersionType.ChangeRequestNote,
@ObjectModel.text.association: '_PurchasingDocumentTypeName'
I_PurchaseContractVersion.PurchaseContractType,
@UI.hidden: true
_PurchasingDocumentTypeName.PurchasingDocumentTypeName,
@ObjectModel.text.association: '_PurgDocumentCategoryText'
I_PurchaseContractVersion.PurchasingDocumentCategory,
@ObjectModel.text.association: '_IncotermsClassificationText'
@UI.fieldGroup: [{
qualifier: 'DeliveryandPayment',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 20,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 20,
exclude: false,
importance: #HIGH
}]
I_PurchaseContractVersion.IncotermsClassification,
I_PurchaseContractVersion.CreationDate,
@Semantics.currencyCode:true
I_PurchaseContractVersion.DocumentCurrency,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
@UI.identification: [{
position: 10,
importance: #HIGH }]
@UI.lineItem: [{
// qualifier: 'Contract',
position: 30,
importance: #HIGH }]
@UI.dataPoint: {
title: 'Target Value', title_asOtr: '005056B2532A1ED58CA9FB4462B2A9B7' }
I_PurchaseContractVersion.PurchaseContractTargetAmount,
@UI.identification: [{
position: 90,
importance: #HIGH }]
@UI.lineItem: [{
position: 90,
importance: #HIGH }]
@UI.textArrangement: #TEXT_ONLY
@ObjectModel.text.association: '_VersionReasonValHelp'
@EndUserText.label: 'Reason for New Version'
PurchasingDocVersionReasonCode,
@ObjectModel.text.association: '_ReleaseCodeText'
// @UI.lineItem: [{
// // qualifier: 'Contract',
// position: 40,
// importance: #HIGH }]
// @UI.dataPoint: {
// title: 'Status', title_asOtr: '005056B2532A1EE585B97A4F343C0274' }
I_PurchaseContractVersion.ReleaseCode,
I_PurchaseContractVersion.PurchasingProcessingStatus,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_PURCONTR_FS_ITEM_TRA_EXIT'
}
@UI.lineItem: [{
position: 40,
importance: #HIGH }]
@UI: {
dataPoint: { title: 'Purchasing Document Status' }}
cast( '' as val_text) as PurchasingDocumentStatusName,
@ObjectModel.text.element: [ 'SupplierName' ]
@UI.fieldGroup: [{ //^3351437
qualifier: 'Supplier',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 10,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail3',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 10,
exclude: false,
importance: #HIGH
}] //v3351437
@UI.lineItem: [{
// qualifier: 'Contract',
position: 20,
importance: #HIGH }]
@UI.dataPoint: { title: 'Supplier' }
@Consumption.semanticObject: 'Supplier'
@UI.textArrangement: #TEXT_FIRST
I_PurchaseContractVersion.Supplier,
// cast(I_PurchaseContract._Supplier.AddressID as ContactCardAddress) as AddressID,
// _Supplier.SupplierName,
// _Supplier._StandardAddress.StreetName,
// _Supplier._StandardAddress.HouseNumber,
// _Supplier._StandardAddress.CityName,
// _Supplier._StandardAddress.PostalCode,
// _Supplier._StandardAddress._DefaultEmailAddress.EmailAddress,
// _Supplier._StandardAddress._DefaultMobilePhoneNumber.PhoneNumber as MobilePhoneNumber,
// _Supplier._StandardAddress._DefaultMobilePhoneNumber.InternationalPhoneNumber as InternationalMobilePhoneNumber,
// _Supplier._StandardAddress._DefaultPhoneNumber.PhoneNumber,
// _Supplier._StandardAddress._DefaultPhoneNumber.InternationalPhoneNumber,
// _Supplier._StandardAddress._DefaultFaxNumber.FaxNumber,
// _Supplier._StandardAddress._DefaultFaxNumber.InternationalFaxNumber,
// @UI.dataPoint: {
// title: 'Supplier', title_asOtr: '40F2E93067D51EE5849F03BA94FC846B' }
case
when _SupplierHeadOffice.AddressID is not null then
_SupplierHeadOffice.FullName
else _SupplierHeadOffice1.FullName
end as SupplierName,
@UI.fieldGroup: [{ //^3351437
qualifier: 'Supplier',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 20,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail3',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 20,
exclude: false,
importance: #HIGH
}]
@ObjectModel: { virtualElement,
virtualElementCalculatedBy: 'CL_VDM_CC_ADDRESS_FORMAT',
readOnly: true }
@Semantics.address.label: true
cast('' as contactcardformattedaddress) as FormattedAddress,
@ObjectModel.readOnly: true
@UI.hidden: true
//v3351437
case
when _SupplierHeadOffice.AddressID is not null then
cast(_SupplierHeadOffice.AddressID as adrnr) //contactcardaddress)
else
cast(_SupplierHeadOffice1.AddressID as adrnr)//contactcardaddress)
end as AddressID,
@UI.fieldGroup: [{ //^3351437
qualifier: 'Supplier',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 30,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail3',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 30,
exclude: false,
importance: #HIGH
}] //v3351437
case
when _SupplierHeadOffice.AddressID is not null then
_SupplierHeadOffice.EmailAddress
else _SupplierHeadOffice1.EmailAddress end as EmailAddress,
@UI.fieldGroup: [{ //^3351437
qualifier: 'Supplier',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 40,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail3',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 40,
exclude: false,
importance: #HIGH
}] //v3351437
case
when _SupplierHeadOffice.AddressID is not null then
_SupplierHeadOffice.PhoneNumber
else
_SupplierHeadOffice1.PhoneNumber
end as InternationalPhoneNumber,
@UI.fieldGroup: [{ //^3351437
qualifier: 'Supplier',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 50,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail3',
groupLabel: 'Supplier', groupLabel_asOtr: '40F2E93067D51EE5849F03BA94FC846B',
position: 50,
exclude: false,
importance: #HIGH
}] //v3351437
case
when _SupplierHeadOffice.AddressID is not null then
_SupplierHeadOffice.MobilePhoneNumber
else
_SupplierHeadOffice1.MobilePhoneNumber
end as InternationalMobilePhoneNumber,
@ObjectModel.text.element: [ 'CompanyCodeName' ]
@UI.identification: [{
position: 40,
importance: #HIGH }]
I_PurchaseContractVersion.CompanyCode,
_CompanyCode.CompanyCodeName,
@ObjectModel.text.element: [ 'PurchasingOrganizationName' ]
@UI.identification: [{
position: 20,
label: 'Purchasing Organization', label_asOtr: '40F2E93067D51ED58EEEC1A60CED08B2',
importance: #HIGH }]
@UI.dataPoint : { title: 'Purchasing Organization'}
@UI.textArrangement: #TEXT_FIRST
I_PurchaseContractVersion.PurchasingOrganization,
_PurchasingOrganization.PurchasingOrganizationName,
@ObjectModel.text.element: [ 'PurchasingGroupName' ]
@UI.identification: [{
position: 30,
importance: #HIGH }]
I_PurchaseContractVersion.PurchasingGroup,
_PurchasingGroup.PurchasingGroupName,
// for contacts
SupplyingSupplier,
InvoicingParty,
SupplierAddressID,
CreatedByUser,
@UI.fieldGroup: [{
qualifier: 'DeliveryandPayment',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 30,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 30,
exclude: false,
importance: #HIGH
}]
I_PurchaseContractVersion.IncotermsTransferLocation,
@ObjectModel.text.association: '_PaymentTermsText'
@UI.fieldGroup: [{
qualifier: 'DeliveryandPayment',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 10,
exclude: false,
importance: #HIGH },
{
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 10,
exclude: false,
importance: #HIGH
}]
I_PurchaseContractVersion.PaymentTerms,
// Modeled only
// will be filled in OData Implementation
cast('' as mm_pur_paymenttermstext) as PaymentTermsDescription,
@UI: {fieldGroup: { qualifier: 'DeliveryandPayment', position: 40, importance: #HIGH,
label: 'Incoterm Location 1'}}
IncotermsLocation1,
@UI: {fieldGroup: { qualifier: 'DeliveryandPayment', position: 50, importance: #HIGH,
label: 'Incoterm Location 2'}}
IncotermsLocation2,
@UI: {fieldGroup: { qualifier: 'DeliveryandPayment', position: 60, importance: #HIGH,
label: 'Incoterms Version'}}
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['IncotermsVersionName']
IncotermsVersion,
@UI.hidden: true
@Semantics.text: true
@ObjectModel.readOnly: true
_PurCtrIncotermsVersion.IncotermsVersionName,
@UI: {fieldGroup: {qualifier: 'DeliveryandPayment', position: 70, importance: #HIGH, label: 'First Payment in Days'}}
I_PurchaseContractVersion.CashDiscount1Days,
@UI: {fieldGroup: {qualifier: 'DeliveryandPayment', position: 90, importance: #HIGH, label: 'Second Payment in Days'}}
I_PurchaseContractVersion.CashDiscount2Days,
@UI: {fieldGroup: {qualifier: 'DeliveryandPayment', position: 110, importance: #HIGH, label: 'Cash Discount Days'}}
I_PurchaseContractVersion.NetPaymentDays,
@UI: {fieldGroup: {qualifier: 'DeliveryandPayment', position: 80, importance: #HIGH, label: 'Discount for First Payment in %'}}
I_PurchaseContractVersion.CashDiscount1Percent,
@UI: {fieldGroup: {qualifier: 'DeliveryandPayment', position: 100, importance: #HIGH, label: 'Discount for Second Payment in %'}}
I_PurchaseContractVersion.CashDiscount2Percent,
@UI.identification: [{
position: 60,
importance: #HIGH }]
@Semantics.businessDate.at: true
I_PurchaseContractVersion.ValidityEndDate,
@UI.identification: [{
position: 50,
importance: #HIGH }]
@Semantics.businessDate.at: true
I_PurchaseContractVersion.ValidityStartDate,
@UI.identification: [{
position: 70,
importance: #HIGH }]
//ExchangeRate,
cast( I_PurchaseContractVersion.ExchangeRate as fis_exchange_rate preserving type ) as ExchangeRate,
@UI.identification: [{
position: 80,
importance: #HIGH }]
ExchangeRateIsFixed,
@UI.hidden: true
@ObjectModel.virtualElement : true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PURCONTR_FS_ITEM_TRA_EXIT'
cast ( '' as abap_boolean ) as PurchasingItemHasHierarchy,
@UI.hidden: true
@ObjectModel.virtualElement : true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PURCONTR_FS_ITEM_TRA_EXIT'
cast ( '' as abap_boolean ) as SrvcProcmtItmHierIsEnbld,
@UI.hidden: true
@ObjectModel.virtualElement : true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PURCONTR_FS_ITEM_TRA_EXIT'
cast ('' as boolean) as VersionIsEnabled,
//Associations
_PurchaseContractHistory,
_PurchaseContractItem,
@ObjectModel.filter.enabled: false
_PurContractItemHierFs,
_ContractFactSheetHeaderText,
_PurCtrIncotermsVersion,
I_PurchaseContractVersion._IncotermsClassification,
I_PurchaseContractVersion._PurchasingDocumentType,
I_PurchaseContractVersion._PurchasingDocumentCategory,
// _ContactCard,
_SupplierHeadOffice,
_SupplierHeadOffice1,
_IncotermsClassificationText,
_PurchasingDocumentTypeText,
_PurgDocumentCategoryText,
_PaymentTermsText,
_ReleaseCodeText,
_PurchasingDocumentTypeName,
_VersionReasonValHelp
}
where
PurchasingDocumentDeletionCode <> 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_PURCHASECONTRACTVERSION",
"I_PURCHASINGDOCUMENTTYPETEXT",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_PURCONTRVERSIONTYPE",
"I_PURCTRINCOVERSION",
"I_SUPPLIERORADDRESSCONTACTCARD"
],
"ASSOCIATED":
[
"C_CONTRACTFACTSHEETHEADERTEXT",
"C_CONTRACTITEMFS",
"C_PURCONTRACTITEMHIERFACTSHEET",
"E_PURCHASINGDOCUMENT",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSCLASSIFICATIONTEXT",
"I_PAYMENTTERMSTEXT",
"I_PURCHASECONTRACTHISTORY",
"I_PURCHASINGDOCUMENTCATEGORY",
"I_PURCHASINGDOCUMENTTYPE",
"I_PURCHASINGDOCUMENTTYPETEXT",
"I_PURCTRINCOVERSION",
"I_PURGDOCUMENTCATEGORYTEXT",
"I_PURGDOCVERSIONREASONVALHELP",
"I_RELEASECODETEXT",
"I_SUPPLIERORADDRESSCONTACTCARD"
],
"BASE":
[
"I_PURCHASECONTRACTVERSION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/