P_FR_AuditFECAccountLineItem

DDL: P_FR_AUDITFECACCOUNTLINEITEM SQL: PFRAUDITFECACDOC Type: view CONSUMPTION Package: GLO_FIN_IS_AUDIT_FR

France Audit File (FEC) – ACDOCA-data

P_FR_AuditFECAccountLineItem is a Consumption CDS View that provides data about "France Audit File (FEC) – ACDOCA-data" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItem) and exposes 59 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 3 associations to related views. Part of development package GLO_FIN_IS_AUDIT_FR.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItem GLAccountLineItem from

Parameters (1)

NameTypeDefault
P_AlternativeGLAccountIsUsed fis_disalteracct

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_OneTimeAccountBP _OneTimeAccountBP GLAccountLineItem.CompanyCode = _OneTimeAccountBP.CompanyCode and GLAccountLineItem.FiscalYear = _OneTimeAccountBP.FiscalYear and GLAccountLineItem.AccountingDocument = _OneTimeAccountBP.AccountingDocument and GLAccountLineItem.AccountingDocumentItem = _OneTimeAccountBP.AccountingDocumentItem
[0..*] I_StRpJournalEntryLog _ReportedItemsLog $projection.CompanyCode = _ReportedItemsLog.CompanyCode and $projection.AccountingDocument = _ReportedItemsLog.AccountingDocument and $projection.FiscalYear = _ReportedItemsLog.FiscalYear
[0..1] I_HouseBankAccountText _HouseBankAccountText _HouseBankAccountText.Language = $session.system_language and _HouseBankAccountText.CompanyCode = $projection.CompanyCode and _HouseBankAccountText.HouseBank = $projection.HouseBank and _HouseBankAccountText.HouseBankAccount = $projection.HouseBankAccount

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PFRAUDITFECACDOC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
EndUserText.label France Audit File (FEC) – ACDOCA-data view

