C_PT_SAFTPaytDocHeaderCube

DDL: C_PT_SAFTPAYTDOCHEADERCUBE Type: view_entity CONSUMPTION Package: ID-FI-SAFT_DEPREC

Payment Header for SAFT PT - Cube

C_PT_SAFTPaytDocHeaderCube is a Consumption CDS View (Cube) that provides data about "Payment Header for SAFT PT - Cube" in SAP S/4HANA. It reads from 5 data sources (I_AccountingDocumentType, I_PT_SAFTPaytSignatureCheck, I_ClrgInfoRelationForAcctgDoc, I_JournalEntry, I_PT_DgtlSgntrNmbrRngeAcctg) and exposes 11 fields with key fields CompanyCode, PostingDate, FiscalYear, ClearingAccountingDocument. It has 1 association to related views. Part of development package ID-FI-SAFT_DEPREC.

Data Sources (5)

SourceAliasJoin Type
I_AccountingDocumentType AcctDoc inner
I_PT_SAFTPaytSignatureCheck check inner
I_ClrgInfoRelationForAcctgDoc Clear inner
I_JournalEntry Document from
I_PT_DgtlSgntrNmbrRngeAcctg NrRange inner

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_AccountingDocument _ReversalDocument _ReversalDocument.AccountingDocument = Document.ReverseDocument and _ReversalDocument.FiscalYear = Document.ReverseDocumentFiscalYear and _ReversalDocument.CompanyCode = Document.CompanyCode

Annotations (12)

NameValueLevelField
EndUserText.label Payment Header for SAFT PT - Cube view
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #CONSUMPTION view
Metadata.allowExtensions true view
Analytics.dataCategory #CUBE view
Analytics.internalName #LOCAL view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor C_PT_SAFTPaymentDocumentC view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode
KEY PostingDate I_JournalEntry PostingDate
KEY FiscalYear I_JournalEntry FiscalYear
KEY ClearingAccountingDocument I_JournalEntry AccountingDocument
char30asPaymentReference
FiscalPeriod I_JournalEntry FiscalPeriod
char70asDocumentTransaction
CreationTime52endasPaymentStatusDateText
ReversalReason I_JournalEntry ReversalReason
CreatedByUser I_JournalEntry AccountingDocCreatedByUser
CreationTime52asLastChangeDateTimeText
@EndUserText.label: 'Payment Header for SAFT PT - Cube'
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #CONSUMPTION
@Metadata.allowExtensions:true
@Analytics: { dataCategory: #CUBE }
@Analytics.internalName:#LOCAL
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #XL,
  dataClass: #MIXED
}

