C_MSTRPROJINVOICE
Master Project Invoice
C_MSTRPROJINVOICE is a CDS View in S/4HANA. Master Project Invoice. It contains 13 fields. 2 CDS views read from this table.
CDS Views using this table (2)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| C_MPInvoiceWOSO | view | from | CONSUMPTION | Master Project Invoice without Sales Order |
| C_MstrProjAgeDebt | view | from | CONSUMPTION | Master Project Aged Debt |
Fields (13)
| Key | Field | CDS Fields | Used in Views |
|---|---|---|---|
| KEY | BillingDocument | BillingDocument | 2 |
| KEY | MasterProject | MasterProject | 2 |
| KEY | SalesDocument | SalesDocument | 1 |
| BillingDocumentType | BillingDocumentType | 2 | |
| ExchangeRateDate | ExchangeRateDate | 2 | |
| MasterProjectName | MasterProjectName | 2 | |
| MasterProjectUUID | MasterProjectUUID | 2 | |
| OverdueAmountInDisplayCrcy | ItemNetAmountOfBillingDoc | 1 | |
| SalesOrder | SalesOrder | 1 | |
| SalesOrganization | SalesOrganization | 2 | |
| SoldToParty | SoldToParty | 1 | |
| TotalNetAmount | TotalNetAmount | 1 | |
| TransactionCurrency | TransactionCurrency | 2 |
@AbapCatalog.sqlViewName: 'CMPINVOICE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #CONSUMPTION
//@Search.searchable: true *ATC Error
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Master Project Invoice'
@AccessControl.personalData.blocking: #REQUIRED
define view C_MstrProjInvoice
as select from I_MstrProjInvoiceAggregated as Invoice
association [0..1] to I_MasterProjectVH as _MasterProject on $projection.MasterProject = _MasterProject.MasterProject
association [0..1] to I_SalesDocument as _SalesDocument on $projection.SalesDocument = _SalesDocument.SalesDocument
association [0..*] to I_MPStructureElementVH as _ControllingObject on $projection.ControllingObjectExternalID = _ControllingObject.ControllingObjectExternalID
association [0..1] to I_Customer as _Customer on $projection.SoldToParty = _Customer.Customer
//association [0..1] to I_Material as _Material on $projection.material is not initial
association [1..1] to I_BillingDocument as _BillingDocument on $projection.BillingDocument = _BillingDocument.BillingDocument
// association [0..1] to I_InvoiceListStatus as _ListStatus on $projection.InvoiceListStatus = _ListStatus.InvoiceListStatus
association [0..1] to I_OverallBillingStatus as _OverallBillingStatus on $projection.OverallBillingStatus = _OverallBillingStatus.OverallBillingStatus
association [0..1] to I_SalesOrganizationText as _SalesOrganizationText on $projection.SalesOrganization = _SalesOrganizationText.SalesOrganization and _SalesOrganizationText.Language = $session.system_language
association [0..1] to I_BillingDocumentTypeText as _BillingDocumentTypeText on $projection.BillingDocumentType = _BillingDocumentTypeText.BillingDocumentType and _BillingDocumentTypeText.Language = $session.system_language
// association [0..1] to I_SalesDocumentItem as _SalesDocumentItem on $projection.SalesOrder = _SalesDocumentItem.SalesDocument
// and $projection.SalesOrderItem = _SalesDocumentItem.SalesDocumentItem
//Extensibility
association [0..1] to E_BillingDocument as _Extension on $projection.BillingDocument = _Extension.BillingDocument
{
//--[ GENERATED:012:E6ExH29r7kY4iC{{Mu8yZm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_MasterProjectStdVH',
element: 'MasterProject' }
}]
// ]--GENERATED
@ObjectModel.text.element: 'MasterProjectName'
@ObjectModel: {foreignKey.association: '_MasterProject'}
@UI: { selectionField }
@UI.lineItem
// @Search.defaultSearchElement: true *ATC Error
key Invoice.MasterProject,
//--[ GENERATED:012:E6ExH29r7kY4iC{{Mu8yZm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_BillingDocumentStdVH',
element: 'BillingDocument' }
}]
// ]--GENERATED
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
key Invoice.BillingDocument,
//--[ GENERATED:012:E6ExH29r7kY4iC{{Mu8yZm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_SalesDocumentStdVH',
element: 'SalesDocument' }
}]
// ]--GENERATED
@ObjectModel: {foreignKey.association: '_SalesDocument'}
@UI: { selectionField }
@UI.lineItem
// @Search.defaultSearchElement: true *ATC Error
key cast(Invoice.SalesDocument as /cpd/pws_rcb_vbeln) as SalesDocument,
// @Search.defaultSearchElement: true *ATC Error
// @UI.lineItem
// key cast(ltrim(Invoice.SalesDocumentItem,'0') as /cpd/cpm_soitem) as SalesDocumentItem,
Invoice.MasterProjectUUID,
@Consumption.hidden: true
Invoice.SalesDocument as SalesOrder,
// @Consumption.hidden: true
// Invoice.SalesDocumentItem as SalesOrderItem,
// @Semantics.text: true
// @Search.defaultSearchElement: true *ATC Error
// @UI.lineItem
// _SalesDocumentItem.SalesDocumentItemText,
@ObjectModel.text.element: 'BillingDocumentTypeName'
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
Invoice.BillingDocumentType,
@Semantics.text: true
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
_BillingDocumentTypeText.BillingDocumentTypeName,
// @Search.defaultSearchElement: true *ATC Error
@ObjectModel.text.element: 'SalesOrganizationName'
Invoice.SalesOrganization,
// @Search.defaultSearchElement: true *ATC Error
@Semantics.text: true
_SalesOrganizationText.SalesOrganizationName,
@Semantics.text: true
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
Invoice.MasterProjectName,
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
Invoice.CreationDate,
// @Search.defaultSearchElement: true *ATC Error
@UI: { selectionField }
@UI.lineItem
Invoice.ExchangeRateDate as ExchangeRateDate,
//@ObjectModel: {foreignKey.association: '_Material'}
// @ObjectModel.text.element: 'MaterialName'
// @Search.defaultSearchElement: true *ATC Error
// @UI: { selectionField }
// @UI.lineItem
// ' ' as Material,
// @Search.defaultSearchElement: true *ATC Error
// @Semantics.text: true
// @UI.lineItem
// ' ' as MaterialName,
//@Semantics.quantity.unitOfMeasure: 'BillingQuantityUnit'
// @Search.defaultSearchElement: true *ATC Error
// @UI.lineItem
// cast(Invoice.BillingQuantity as fkimg) as BillingQuantity,
// @Semantics.unitOfMeasure: true
// @Search.defaultSearchElement: true *ATC Error
// @UI.lineItem
// Invoice.BillingQuantityUnit,
@Semantics.amount.currencyCode: 'TransactionCurrency'
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
cast(Invoice.ItemNetAmountOfBillingDoc - Invoice.BillDocItemTaxAmt as netwr_fp) as ItemNetAmountOfBillingDoc, // SAP Note 3258856
@Semantics.amount.currencyCode: 'TransactionCurrency'
cast(Invoice.PurchasingDocumentAmount as /cpd/cpm_receivedamount) as ItemGrossAmountOfBillingDoc,
@Semantics.amount.currencyCode: 'TransactionCurrency'
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
cast(Invoice.TotalNetAmount as /cpd/cpm_billedamount) as TotalNetAmount,
// @Search.defaultSearchElement: true *ATC Error
// @UI.lineItem
// cast(concat(concat(ltrim(Invoice.SalesDocument,'0'),'-'),ltrim(Invoice.SalesDocumentItem,'0')) as /cpd/cpm_soitem )as SalesOrderItemConcatenatedID,
@Semantics.amount.currencyCode: 'TransactionCurrency'
//@Search.defaultSearchElement: true "ATC Error
@Semantics.text: true
@UI.lineItem
@EndUserText.label : 'Amount Due'
case when Invoice.PurchasingDocumentAmount is null
then Invoice.ItemNetAmountOfBillingDoc
when Invoice.PurchasingDocumentAmount >= Invoice.ItemNetAmountOfBillingDoc
then 0
else
cast((Invoice.ItemNetAmountOfBillingDoc - Invoice.PurchasingDocumentAmount) as /cpd/cpm_amountdue)
end as OverdueAmountInDisplayCrcy,
//Invoice.InvoiceListStatus,
// @Search.defaultSearchElement: true *ATC Error
@UI: { selectionField }
@UI.lineItem
@ObjectModel: {foreignKey.association: '_OverallBillingStatus'}
Invoice.InvoiceListStatus as OverallBillingStatus,
_OverallBillingStatus._Text[1:Language = $session.system_language].OverallBillingStatusDesc,
//InvoiceListStatusDesc,
@Semantics.currencyCode: true
@UI.lineItem
Invoice.TransactionCurrency,
// @ObjectModel: {foreignKey.association: '_ControllingObject'}
@UI: { selectionField }
@UI.lineItem
// @Search.defaultSearchElement: true *ATC Error
@ObjectModel.text.element: 'ControllingObjectDescription'
cast(Invoice.ControllingObjectExternalID as /cpd/cpm_struct_elm) as ControllingObjectExternalID,
@Semantics.text: true
cast(Invoice.ControllingObjectDescription as /cpd/cpm_str_elm_nm) as ControllingObjectDescription,
//--[ GENERATED:012:E6ExH29r7kY4iC{{Mu8yZm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_Customer_VH',
element: 'Customer' }
}]
// ]--GENERATED
@ObjectModel: {foreignKey.association: '_Customer'}
@ObjectModel.text.element: 'CustomerName'
@UI: { selectionField }
@UI.lineItem
// @Search.defaultSearchElement: true *ATC Error
Invoice.SoldToParty,
@Semantics.text: true
// @Search.defaultSearchElement: true *ATC Error
@UI.lineItem
_Customer.CustomerName,
Invoice._SalesDocument.SDDocumentCategory,
Invoice.SubsequentDocumentCategory,
@UI.hidden: true
Invoice.UserIsInvolved,
@UI.hidden: true
Invoice.MasterProjectType,
_MasterProject,
_SalesDocument,
_ControllingObject,
_Customer,
// _ListStatus,
_OverallBillingStatus,
/*Required for DCL view*/
_BillingDocument
}
where Invoice.BillingDocumentType <> 'S1' and Invoice.BillingDocumentType <> 'S3'