Fields (59)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_GLAccountLineItem SourceLedger
KEY CompanyCode I_GLAccountLineItem CompanyCode
KEY FiscalYear I_GLAccountLineItem FiscalYear
KEY AccountingDocument I_GLAccountLineItem AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItem LedgerGLLineItem
KEY Ledger I_GLAccountLineItem Ledger
KEY StatryRptCategory _ReportedItemsLog StatryRptCategory
KEY StatryRptgEntity _ReportedItemsLog StatryRptgEntity
KEY StatryRptRunID _ReportedItemsLog StatryRptRunID
LedgerFiscalYear LedgerFiscalYear
AccountingDocumentItem I_GLAccountLineItem AccountingDocumentItem
AccountingDocumentType I_GLAccountLineItem AccountingDocumentType
AccountingDocumentTypeName
DocumentReferenceID _JournalEntry DocumentReferenceID
PostingDate I_GLAccountLineItem PostingDate
DocumentDate I_GLAccountLineItem DocumentDate
AccountingDocumentCreationDate _JournalEntry AccountingDocumentCreationDate
FiscalPeriod I_GLAccountLineItem FiscalPeriod
AssignmentReference I_GLAccountLineItem AssignmentReference
ClearingJournalEntry I_GLAccountLineItem ClearingJournalEntry
ClearingJournalEntryFiscalYear I_GLAccountLineItem ClearingJournalEntryFiscalYear
ClearingDate I_GLAccountLineItem ClearingDate
ChartOfAccounts I_GLAccountLineItem ChartOfAccounts
GLAccount
GLAccountName
GLAccountLongName
GLAccountType I_GLAccountLineItem GLAccountType
HouseBank I_GLAccountLineItem HouseBank
HouseBankAccount I_GLAccountLineItem HouseBankAccount
HouseBankAccountDescription _HouseBankAccountText HouseBankAccountDescription
FinancialAccountType I_GLAccountLineItem FinancialAccountType
CountryChartOfAccounts I_GLAccountLineItem CountryChartOfAccounts
AlternativeGLAccount
AlternativeGLAccountName
AlternativeGLAccountLongName
OperationalGLAccountName
OperationalGLAccountLongName
CompanyCodeCurrency I_GLAccountLineItem CompanyCodeCurrency
TransactionCurrency I_GLAccountLineItem TransactionCurrency
AmountInTransactionCurrency I_GLAccountLineItem AmountInTransactionCurrency
AccountingDocumentCategory I_GLAccountLineItem AccountingDocumentCategory
ReferenceDocumentType I_GLAccountLineItem ReferenceDocumentType
IsReversal I_GLAccountLineItem IsReversal
IsReversed I_GLAccountLineItem IsReversed
_SourceLedger _SourceLedger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_JournalEntry _JournalEntry
_Ledger _Ledger
_AccountingDocumentType _AccountingDocumentType
_ClearingJrnlEntryFiscalYear _ClearingJrnlEntryFiscalYear
_ClearingJournalEntry _ClearingJournalEntry
_ChartOfAccounts _ChartOfAccounts
_CountryChartOfAccounts _CountryChartOfAccounts
_CompanyCodeCurrency _CompanyCodeCurrency
_TransactionCurrency _TransactionCurrency
_AccountingDocumentCategory _AccountingDocumentCategory
_ReferenceDocumentType _ReferenceDocumentType
_ReportedItemsLog _ReportedItemsLog
@AbapCatalog.sqlViewName: 'PFRAUDITFECACDOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@EndUserText.label: 'France Audit File (FEC) – ACDOCA-data'
define view P_FR_AuditFECAccountLineItem
  with parameters
    P_AlternativeGLAccountIsUsed : fis_disalteracct
  as select from           I_GLAccountLineItem          as GLAccountLineItem
    left outer to one join I_GLAccountInChartOfAccounts as altGLAcc on  GLAccountLineItem.CountryChartOfAccounts = altGLAcc.ChartOfAccounts
                                                                    and GLAccountLineItem.AlternativeGLAccount   = altGLAcc.GLAccount

  association [0..1] to I_OneTimeAccountBP     as _OneTimeAccountBP     on  GLAccountLineItem.CompanyCode            = _OneTimeAccountBP.CompanyCode
                                                                        and GLAccountLineItem.FiscalYear             = _OneTimeAccountBP.FiscalYear
                                                                        and GLAccountLineItem.AccountingDocument     = _OneTimeAccountBP.AccountingDocument
                                                                        and GLAccountLineItem.AccountingDocumentItem = _OneTimeAccountBP.AccountingDocumentItem

  association [0..*] to I_StRpJournalEntryLog  as _ReportedItemsLog     on  $projection.CompanyCode        = _ReportedItemsLog.CompanyCode
                                                                        and $projection.AccountingDocument = _ReportedItemsLog.AccountingDocument
                                                                        and $projection.FiscalYear         = _ReportedItemsLog.FiscalYear

  association [0..1] to I_HouseBankAccountText as _HouseBankAccountText on  _HouseBankAccountText.Language         = $session.system_language
                                                                        and _HouseBankAccountText.CompanyCode      = $projection.CompanyCode
                                                                        and _HouseBankAccountText.HouseBank        = $projection.HouseBank
                                                                        and _HouseBankAccountText.HouseBankAccount = $projection.HouseBankAccount