@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'C_PT_SAFTPaymentDocumentC'
define view entity C_PT_SAFTPaytDocHeaderCube
  as select from           I_JournalEntry                as Document

    inner join             I_PT_SAFTPaytSignatureCheck   as check   on  check.ClearingInfoCompanyCode    = Document.CompanyCode
                                                                    and check.ClearingAccountingDocument = Document.AccountingDocument
                                                                    and check.ClearingFiscalYear         = Document.FiscalYear
                                                                    and check.CapacityIsToBeChecked      = 'X'

    inner join             I_ClrgInfoRelationForAcctgDoc as Clear   on  Clear.ClearingInfoCompanyCode    =  Document.CompanyCode
                                                                    and Clear.ClearingAccountingDocument =  Document.AccountingDocument
                                                                    and Clear.ClearingFiscalYear         =  Document.FiscalYear
                                                                    and Clear.ClearingInformationIndex   =  '000001'
                                                                    and Clear.AccountType                =  'D' //only customers accounts

                                                                    and Clear.SpecialGLCode              <> 'F'

    inner join             I_AccountingDocumentType      as AcctDoc on AcctDoc.AccountingDocumentType = Document.AccountingDocumentType


    inner join             I_PT_DgtlSgntrNmbrRngeAcctg   as NrRange on  NrRange.CompanyCode                 =  Document.CompanyCode
                                                                    and NrRange.ToFiscalYear                >= Document.FiscalYear
                                                                    and NrRange.NumberRangeInterval         =  AcctDoc.AccountingDocumentNumberRange
                                                                    and NrRange.PT_DigitalSignatureFromDate <= Document.PostingDate

    left outer to one join I_PT_PaytRcptSersDocNumber    as atcud   on  Document.CompanyCode        = atcud.CompanyCode
                                                                    and Document.AccountingDocument = atcud.AccountingDocument
                                                                    and Document.FiscalYear         = atcud.FiscalYear
  association [0..1] to I_AccountingDocument as _ReversalDocument on  _ReversalDocument.AccountingDocument = Document.ReverseDocument
                                                                  and _ReversalDocument.FiscalYear         = Document.ReverseDocumentFiscalYear
                                                                  and _ReversalDocument.CompanyCode        = Document.CompanyCode
{
  key  Document.CompanyCode,
  key  Document.PostingDate                                                                                              as PostingDate,
  key  Document.FiscalYear,
  key  Document.AccountingDocument                                                                                       as ClearingAccountingDocument,
       cast(concat(
         concat(
           concat_with_space(Document.AccountingDocumentType, NrRange.PortugueseDgtlSignatureSeries, 1), '/'),
                             Document.AccountingDocument) as abap.char(30))                                              as PaymentReference,

       case when atcud.PT_SeriesDocumentNumber is initial or atcud.PT_SeriesDocumentNumber is null
         then cast( '0' as glo_pt_atcud )
         else atcud.PT_SeriesDocumentNumber
       end                                                                                                               as PT_SeriesDocumentNumber,
       Document.FiscalPeriod                                                                                             as FiscalPeriod, //Period

       cast(concat_with_space(concat(substring(Document.DocumentDate,1,4),
         concat('-',
           concat(substring(Document.DocumentDate,5,2),
             concat('-', substring(Document.DocumentDate,7,2))))),
               concat_with_space(Document.AccountingDocumentType, Document.AccountingDocument, 1), 1)  as abap.char(70)) as DocumentTransaction,

       case when atcud.PT_SeriesDocumentType is initial or atcud.PT_SeriesDocumentType is null
         then cast('RG' as glo_pt_series_dt)
         else atcud.PT_SeriesDocumentType
       end                                                                                                               as PT_SeriesDocumentType,
       case
         when Document.ReverseDocument is not initial and Document.IsReversed <> ''
          then 'A'
         else 'N'
       end                                                                                                               as DocumentBillingStatus,
       case
         when Document.ReverseDocument is not initial and Document.IsReversed <> ''
          then concat(substring(Document.AccountingDocumentCreationDate,1,4),
                concat('-',
                  concat(substring(_ReversalDocument.AccountingDocumentCreationDate,5,2),
                    concat('-',
                      concat(substring(_ReversalDocument.AccountingDocumentCreationDate,7,2),
                        concat('T',
                          concat(substring(_ReversalDocument.CreationTime,1,2),
                            concat(':',
                              concat(substring(_ReversalDocument.CreationTime,3,2),
                                concat(':', substring(_ReversalDocument.CreationTime,5,2)))))))))))

         else concat(substring(Document.AccountingDocumentCreationDate,1,4),
                concat('-',
                  concat(substring(Document.AccountingDocumentCreationDate,5,2),
                    concat('-',
                      concat(substring(Document.AccountingDocumentCreationDate,7,2),
                        concat('T',
                          concat(substring(Document.CreationTime,1,2),
                            concat(':',
                              concat(substring(Document.CreationTime,3,2),
                                concat(':', substring(Document.CreationTime,5,2)))))))))))
       end                                                                                                               as PaymentStatusDateText,
       Document.ReversalReason                                                                                           as ReversalReason,

       case
         when Document.ReverseDocument is not initial and Document.IsReversed <> ''
          then  _ReversalDocument.AccountingDocCreatedByUser
         else Document.AccountingDocCreatedByUser
       end                                                                                                               as LastChangedByUser, ///SOURCEID,

       Document.AccountingDocCreatedByUser                                                                               as CreatedByUser, //SOURCEID 4.1.4.10,

       concat(substring(Document.AccountingDocumentCreationDate,1,4),
                  concat('-',
                    concat(substring(Document.AccountingDocumentCreationDate,5,2),
                      concat('-',
                        concat(substring(Document.AccountingDocumentCreationDate,7,2),
                          concat('T',
                            concat(substring(Document.CreationTime,1,2),
                              concat(':',
                                concat(substring(Document.CreationTime,3,2),
                                  concat(':', substring(Document.CreationTime,5,2)))))))))))                             as LastChangeDateTimeText //SystemEntryDate


}
where
       Document.IsReversal                 =  ' '
  and(
       Document.AccountingDocumentCategory =  ''
    or Document.AccountingDocumentCategory =  'J'
    or Document.AccountingDocumentCategory =  'U'
    or Document.AccountingDocumentCategory =  'L'
  )
  and  Document.FiscalPeriod               != '000'