@AbapCatalog.sqlViewName: 'FAC_DZWIPLNITM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@EndUserText.label: 'DART Z3 WIP Line Item'
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
define view FAC_DART_Z3_WIP_LINEITEM
with parameters
P_FiscalYear : fins_gjahr,
@EndUserText.label: 'From Fiscal Period'
P_FromFiscalPeriod : fins_fagl_fiscper_from,
@EndUserText.label: 'To Fiscal Period'
P_ToFiscalPeriod : fins_fagl_fiscper_to
as select from I_GLAccountLineItem
inner join fac_dart_z3_WIP_ACCOUNT on I_GLAccountLineItem.CompanyCode = fac_dart_z3_WIP_ACCOUNT.CompanyCode
and I_GLAccountLineItem.GLAccount = fac_dart_z3_WIP_ACCOUNT.GLAccount
inner join I_LedgerCompanyCodeCrcyRoles on I_GLAccountLineItem.CompanyCode = I_LedgerCompanyCodeCrcyRoles.CompanyCode
and I_GLAccountLineItem.Ledger = I_LedgerCompanyCodeCrcyRoles.Ledger
// association [0..1] to I_AccountAssignmentType as _AccountAssignmentType on _AccountAssignmentType.AccountAssignmentType = $projection.AccountAssignmentType
association [0..1] to I_FiscalPeriodForVariant as _FromFiscalPeriodForVariant on _FromFiscalPeriodForVariant.FiscalYearVariant = $projection.FiscalYearVariant
and _FromFiscalPeriodForVariant.FiscalYear = $parameters.P_FiscalYear
and _FromFiscalPeriodForVariant.FiscalPeriod = $parameters.P_FromFiscalPeriod
association [0..1] to I_FiscalPeriodForVariant as _ToFiscalPeriodForVariant on _ToFiscalPeriodForVariant.FiscalYearVariant = $projection.FiscalYearVariant
and _ToFiscalPeriodForVariant.FiscalYear = $parameters.P_FiscalYear
and _ToFiscalPeriodForVariant.FiscalPeriod = $parameters.P_ToFiscalPeriod
{
@ObjectModel.foreignKey.association: '_SourceLedger'
key SourceLedger,
@ObjectModel.foreignKey.association: '_CompanyCode'
key I_GLAccountLineItem.CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key FiscalYear,
@ObjectModel.foreignKey.association: '_JournalEntry'
key AccountingDocument,
key LedgerGLLineItem,
@ObjectModel.foreignKey.association: '_Ledger'
key I_GLAccountLineItem.Ledger,
@ObjectModel.foreignKey.association: '_Plant'
Plant,
_Plant.PlantName,
PostingDate,
I_LedgerCompanyCodeCrcyRoles.FiscalYearVariant,
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AccountingDocumentType,
_AccountingDocumentType._Text[1: Language = $session.system_language].AccountingDocumentTypeName,
@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
I_GLAccountLineItem.GLAccount,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
I_GLAccountLineItem.ChartOfAccounts,
_GLAccountInChartOfAccounts._Text[1: Language = $session.system_language].GLAccountLongName,
OffsettingAccount,
OffsettingAccountType,
OffsettingChartOfAccounts,
_OffsettingAccountText.OffsettingAccountName,
Material,
_Material._Text[1: Language = $session.system_language].MaterialName,
// @ObjectModel.foreignKey.association: '_PartnerCostCtrActivityType'
// PartnerCostCtrActivityType,
// @EndUserText.label: 'Partner Cost Center Activity Type Name'
// _PartnerCostCtrActivityType[1:ValidityStartDate <= $session.system_date and ValidityEndDate >= $session.system_date]._Text[1: Language = $session.system_language].CostCtrActivityTypeName,
ControllingArea,
// PartnerCostCenter,
// @EndUserText.label: 'Partner Cost Center Name'
// _PartnerCostCenter[1:ValidityStartDate <= $session.system_date and ValidityEndDate >= $session.system_date]._Text[1: Language = $session.system_language].CostCenterName,
// PartnerCostObject,
// @ObjectModel.foreignKey.association: '_AccountAssignmentType'
// AccountAssignmentType,
// @EndUserText.label: 'Object Type Name'
// _AccountAssignmentType._Text[1: Language = $session.system_language].AccountAssignmentTypeDesc,
@EndUserText.label: 'Original Reference Document'
_JournalEntry.OriginalReferenceDocument,
ReferenceDocument,
@ObjectModel.foreignKey.association: '_ReferenceDocumentType'
ReferenceDocumentType,
@EndUserText.label: 'Business Transaction Type'
_ReferenceDocumentType._Text[1: Language = $session.system_language ].ReferenceDocumentTypeName,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
CompanyCodeCurrency,
@Semantics: { quantity : {unitOfMeasure: 'CostSourceUnit'} }
ValuationQuantity,
@Semantics.unitOfMeasure:true
CostSourceUnit,
// I_GLAccountLineItem.CompanyCode,
// Ledger,
@ObjectModel.foreignKey.association: '_Supplier'
Supplier,
@ObjectModel.foreignKey.association: '_Customer'
Customer,
@ObjectModel.foreignKey.association: '_BusinessArea'
BusinessArea,
//@ObjectModel.foreignKey.association: '_Segment'
Segment,
@ObjectModel.foreignKey.association: '_FinancialAccountType'
FinancialAccountType,
@ObjectModel.foreignKey.association: '_ProfitCenter'
ProfitCenter,
@ObjectModel.foreignKey.association: '_CostCenter'
CostCenter,
@ObjectModel.foreignKey.association: '_SalesOrganization'
SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
DistributionChannel,
OrganizationDivision,
@ObjectModel.foreignKey.association: '_ServiceDocumentType'
ServiceDocumentType,
@ObjectModel.foreignKey.association: '_ServiceDocument'
ServiceDocument,
@ObjectModel.foreignKey.association: '_MasterFixedAsset'
MasterFixedAsset,
@ObjectModel.foreignKey.association: '_FixedAsset'
FixedAsset,
AssetClass,
@ObjectModel.foreignKey.association: '_Order'
OrderID,
@ObjectModel.foreignKey.association: '_Purreqvaluationarea'
ValuationArea,
@ObjectModel.foreignKey.association: '_SalesDocument'
SalesDocument,
@ObjectModel.foreignKey.association: '_FunctionalArea'
FunctionalArea,
ProductGroup as MaterialGroup,
_ProductGroup._Text[1: Language = $session.system_language].MaterialGroupName,
WBSElement,
Project,
FiscalPeriod,
_FunctionalArea,
_Plant,
_AccountingDocumentType,
_GLAccountInChartOfAccounts,
_ChartOfAccounts,
_ReferenceDocumentType,
_GLAccountInCompanyCode,
_Supplier,
_Customer,
_BusinessArea,
_FinancialAccountType,
_ProfitCenter,
_CurrentProfitCenter,
_CostCenter,
_CurrentCostCenter,
_SalesOrganization,
_DistributionChannel,
_ServiceDocumentType,
_ServiceDocument,
_MasterFixedAsset,
_FixedAsset,
_Order,
_PurReqValuationArea,
_SalesDocument,
_SourceLedger,
I_GLAccountLineItem._CompanyCode,
_FiscalYear,
_JournalEntry,
I_GLAccountLineItem._Ledger
// _PartnerCostCtrActivityType,
// _AccountAssignmentType
}
where
AccountingDocumentCategory <> 'D'
and AccountingDocumentCategory <> 'M'
and AccountingDocumentCategory <> 'S'
and AccountingDocumentCategory <> 'V'
and AccountingDocumentCategory <> 'W'
and AccountingDocumentCategory <> 'Z'
and AccountingDocumentCategory <> 'T'
and PostingDate <= _ToFiscalPeriodForVariant.FiscalPeriodEndDate
and PostingDate >= _FromFiscalPeriodForVariant.FiscalPeriodStartDate