{

       @ObjectModel.foreignKey.association: '_SourceLedger'
  key  GLAccountLineItem.SourceLedger,
       @ObjectModel.foreignKey.association: '_CompanyCode'
  key  GLAccountLineItem.CompanyCode,
       @ObjectModel.foreignKey.association: '_FiscalYear'
  key  GLAccountLineItem.FiscalYear,
       @ObjectModel.foreignKey.association: '_JournalEntry'
  key  GLAccountLineItem.AccountingDocument,
  key  GLAccountLineItem.LedgerGLLineItem,
       @ObjectModel.foreignKey.association: '_Ledger'
  key  GLAccountLineItem.Ledger,

       //ACR part

  key  _ReportedItemsLog.StatryRptCategory,
  key  _ReportedItemsLog.StatryRptgEntity,
  key  _ReportedItemsLog.StatryRptRunID,

       LedgerFiscalYear, //ryear


       GLAccountLineItem.AccountingDocumentItem                                       as AccountingDocumentItem,

       @ObjectModel.foreignKey.association: '_AccountingDocumentType'
       GLAccountLineItem.AccountingDocumentType,
       _AccountingDocumentTypeText[1:Language = 'F'].AccountingDocumentTypeName,

       _JournalEntry.DocumentReferenceID, //xblnr


       cast( case
           when  _JournalEntry.DocumentReferenceID <> '' then _JournalEntry.DocumentReferenceID //xblnr

           when  _JournalEntry.TransactionCode <> ''     then _JournalEntry.TransactionCode     //tcode

           else ReferenceDocumentType
         end as fis_xblnr )                                                           as FR_FECPieceReference,

       GLAccountLineItem.PostingDate,
       GLAccountLineItem.DocumentDate,
       _JournalEntry.AccountingDocumentCreationDate,

       GLAccountLineItem.FiscalPeriod,

       cast( case
            when GLAccountLineItem.DocumentItemText <> ''    then GLAccountLineItem.DocumentItemText
            when GLAccountLineItem.AssignmentReference <> '' then GLAccountLineItem.AssignmentReference //zuonr

            else PostingDate
         end as fis_sgtxt )                                                           as DocumentItemText,

       GLAccountLineItem.AssignmentReference,

       @ObjectModel.foreignKey.association: '_ClearingJournalEntry'
       GLAccountLineItem.ClearingJournalEntry,

       @ObjectModel.foreignKey.association: '_ClearingJrnlEntryFiscalYear'
       GLAccountLineItem.ClearingJournalEntryFiscalYear,

       GLAccountLineItem.ClearingDate,

       @ObjectModel.foreignKey.association: '_ChartOfAccounts'
       GLAccountLineItem.ChartOfAccounts,

       cast( GLAccountLineItem.GLAccount as fis_racct )                               as GLAccount,

       _GLAcctInChartOfAccountsText[1:Language = 'F'].GLAccountName,     //text20

       _GLAcctInChartOfAccountsText[1:Language = 'F'].GLAccountLongName, //text50


       GLAccountLineItem.GLAccountType, //glaccount_type


       GLAccountLineItem.HouseBank, //hbkid

       GLAccountLineItem.HouseBankAccount, //hktid


       _HouseBankAccountText.HouseBankAccountDescription                              as HouseBankAccountDescription,

       GLAccountLineItem.FinancialAccountType, //koart


       @ObjectModel.foreignKey.association: '_CountryChartOfAccounts'
       GLAccountLineItem.CountryChartOfAccounts, //ktpl2


       cast( ltrim( GLAccountLineItem.AlternativeGLAccount, '0' ) as fis_altkt_skb1 ) as AlternativeGLAccount, //local account lokkt


       altGLAcc._Text[1:Language = 'F'].GLAccountName                                 as AlternativeGLAccountName,
       altGLAcc._Text[1:Language = 'F'].GLAccountLongName                             as AlternativeGLAccountLongName,

       cast(case  $parameters.P_AlternativeGLAccountIsUsed
         when 'X' then GLAccountLineItem.CountryChartOfAccounts
         else  GLAccountLineItem.ChartOfAccounts
        end as fifr_operational_coa_fec)                                              as OperationalChartOfAccounts,

       cast( case  $parameters.P_AlternativeGLAccountIsUsed
       when 'X' then
         case
           when GLAccountLineItem.AlternativeGLAccount <> ' ' then GLAccountLineItem.AlternativeGLAccount
           else
             case
               when GLAccountLineItem._GLAccountInCompanyCode.AlternativeGLAccount <> ' '
                                              then GLAccountLineItem._GLAccountInCompanyCode.AlternativeGLAccount    //local account from skb1-altkt

               else GLAccountLineItem.GLAccount
             end
          end
       else GLAccountLineItem.GLAccount
       end as fifr_operational_account )                                              as OperationalGLAccount,

       cast( case  $parameters.P_AlternativeGLAccountIsUsed
         when 'X' then
           case
            when  GLAccountLineItem.AlternativeGLAccount = '' and GLAccountLineItem._GLAccountInCompanyCode.AlternativeGLAccount = '' then 'X'
            else ''
           end
         else ''
       end as fifr_alternataccountismissing )                                         as AlternativeGLAccountIsMissing,

       'not filled in this view'                                                      as OperationalGLAccountName,

       'not filled in this view'                                                      as OperationalGLAccountLongName,

       cast( case
             when _Customer.Customer <> '' then _Customer.Customer
             when _Supplier.Supplier <> '' then _Supplier.Supplier
             else ''
         end as bu_partner preserving type )                                          as BusinessPartner,

       // CustomerName, SupplierName are Text80, which is too long for the DART file (CHAR35) -> NAME1 = OrganizationBPName1

       // still cast to business_partner_name for the label

       cast( case
             when _Customer.Customer <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName1, _Customer.OrganizationBPName1)
             when _Supplier.Supplier <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName1, _Supplier.OrganizationBPName1)
             else ''
       end as business_partner_name )                                                 as BusinessPartnerName,

       cast( case
             when _Customer.Customer <> '' then _Customer.Customer
             when _Supplier.Supplier <> '' then _Supplier.Supplier
             else ''
         end as fifr_subledgeraccount_fec preserving type )                           as FR_FECSubledgerAccount,

       cast( case
             when _Customer.Customer <> '' then left( coalesce(_OneTimeAccountBP.BusinessPartnerName1, _Customer.OrganizationBPName1), 35)
             when _Supplier.Supplier <> '' then left( coalesce(_OneTimeAccountBP.BusinessPartnerName1, _Supplier.OrganizationBPName1), 35)
             else ''
       end as fifr_subledgeraccountname_fec )                                         as FR_FECSubledgerAccountName,

       @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
       @Semantics.currencyCode:true
       GLAccountLineItem.CompanyCodeCurrency,

       @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
       cast( case GLAccountLineItem.DebitCreditCode
          when 'H' then  (-1) * GLAccountLineItem.AmountInCompanyCodeCurrency  //dmbtr

          else GLAccountLineItem.AmountInCompanyCodeCurrency
         end as fis_hsl)                                                              as AmountInCompanyCodeCurrency,

       @ObjectModel.foreignKey.association: '_TransactionCurrency'
       @Semantics.currencyCode:true
       GLAccountLineItem.TransactionCurrency,

       @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
       GLAccountLineItem.AmountInTransactionCurrency,

       @Semantics.currencyCode:true
       cast( case
          when ( GLAccountLineItem.CompanyCodeCurrency = GLAccountLineItem.TransactionCurrency ) then ' '
          when ( GLAccountLineItem.CompanyCodeCurrency <> GLAccountLineItem.TransactionCurrency ) then GLAccountLineItem.TransactionCurrency
          else ''
        end as waers_frgn )                                                           as ForeignCurrency,

       @Semantics: { amount : {currencyCode: 'ForeignCurrency'} }
       cast(

         case
            when ( GLAccountLineItem.CompanyCodeCurrency <> GLAccountLineItem.TransactionCurrency )
            then  GLAccountLineItem.AmountInTransactionCurrency       //wrbtr

            else 0
         end as fifr_foreigncurrencyamount_fec )                                      as FR_FECAmountInForeignCurrency,

       cast ( case GLAccountLineItem.DebitCreditCode
         when 'H' then 'C'
         when 'S' then 'D'
         else ''
         end as fis_shkzg )                                                           as DebitCreditCode, //shkzg


       @ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
       GLAccountLineItem.AccountingDocumentCategory,
       @ObjectModel.foreignKey.association: '_ReferenceDocumentType'
       GLAccountLineItem.ReferenceDocumentType,

       GLAccountLineItem.IsReversal,
       GLAccountLineItem.IsReversed,

       _SourceLedger,
       _CompanyCode,
       _FiscalYear,
       _JournalEntry,
       _Ledger,
       _AccountingDocumentType,
       _ClearingJrnlEntryFiscalYear,
       _ClearingJournalEntry,
       _ChartOfAccounts,
       _CountryChartOfAccounts,
       _CompanyCodeCurrency,
       _TransactionCurrency,
       _AccountingDocumentCategory,
       _ReferenceDocumentType,
       _ReportedItemsLog
}
where
  (
       GLAccountLineItem.AccountingDocumentCategory   =  '' //bstat, initial (normal documents)

    or GLAccountLineItem.AccountingDocumentCategory   =  'L' //bstat, L (postings non in leading ledger)

    or GLAccountLineItem.AccountingDocumentCategory   =  'U' //bstat, U (postings in general ledger only)

  )
  // and  Ledger                                       = SourceLedger // to avoid multiple records in case of various SourceLedeger assigned to one Ledger

  and  GLAccountLineItem.AccountingDocumentType       <> '' // AccountingDocumentType must be filled in ACDOCA

  and(
       GLAccountLineItem.AmountInCompanyCodeCurrency  <> 0.00
    or GLAccountLineItem.LedgerGLLineItem             =  '000001'
    or GLAccountLineItem.LedgerGLLineItem             =  '000002'
  )
  and(
       GLAccountLineItem.JrnlEntryItemMigrationSource =  ''
    or GLAccountLineItem.JrnlEntryItemMigrationSource =  'F'
    or GLAccountLineItem.JrnlEntryItemMigrationSource =  'G'
  )