P_RU_VATInvcNmbrWthBranchCode

DDL: P_RU_VATINVCNMBRWTHBRANCHCODE SQL: PRUVATINVNUMBRC Type: view COMPOSITE

P_RU_VATInvcNmbrWthBranchCode is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_CompanyCodeAddlSpec, P_RU_TaxCode) and exposes 5 fields with key fields CompanyCode, AccountingDocument, FiscalYear.

Data Sources (2)

SourceAliasJoin Type
P_CompanyCodeAddlSpec P_CompanyCodeAddlSpec inner
P_RU_TaxCode TaxCode inner

Annotations (7)

NameValueLevelField
VDM.private true view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName PRUVATINVNUMBRC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_RU_BSET CompanyCode
KEY AccountingDocument P_RU_BSET AccountingDocument
KEY FiscalYear P_RU_BSET FiscalYear
pavalasAccountingDocWithBranchCode
BranchCode
@VDM.private:true
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'PRUVATINVNUMBRC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_RU_VATInvcNmbrWthBranchCode
  as select distinct from P_RU_BSET //we cant select directly from bseg because it doesn't contain 0% VAT


    inner join            P_CompanyCodeAddlSpec   on P_CompanyCodeAddlSpec.bukrs = P_RU_BSET.CompanyCode

    inner join            P_RU_TaxCode as TaxCode on  TaxCode.CompanyCode = P_RU_BSET.CompanyCode
                                                  and TaxCode.TaxCode     = P_RU_BSET.TaxCode
{
  key P_RU_BSET.CompanyCode,
  key P_RU_BSET.AccountingDocument,
  key P_RU_BSET.FiscalYear,
      //  I_TaxCode.TaxCode,                            //in bset could be several tax codes for document, so do not output TaxCode here otherwise CDS will return several lines for 1 document!!

      concat(P_RU_BSET.AccountingDocument,
             concat('/', P_CompanyCodeAddlSpec.paval)) as AccountingDocWithBranchCode,
      concat('/', P_CompanyCodeAddlSpec.paval)         as BranchCode
}
where
      TaxCode.TaxType             =  'A'
  and P_CompanyCodeAddlSpec.party =  'SAPR21'
  and P_CompanyCodeAddlSpec.paval <> ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_COMPANYCODEADDLSPEC",
"P_RU_BSET",
"P_RU_TAXCODE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/