P_PL_SAFTBILLINGDOCUMENTBASIC

CDS View

P_PL_SAFTBILLINGDOCUMENTBASIC is a CDS View in S/4HANA. It contains 5 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
P_PL_SAFTBillingDocument view from COMPOSITE
P_PL_SAFTSalesInvItem view inner COMPOSITE

Fields (5)

KeyField CDS FieldsUsed in Views
KEY BillingDocument BillingDocument 1
BillingDocumentCategory BillingDocumentCategory 1
BillingDocumentDate BillingDocumentDate 1
CancelledBillingDocument CancelledBillingDocument 1
PL_SAFTInvoiceType PL_SAFTInvoiceType 2
@AbapCatalog.sqlViewName: 'PPLSAFTBILLDOCB'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PL_SAFTBillingDocumentBasic
  as select from I_BillingDocument          as a

    inner join   I_PL_SAFTBillingDocTypeMap as BillingDocTypeMap on  BillingDocTypeMap.BillingDocumentType       =  a.BillingDocumentType
                                                                 and BillingDocTypeMap.BillingSDDocumentCategory =  a.SDDocumentCategory
                                                                 and BillingDocTypeMap.StartDate                 <= a.BillingDocumentDate
                                                                 and BillingDocTypeMap.EndDate                   >= a.BillingDocumentDate

    left outer to one join I_BillingDocument as CancelledBillingDocument on CancelledBillingDocument.BillingDocument = a.CancelledBillingDocument
    
    left outer to one join I_PL_SAFTBillingDocTypeMap as  CancelBillingDocTypeMap on  CancelBillingDocTypeMap.BillingDocumentType       =  CancelledBillingDocument.BillingDocumentType
                                                                 and CancelBillingDocTypeMap.BillingSDDocumentCategory =  CancelledBillingDocument.SDDocumentCategory
                                                                 and CancelBillingDocTypeMap.StartDate                 <= CancelledBillingDocument.BillingDocumentDate
                                                                 and CancelBillingDocTypeMap.EndDate                   >= CancelledBillingDocument.BillingDocumentDate
{
  key a.BillingDocument,
      a.BillingDocumentCategory,
      a.BillingDocumentType,
      a.BillingDocumentDate,
      a.CancelledBillingDocument,
      a.SDDocumentCategory,

      case 
        when   (BillingDocTypeMap.PL_SAFTInvoiceType = 'VAT' and BillingDocTypeMap.TransactionGroup = '8') 
            or (a.CancelledBillingDocument is not initial and CancelBillingDocTypeMap.PL_SAFTInvoiceType = 'VAT' and CancelBillingDocTypeMap.TransactionGroup = '8')                   
          then 'ZAL'
        else 
          BillingDocTypeMap.PL_SAFTInvoiceType
      end                                             as PL_SAFTInvoiceType
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENT",
"I_PL_SAFTBILLINGDOCTYPEMAP"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/