P_RO_SAFTBP

DDL: P_RO_SAFTBP SQL: PROSAFTBP Type: view CONSUMPTION

P_RO_SAFTBP is a Consumption CDS View in SAP S/4HANA. It reads from 4 data sources (I_GLAccountLineItemRawData, I_GLAccountLineItemRawData, I_RO_BusinessPartnerTaxType, I_RO_BusinessPartnerTaxType) and exposes 29 fields with key fields Ledger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem.

Data Sources (4)

SourceAliasJoin Type
I_GLAccountLineItemRawData Acdoca inner
I_GLAccountLineItemRawData Acdoca inner
I_RO_BusinessPartnerTaxType BPTax from
I_RO_BusinessPartnerTaxType BPTax union_all

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PROSAFTBP view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #NOT_REQUIRED view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (29)

KeyFieldSource TableSource FieldDescription
KEY Ledger I_GLAccountLineItemRawData SourceLedger
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItemRawData LedgerGLLineItem
KEY FinancialAccountType I_RO_BusinessPartnerTaxType FinancialAccountType
KEY BusinessPartner I_RO_BusinessPartnerTaxType BusinessPartner
KEY ValidFrom I_RO_BusinessPartnerTaxType ValidFrom
KEY ValidTo I_RO_BusinessPartnerTaxType ValidTo
KEY BusinessPartnerIsSAFTRelevant I_RO_BusinessPartnerTaxType BusinessPartnerIsSAFTRelevant
VATRegistration I_RO_BusinessPartnerTaxType VATRegistration
TaxType I_RO_BusinessPartnerTaxType TaxType
Customer I_GLAccountLineItemRawData Customer
Supplier I_GLAccountLineItemRawData Supplier
SourceLedgerasLedger
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItemRawData LedgerGLLineItem
KEY FinancialAccountType I_RO_BusinessPartnerTaxType FinancialAccountType
KEY BusinessPartner I_RO_BusinessPartnerTaxType BusinessPartner
KEY ValidFrom I_RO_BusinessPartnerTaxType ValidFrom
KEY ValidTo I_RO_BusinessPartnerTaxType ValidTo
KEY BusinessPartnerIsSAFTRelevant I_RO_BusinessPartnerTaxType BusinessPartnerIsSAFTRelevant
VATRegistration I_RO_BusinessPartnerTaxType VATRegistration
TaxType I_RO_BusinessPartnerTaxType TaxType
Customer I_GLAccountLineItemRawData Customer
Supplier I_GLAccountLineItemRawData Supplier
PostingDate I_GLAccountLineItemRawData PostingDate
@AbapCatalog.sqlViewName: 'PROSAFTBP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #CONSUMPTION
@VDM.private:true
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_RO_SAFTBP 
  as select from I_RO_BusinessPartnerTaxType as BPTax
    inner join   I_GLAccountLineItemRawData  as Acdoca on Acdoca.Customer = BPTax.BusinessPartner

{
  key Acdoca.SourceLedger as Ledger,
  key Acdoca.CompanyCode,
  key Acdoca.FiscalYear,
  key Acdoca.AccountingDocument,
  key Acdoca.LedgerGLLineItem,  
  
  key BPTax.FinancialAccountType,
  key BPTax.BusinessPartner,
  key BPTax.ValidFrom,
  key BPTax.ValidTo,
  key BPTax.BusinessPartnerIsSAFTRelevant,
      BPTax.VATRegistration,
      BPTax.TaxType,
      Acdoca.Customer,
      Acdoca.Supplier,
      Acdoca.PostingDate

}
where
      BPTax.FinancialAccountType          =  'D'
  and BPTax.BusinessPartnerIsSAFTRelevant =  'X'
  and BPTax.ValidFrom                     <= Acdoca.PostingDate
  and BPTax.ValidTo                       >= Acdoca.PostingDate


union all select from I_RO_BusinessPartnerTaxType as BPTax
  inner join      I_GLAccountLineItemRawData  as Acdoca on Acdoca.Supplier = BPTax.BusinessPartner

{

  key Acdoca.SourceLedger as Ledger,
  key Acdoca.CompanyCode,
  key Acdoca.FiscalYear,
  key Acdoca.AccountingDocument,
  key Acdoca.LedgerGLLineItem, 

  key BPTax.FinancialAccountType,
  key BPTax.BusinessPartner,
  key BPTax.ValidFrom,
  key BPTax.ValidTo,
  key BPTax.BusinessPartnerIsSAFTRelevant,
      BPTax.VATRegistration,
      BPTax.TaxType,
      Acdoca.Customer,
      Acdoca.Supplier,
      Acdoca.PostingDate

}
where
      BPTax.FinancialAccountType          =  'K'
  and BPTax.BusinessPartnerIsSAFTRelevant =  'X'
  and BPTax.ValidFrom                     <= Acdoca.PostingDate
  and BPTax.ValidTo                       >= Acdoca.PostingDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GLACCOUNTLINEITEMRAWDATA",
"I_RO_BUSINESSPARTNERTAXTYPE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/