@AbapCatalog.sqlViewName: 'CGRCNTRPINTCOJE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@OData.publish: true
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata: { ignorePropagatedAnnotations: true,
allowExtensions: true }
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@EndUserText.label: 'No Trading Partner Intercompany JE'
define view C_NoTrdgPartIntcoJrnlEntr
with parameters
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_LedgerStdVH',
element: 'Ledger' }
}]
@EndUserText.label: 'Ledger'
P_Ledger : rldnr
as select from I_GLAccountLineItemRawData
association [0..1] to P_NoTrdgPartIntcoJrnlEntr as _NoTrdgPartIntcoJrnlEntr on $projection.CompanyCode = _NoTrdgPartIntcoJrnlEntr.CompanyCode
and $projection.FiscalYear = _NoTrdgPartIntcoJrnlEntr.FiscalYear
and $projection.AccountingDocument = _NoTrdgPartIntcoJrnlEntr.AccountingDocument
and $projection.Ledger = _NoTrdgPartIntcoJrnlEntr.Ledger
{
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } }]
@ObjectModel.foreignKey.association: '_CompanyCode'
key CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key FiscalYear,
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_JournalEntryStdVH', element: 'AccountingDocument' }, additionalBinding: [{ localElement: 'CompanyCode', element: 'CompanyCode' }, { localElement: 'FiscalYear', element: 'FiscalYear' }] }]
@ObjectModel.foreignKey.association: '_JournalEntry'
key AccountingDocument,
@ObjectModel.foreignKey.association: '_Ledger'
key cast(SourceLedger as rldnr preserving type ) as Ledger,
@Consumption.valueHelpDefinition: [{ entity:{ name: 'I_AccountingDocumentTypeStdVH', element: 'AccountingDocumentType' } }]
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AccountingDocumentType,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
sum(case DebitCreditCode when 'S' then cast( AmountInCompanyCodeCurrency as fis_dr_hsl preserving type )
else cast( cast( 0 as abap.curr( 23,2) ) as fis_dr_hsl preserving type )
end) as DebitAmountInCoCodeCrcy,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
sum(case DebitCreditCode when 'H' then cast( AmountInCompanyCodeCurrency as fis_cr_hsl preserving type )
else cast( cast( 0 as abap.curr( 23,2) ) as fis_cr_hsl preserving type )
end) as CreditAmountInCoCodeCrcy,
_JournalEntry.IntercompanyTransaction,
_JournalEntry.AccountingDocumentCreationDate,
_JournalEntry.AccountingDocCreatedByUser,
_JournalEntry.TransactionCode,
_JournalEntry.DocumentReferenceID,
DocumentDate,
_JournalEntry.LastChangeDate,
@ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
AccountingDocumentCategory,
@ObjectModel.foreignKey.association: '_ReferenceDocumentType'
ReferenceDocumentType,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
sum(AmountInCompanyCodeCurrency) as AmountInCompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_FiscalYearPeriodForVariant'
@Semantics.fiscal.yearPeriod: true
FiscalYearPeriod,
@ObjectModel.foreignKey.association: '_FiscalYearVariant'
@Semantics.fiscal.yearVariant: true
FiscalYearVariant,
@ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
@Semantics.currencyCode:true
CompanyCodeCurrency,
PostingDate,
_JournalEntry.ReverseDocument,
_CompanyCode,
_FiscalYear,
_JournalEntry,
_AccountingDocumentType,
_CompanyCodeCurrency,
_AccountingDocumentCategory,
_ReferenceDocumentType,
_FiscalYearPeriodForVariant,
_FiscalYearVariant,
_Ledger
}
where
((_NoTrdgPartIntcoJrnlEntr(P_Ledger:$parameters.P_Ledger).P_NumberOfTradingPartner = 0)
or (_NoTrdgPartIntcoJrnlEntr (P_Ledger:$parameters.P_Ledger).P_NumberOfTradingPartner is null))
and _JournalEntry.IntercompanyTransaction <> ''
and SourceLedger = $parameters.P_Ledger
and AmountInCompanyCodeCurrency <> 0
and IsReversal = ''
and IsReversed = ''
group by
CompanyCode,
FiscalYear,
AccountingDocument,
AccountingDocumentType,
_JournalEntry.IntercompanyTransaction,
_JournalEntry.AccountingDocumentCreationDate,
_JournalEntry.AccountingDocCreatedByUser,
_JournalEntry.TransactionCode,
_JournalEntry.DocumentReferenceID,
DocumentDate,
_JournalEntry.LastChangeDate,
AccountingDocumentCategory,
ReferenceDocumentType,
FiscalYearPeriod,
FiscalYearVariant,
CompanyCodeCurrency,
PostingDate,
_JournalEntry.ReverseDocument,
SourceLedger
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GLACCOUNTLINEITEMRAWDATA",
"I_JOURNALENTRY",
"P_NOTRDGPARTINTCOJRNLENTR"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTCATEGORY",
"I_ACCOUNTINGDOCUMENTTYPE",
"I_COMPANYCODE",
"I_CURRENCY",
"I_FISCALYEARFORCOMPANYCODE",
"I_FISCALYEARPERIODFORVARIANT",
"I_FISCALYEARVARIANT",
"I_JOURNALENTRY",
"I_LEDGER",
"I_REFERENCEDOCUMENTTYPE",
"P_NOTRDGPARTINTCOJRNLENTR"
],
"BASE":
[
"I_GLACCOUNTLINEITEMRAWDATA"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/