I_SAFTJOURNALLINEITEM
SAF-T Journal Item
I_SAFTJOURNALLINEITEM is a CDS View in S/4HANA. SAF-T Journal Item. It contains 38 fields. 8 CDS views read from this table.
CDS Views using this table (8)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_JournalItemCFinDocHist | view | from | COMPOSITE | |
| P_NL_SAFTTaxRatioCalculation | view | from | COMPOSITE | |
| P_NO_SAFTJournalItemTaxAbs | view | from | COMPOSITE | |
| P_NO_SAFTTaxRatioCalculation | view | from | COMPOSITE | |
| P_SAFTJournalItemBP | view | from | COMPOSITE | |
| P_SAFTJournalItemBP | view | union | COMPOSITE | |
| P_SAFTJournalItemTaxAbs | view | from | COMPOSITE | |
| P_SAFTTaxRatioCalculation | view | from | COMPOSITE |
Fields (38)
| Key | Field | CDS Fields | Used in Views |
|---|---|---|---|
| KEY | AccountingDocument | AccountingDocument | 7 |
| KEY | CompanyCode | CompanyCode | 7 |
| KEY | FiscalYear | FiscalYear | 7 |
| KEY | Ledger | Ledger | 7 |
| KEY | LedgerGLLineItem | AccountingDocumentItem,LedgerGLLineItem | 6 |
| _CFinPurchasingDocHistory | _CFinPurchasingDocHistory | 3 | |
| _CompanyCode | _CompanyCode | 6 | |
| _CompanyCodeCurrency | _CompanyCodeCurrency | 5 | |
| _ControllingArea | _ControllingArea | 3 | |
| _CostCenter | _CostCenter | 3 | |
| _Customer | _Customer | 3 | |
| _CustomerToBP | _CustomerToBP | 3 | |
| _FiscalYear | _FiscalYear | 6 | |
| _JournalEntry | _JournalEntry | 6 | |
| _Ledger | _Ledger | 6 | |
| _Supplier | _Supplier | 3 | |
| _SupplierToBP | _SupplierToBP | 3 | |
| AccountingDocumentItem | AccountingDocumentItem | 1 | |
| AlternativeGLAccount | AlternativeGLAccount | 3 | |
| CentralFinanceSalesDocument | CentralFinanceSalesDocument | 2 | |
| ChartOfAccounts | ChartOfAccounts | 3 | |
| CompanyCodeCurrency | CompanyCodeCurrency | 5 | |
| ControllingArea | ControllingArea | 3 | |
| CostCenter | CostCenter | 3 | |
| Customer | Customer | 3 | |
| DocumentItemText | DocumentItemText | 3 | |
| ExchangeRate | ExchangeRate | 3 | |
| FinancialAccountType | FinancialAccountType | 3 | |
| GLAccount | GLAccount | 3 | |
| LogicalSystem | LogicalSystem | 3 | |
| PostingDate | PostingDate | 6 | |
| ReferenceDocument | ReferenceDocument | 3 | |
| ReferenceDocumentType | ReferenceDocumentType | 3 | |
| ReferenceSDDocument | ReferenceSDDocument | 3 | |
| SourceLedger | SourceLedger | 3 | |
| Supplier | Supplier | 3 | |
| TaxCode | TaxCode | 2 | |
| TransactionCurrency | TransactionCurrency | 3 |
@AbapCatalog.sqlViewName: 'ISAFTJOURNALITM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'SAF-T Journal Item'
define view I_SAFTJournalLineItem
as select from I_JournalEntryItem as JournalEntryItem
inner join I_CFinBillingDocument as CFinBillingDocument on CFinBillingDocument.CentralFinanceBillingDocument = JournalEntryItem.ReferenceDocument
and CFinBillingDocument.SenderLogicalSystem = JournalEntryItem.LogicalSystem
and CFinBillingDocument.CompanyCode = JournalEntryItem.CompanyCode
inner join I_GLAccountInCompanyCode as GLAccount on GLAccount.GLAccount = JournalEntryItem.GLAccount
and GLAccount.CompanyCode = JournalEntryItem.CompanyCode
inner join I_CompanyCode as CompanyCode on CompanyCode.CompanyCode = JournalEntryItem.CompanyCode
left outer to one join I_OperationalAcctgDocItem as AcctgDocItem on AcctgDocItem.CompanyCode = JournalEntryItem.CompanyCode
and AcctgDocItem.FiscalYear = JournalEntryItem.FiscalYear
and AcctgDocItem.AccountingDocument = JournalEntryItem.AccountingDocument
and AcctgDocItem.AccountingDocumentItem = JournalEntryItem.AccountingDocumentItem
association [0..*] to I_TaxItem as _TaxItem on _TaxItem.AccountingDocument = JournalEntryItem.AccountingDocument
and _TaxItem.CompanyCode = JournalEntryItem.CompanyCode
and _TaxItem.FiscalYear = JournalEntryItem.FiscalYear
and _TaxItem.TaxCode = JournalEntryItem.TaxCode
association [0..*] to I_CFinPurchasingDocHistory as _CFinPurchasingDocHistory on JournalEntryItem.ReferenceDocument = _CFinPurchasingDocHistory.CFinMaterialDocument
and (
JournalEntryItem.ReferenceDocumentType = 'RMRP'
or JournalEntryItem.ReferenceDocumentType = 'CF3PM'
)
and JournalEntryItem.LogicalSystem = _CFinPurchasingDocHistory.SenderLogicalSystem
association [0..*] to I_CustomerToBusinessPartner as _CustomerToBP on _CustomerToBP.Customer = JournalEntryItem.Customer
association [0..*] to I_SupplierToBusinessPartner as _SupplierToBP on _SupplierToBP.Supplier = JournalEntryItem.Supplier
{
@ObjectModel.foreignKey.association: '_SourceLedger'
key JournalEntryItem.SourceLedger as SourceLedger,
@ObjectModel.foreignKey.association: '_CompanyCode'
key JournalEntryItem.CompanyCode as CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key JournalEntryItem.FiscalYear as FiscalYear,
@ObjectModel.foreignKey.association: '_JournalEntry'
key JournalEntryItem.AccountingDocument as AccountingDocument,
key JournalEntryItem.LedgerGLLineItem as LedgerGLLineItem,
@ObjectModel.foreignKey.association: '_Ledger'
key JournalEntryItem.Ledger as Ledger,
@Semantics.currencyCode: true
JournalEntryItem.CompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
JournalEntryItem.GLAccount as GLAccount,
@ObjectModel.foreignKey.association: '_AlternativeGLAccount'
JournalEntryItem.AlternativeGLAccount as AlternativeGLAccount,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
JournalEntryItem.ChartOfAccounts as ChartOfAccounts,
@ObjectModel.foreignKey.association: '_CountryChartOfAccounts'
JournalEntryItem.CountryChartOfAccounts as CountryChartOfAccounts,
JournalEntryItem.ReferenceDocument as ReferenceDocument,
JournalEntryItem.PostingDate as PostingDate,
JournalEntryItem.DocumentItemText as DocumentItemText,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
JournalEntryItem.AmountInCompanyCodeCurrency as AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
case
when JournalEntryItem.DebitCreditCode = 'H'
then abs(JournalEntryItem.AmountInCompanyCodeCurrency)
else 0
end as DebitAmountInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
case
when JournalEntryItem.DebitCreditCode = 'S'
then abs(JournalEntryItem.AmountInCompanyCodeCurrency)
else 0
end as CreditAmountInCoCodeCrcy,
@ObjectModel.foreignKey.association: '_DebitCreditCode'
JournalEntryItem.DebitCreditCode as DebitCreditCode,
@ObjectModel.foreignKey.association: '_Customer'
JournalEntryItem.Customer as Customer,
@ObjectModel.foreignKey.association: '_Supplier'
JournalEntryItem.Supplier as Supplier,
JournalEntryItem.TaxCode as TaxCode,
@ObjectModel.foreignKey.association: '_ReferenceDocumentType'
JournalEntryItem.ReferenceDocumentType,
JournalEntryItem.ReversalReferenceDocument,
JournalEntryItem.IsReversed,
@ObjectModel.foreignKey.association: '_CostCenter'
JournalEntryItem.CostCenter as CostCenter,
@ObjectModel.foreignKey.association: '_ControllingArea'
JournalEntryItem.ControllingArea as ControllingArea,
JournalEntryItem.Quantity as Quantity,
@ObjectModel.foreignKey.association: '_LogicalSystem'
JournalEntryItem.LogicalSystem as LogicalSystem,
JournalEntryItem.TransactionTypeDetermination as TransactionTypeDetermination,
JournalEntryItem.FinancialAccountType as FinancialAccountType,
JournalEntryItem._CompanyCode.Country as Country,
JournalEntryItem._CompanyCode._Country.TaxCalculationProcedure,
@ObjectModel.foreignKey.association: '_Order'
JournalEntryItem.OrderID,
JournalEntryItem.PersonnelNumber,
JournalEntryItem.AmountInTransactionCurrency,
JournalEntryItem.WBSElement,
JournalEntryItem.TransactionCurrency,
JournalEntryItem.ValueDate,
JournalEntryItem.AccountingDocumentItem,
JournalEntryItem.IsReversal,
JournalEntryItem.SalesDocument,
JournalEntryItem.SalesDocumentItem,
JournalEntryItem.InvoiceReference,
JournalEntryItem.InvoiceItemReference,
JournalEntryItem.InvoiceReferenceFiscalYear,
JournalEntryItem._JournalEntry.DocumentReferenceID,
coalesce(AcctgDocItem.PaymentReference, ' ') as PaymentReference,
coalesce(AcctgDocItem.BillingDocument, ' ') as BillingDocument,
AcctgDocItem.DueCalculationBaseDate,
AcctgDocItem.CashDiscount2Days,
AcctgDocItem.CashDiscount1Days,
AcctgDocItem.NetPaymentDays,
AcctgDocItem.AccountingDocumentItemType,
//CFin fields
CFinBillingDocument.CentralFinanceBillingDocument,
CFinBillingDocument._Item.CentralFinanceSalesDocument,
CFinBillingDocument._Item.ReferenceSDDocument,
CFinBillingDocument.SDDocumentCategory,
GLAccount.ReconciliationAccountType,
JournalEntryItem.SpecialGLCode,
cast( JournalEntryItem._JournalEntry.ExchangeRate as cade_kursf ) as ExchangeRate,
JournalEntryItem.ReferenceDocumentContext,
//Associations
_TaxItem,
_CustomerToBP,
_SupplierToBP,
_SourceLedger,
JournalEntryItem._CompanyCode,
_FiscalYear,
_JournalEntry,
_Ledger,
_CompanyCodeCurrency,
_GLAccountInChartOfAccounts,
_AlternativeGLAccount,
_ChartOfAccounts,
_CountryChartOfAccounts,
_Customer,
_Supplier,
_CostCenter,
_ControllingArea,
_LogicalSystem,
_ReferenceDocumentType,
_DebitCreditCode,
_CFinPurchasingDocHistory,
_Order
}
where
JournalEntryItem.ReferenceDocumentType = 'VBRK'
and CompanyCode.Country <> 'PT'
union
select from I_JournalEntryItem as JournalEntryItem
inner join I_GLAccountInCompanyCode as GLAccount on GLAccount.GLAccount = JournalEntryItem.GLAccount
and GLAccount.CompanyCode = JournalEntryItem.CompanyCode
inner join I_CompanyCode as CompanyCode on CompanyCode.CompanyCode = JournalEntryItem.CompanyCode
left outer to one join I_OperationalAcctgDocItem as AcctgDocItem on AcctgDocItem.CompanyCode = JournalEntryItem.CompanyCode
and AcctgDocItem.FiscalYear = JournalEntryItem.FiscalYear
and AcctgDocItem.AccountingDocument = JournalEntryItem.AccountingDocument
and AcctgDocItem.AccountingDocumentItem = JournalEntryItem.AccountingDocumentItem
association [0..*] to I_TaxItem as _TaxItem on _TaxItem.AccountingDocument = JournalEntryItem.AccountingDocument
and _TaxItem.CompanyCode = JournalEntryItem.CompanyCode
and _TaxItem.FiscalYear = JournalEntryItem.FiscalYear
and _TaxItem.TaxCode = JournalEntryItem.TaxCode
association [0..*] to I_CFinPurchasingDocHistory as _CFinPurchasingDocHistory on JournalEntryItem.ReferenceDocument = _CFinPurchasingDocHistory.CFinMaterialDocument
and (
JournalEntryItem.ReferenceDocumentType = 'RMRP'
or JournalEntryItem.ReferenceDocumentType = 'CF3PM'
)
and JournalEntryItem.LogicalSystem = _CFinPurchasingDocHistory.SenderLogicalSystem
association [0..*] to I_CustomerToBusinessPartner as _CustomerToBP on _CustomerToBP.Customer = JournalEntryItem.Customer
association [0..*] to I_SupplierToBusinessPartner as _SupplierToBP on _SupplierToBP.Supplier = JournalEntryItem.Supplier
{
@ObjectModel.foreignKey.association: '_SourceLedger'
key JournalEntryItem.SourceLedger as SourceLedger,
@ObjectModel.foreignKey.association: '_CompanyCode'
key JournalEntryItem.CompanyCode as CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key JournalEntryItem.FiscalYear as FiscalYear,
@ObjectModel.foreignKey.association: '_JournalEntry'
key JournalEntryItem.AccountingDocument as AccountingDocument,
key JournalEntryItem.LedgerGLLineItem as LedgerGLLineItem,
@ObjectModel.foreignKey.association: '_Ledger'
key JournalEntryItem.Ledger as Ledger,
@Semantics.currencyCode: true
JournalEntryItem.CompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
JournalEntryItem.GLAccount as GLAccount,
@ObjectModel.foreignKey.association: '_AlternativeGLAccount'
JournalEntryItem.AlternativeGLAccount as AlternativeGLAccount,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
JournalEntryItem.ChartOfAccounts as ChartOfAccounts,
@ObjectModel.foreignKey.association: '_CountryChartOfAccounts'
JournalEntryItem.CountryChartOfAccounts as CountryChartOfAccounts,
JournalEntryItem.ReferenceDocument as ReferenceDocument,
JournalEntryItem.PostingDate as PostingDate,
JournalEntryItem.DocumentItemText as DocumentItemText,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
JournalEntryItem.AmountInCompanyCodeCurrency as AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
case
when JournalEntryItem.DebitCreditCode = 'H'
then abs(JournalEntryItem.AmountInCompanyCodeCurrency)
else 0
end as DebitAmountInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
case
when JournalEntryItem.DebitCreditCode = 'S'
then abs(JournalEntryItem.AmountInCompanyCodeCurrency)
else 0
end as CreditAmountInCoCodeCrcy,
@ObjectModel.foreignKey.association: '_DebitCreditCode'
JournalEntryItem.DebitCreditCode as DebitCreditCode,
@ObjectModel.foreignKey.association: '_Customer'
JournalEntryItem.Customer as Customer,
@ObjectModel.foreignKey.association: '_Supplier'
JournalEntryItem.Supplier as Supplier,
JournalEntryItem.TaxCode as TaxCode,
@ObjectModel.foreignKey.association: '_ReferenceDocumentType'
JournalEntryItem.ReferenceDocumentType,
JournalEntryItem.ReversalReferenceDocument,
JournalEntryItem.IsReversed,
@ObjectModel.foreignKey.association: '_CostCenter'
JournalEntryItem.CostCenter as CostCenter,
@ObjectModel.foreignKey.association: '_ControllingArea'
JournalEntryItem.ControllingArea as ControllingArea,
JournalEntryItem.Quantity as Quantity,
@ObjectModel.foreignKey.association: '_LogicalSystem'
JournalEntryItem.LogicalSystem as LogicalSystem,
JournalEntryItem.TransactionTypeDetermination as TransactionTypeDetermination,
JournalEntryItem.FinancialAccountType as FinancialAccountType,
JournalEntryItem._CompanyCode.Country as Country,
JournalEntryItem._CompanyCode._Country.TaxCalculationProcedure,
@ObjectModel.foreignKey.association: '_Order'
JournalEntryItem.OrderID,
JournalEntryItem.PersonnelNumber,
JournalEntryItem.AmountInTransactionCurrency,
JournalEntryItem.WBSElement,
JournalEntryItem.TransactionCurrency,
JournalEntryItem.ValueDate,
JournalEntryItem.AccountingDocumentItem,
JournalEntryItem.IsReversal,
JournalEntryItem.SalesDocument,
JournalEntryItem.SalesDocumentItem,
JournalEntryItem.InvoiceReference,
JournalEntryItem.InvoiceItemReference,
JournalEntryItem.InvoiceReferenceFiscalYear,
JournalEntryItem._JournalEntry.DocumentReferenceID,
coalesce(AcctgDocItem.PaymentReference, ' ') as PaymentReference,
coalesce(AcctgDocItem.BillingDocument, ' ') as BillingDocument,
AcctgDocItem.DueCalculationBaseDate,
AcctgDocItem.CashDiscount2Days,
AcctgDocItem.CashDiscount1Days,
AcctgDocItem.NetPaymentDays,
AcctgDocItem.AccountingDocumentItemType,
//CFin fields
' ' as CentralFinanceBillingDocument,
' ' as CentralFinanceSalesDocument,
' ' as ReferenceSDDocument,
' ' as SDDocumentCategory,
GLAccount.ReconciliationAccountType,
JournalEntryItem.SpecialGLCode,
cast( JournalEntryItem._JournalEntry.ExchangeRate as cade_kursf ) as ExchangeRate,
JournalEntryItem.ReferenceDocumentContext,
//Associations
_TaxItem,
_CustomerToBP,
_SupplierToBP,
_SourceLedger,
JournalEntryItem._CompanyCode,
_FiscalYear,
_JournalEntry,
_Ledger,
_CompanyCodeCurrency,
_GLAccountInChartOfAccounts,
_AlternativeGLAccount,
_ChartOfAccounts,
_CountryChartOfAccounts,
_Customer,
_Supplier,
_CostCenter,
_ControllingArea,
_LogicalSystem,
_ReferenceDocumentType,
_DebitCreditCode,
_CFinPurchasingDocHistory,
_Order
}
where
JournalEntryItem.ReferenceDocumentType <> 'VBRK'
or CompanyCode.Country = 'PT'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CFINBILLINGDOCUMENT",
"I_CFINBILLINGDOCUMENTITEM",
"I_COMPANYCODE",
"I_COUNTRY",
"I_GLACCOUNTINCOMPANYCODE",
"I_JOURNALENTRY",
"I_JOURNALENTRYITEM",
"I_OPERATIONALACCTGDOCITEM"
],
"ASSOCIATED":
[
"I_CFINPURCHASINGDOCHISTORY",
"I_CHARTOFACCOUNTS",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_COSTCENTER",
"I_CURRENCY",
"I_CUSTOMER",
"I_CUSTOMERTOBUSINESSPARTNER",
"I_DEBITCREDITCODE",
"I_FISCALYEARFORCOMPANYCODE",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_JOURNALENTRY",
"I_LEDGER",
"I_LOGICALSYSTEM",
"I_ORDER",
"I_REFERENCEDOCUMENTTYPE",
"I_SUPPLIER",
"I_SUPPLIERTOBUSINESSPARTNER",
"I_TAXITEM"
],
"BASE":
[
"I_JOURNALENTRYITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/