I_SAFTBillingOneTimeCustomer

DDL: I_SAFTBILLINGONETIMECUSTOMER SQL: ISAFTOTBILCUST Type: view COMPOSITE Package: ID-FI-SAFT_DEPREC

SAF-T Billing OneTimeCustomers

I_SAFTBillingOneTimeCustomer is a Composite CDS View that provides data about "SAF-T Billing OneTimeCustomers" in SAP S/4HANA. It reads from 6 data sources and exposes 47 fields with key fields BillingDocument, FiscalYear, CompanyCode, PartnerFunction, FiscalYear. It has 1 association to related views. Part of development package ID-FI-SAFT_DEPREC.

Data Sources (6)

SourceAliasJoin Type
I_SDDocumentCompletePartners Cust inner
I_SDDocumentCompletePartners Cust inner
I_BillingDocument SDDoc from
I_InvoiceList SDDoc union
I_OneTimeCustomerTaxNumber Tax left_outer
I_OneTimeCustomerTaxNumber Tax left_outer

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_CustomerCompany _CustCompany Cust.Customer = _CustCompany.Customer and SDDoc.CompanyCode = _CustCompany.CompanyCode

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName ISAFTOTBILCUST view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label SAF-T Billing OneTimeCustomers view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor NoSuccessor view

Fields (47)

KeyFieldSource TableSource FieldDescription
KEY BillingDocument I_InvoiceList BillingDocument
KEY FiscalYear I_InvoiceList FiscalYear
KEY CompanyCode I_InvoiceList CompanyCode
KEY PartnerFunction I_SDDocumentCompletePartners PartnerFunction
InvoiceDate I_InvoiceList BillingDocumentDate
Customer I_SDDocumentCompletePartners Customer
IsOneTimeAccount I_SDDocumentCompletePartners PartnerIsOneTimeAccount
ReconciliationAccount _CustCompany ReconciliationAccount
AddressNumber I_SDDocumentCompletePartners AddressID
AddressID I_SDDocumentCompletePartners AddressID
AddressPersonID I_SDDocumentCompletePartners AddressPersonID
FullName
StreetName
StreetPrefixName
AdditionalStreetPrefixName
StreetSuffixName
AdditionalStreetSuffixName
HouseNumber
Region
_DfltAddrRprstn I_SDDocumentCompletePartners _DfltAddrRprstn
PhoneNumber
FaxNumber
EmailAddress
InvoiceListasBillingDocument
KEY FiscalYear I_InvoiceList FiscalYear
KEY CompanyCode I_InvoiceList CompanyCode
KEY PartnerFunction I_SDDocumentCompletePartners PartnerFunction
InvoiceDate I_InvoiceList InvoiceListBillingDate
Customer I_SDDocumentCompletePartners Customer
IsOneTimeAccount I_SDDocumentCompletePartners PartnerIsOneTimeAccount
ReconciliationAccount _CustCompany ReconciliationAccount
AddressNumber I_SDDocumentCompletePartners AddressID
AddressID I_SDDocumentCompletePartners AddressID
AddressPersonID I_SDDocumentCompletePartners AddressPersonID
FullName
StreetName
StreetPrefixName
AdditionalStreetPrefixName
StreetSuffixName
AdditionalStreetSuffixName
HouseNumber
Region
_DfltAddrRprstn I_SDDocumentCompletePartners _DfltAddrRprstn
PhoneNumber
FaxNumber
EmailAddress
WebsiteURL
@AbapCatalog.sqlViewName: 'ISAFTOTBILCUST'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@EndUserText.label: 'SAF-T Billing OneTimeCustomers'
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]

@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'NoSuccessor'

define view I_SAFTBillingOneTimeCustomer
  as select from    I_BillingDocument            as SDDoc

    inner join      I_SDDocumentCompletePartners as Cust on SDDoc.BillingDocument = Cust.SDDocument

    left outer join I_OneTimeCustomerTaxNumber   as Tax  on  Cust.SDDocument      = Tax.SDDocument
                                                         and Cust.SDDocumentItem  = Tax.SDDocumentItem
                                                         and Cust.PartnerFunction = Tax.PartnerFunction

  association [0..1] to I_CustomerCompany as _CustCompany on  Cust.Customer     = _CustCompany.Customer
                                                          and SDDoc.CompanyCode = _CustCompany.CompanyCode //update 1905

{
  key SDDoc.BillingDocument                                                                                as BillingDocument,
  key SDDoc.FiscalYear                                                                                     as FiscalYear,
  key SDDoc.CompanyCode                                                                                    as CompanyCode,
  key Cust.PartnerFunction,
      SDDoc.BillingDocumentDate                                                                            as InvoiceDate,
      Cust.Customer                                                                                        as Customer,
      Cust.PartnerIsOneTimeAccount                                                                         as IsOneTimeAccount,

      case
        when SDDoc.VATRegistration is initial or SDDoc.VATRegistration is null
          then Tax.TaxNumber1
          else substring(SDDoc.VATRegistration,3,18)
      end                                                                                                  as CustomerVATRegistration,

      _CustCompany.ReconciliationAccount                                                                   as ReconciliationAccount,

      Cust.AddressID                                                                                       as AddressNumber,
      Cust.AddressID,
      Cust.AddressPersonID,
      concat_with_space(Cust._DfltAddrRprstn.OrganizationName1, Cust._DfltAddrRprstn.OrganizationName2, 1) as FullName,
      Cust._DfltAddrRprstn.StreetName                                                                      as StreetName,
      Cust._DfltAddrRprstn.StreetPrefixName1                                                               as StreetPrefixName,
      Cust._DfltAddrRprstn.StreetPrefixName1                                                               as AdditionalStreetPrefixName,
      Cust._DfltAddrRprstn.StreetSuffixName1                                                               as StreetSuffixName,
      Cust._DfltAddrRprstn.StreetSuffixName2                                                               as AdditionalStreetSuffixName,
      Cust._DfltAddrRprstn.HouseNumber                                                                     as HouseNumber,
      Cust._DfltAddrRprstn.Region                                                                          as Region,

      Cust._DfltAddrRprstn,

      Cust._DfltAddrRprstn._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber                          as PhoneNumber,
      Cust._DfltAddrRprstn._CurrentDfltFaxNumber.InternationalFaxNumber                                    as FaxNumber,
      Cust._DfltAddrRprstn._CurrentDfltEmailAddress.EmailAddress                                           as EmailAddress,

      ' '                                                                                                  as WebsiteURL
      //      cast(lower(Cust._Address._DefaultURLAddress.SearchURLAddress) as ad_uri2)                         as WebsiteURL


}
where
  PartnerIsOneTimeAccount = 'X'

union select from I_InvoiceList                as SDDoc

  inner join      I_SDDocumentCompletePartners as Cust on SDDoc.InvoiceList = Cust.SDDocument

  left outer join I_OneTimeCustomerTaxNumber   as Tax  on  Cust.SDDocument      = Tax.SDDocument
                                                       and Cust.SDDocumentItem  = Tax.SDDocumentItem
                                                       and Cust.PartnerFunction = Tax.PartnerFunction

association [0..1] to I_CustomerCompany as _CustCompany on  Cust.Customer     = _CustCompany.Customer
                                                        and SDDoc.CompanyCode = _CustCompany.CompanyCode //update 1905

{
  key SDDoc.InvoiceList                                                                                    as BillingDocument,
  key SDDoc.FiscalYear                                                                                     as FiscalYear,
  key SDDoc.CompanyCode                                                                                    as CompanyCode,
  key Cust.PartnerFunction,
      SDDoc.InvoiceListBillingDate                                                                         as InvoiceDate,
      Cust.Customer                                                                                        as Customer,
      Cust.PartnerIsOneTimeAccount                                                                         as IsOneTimeAccount,

      case
        when SDDoc.VATRegistration is initial or SDDoc.VATRegistration is null
          then Tax.TaxNumber1
          else substring(SDDoc.VATRegistration,3,18)
      end                                                                                                  as CustomerVATRegistration,

      _CustCompany.ReconciliationAccount                                                                   as ReconciliationAccount,

      Cust.AddressID                                                                                       as AddressNumber,
      Cust.AddressID,
      Cust.AddressPersonID,
      concat_with_space(Cust._DfltAddrRprstn.OrganizationName1, Cust._DfltAddrRprstn.OrganizationName2, 1) as FullName,
      Cust._DfltAddrRprstn.StreetName                                                                      as StreetName,
      Cust._DfltAddrRprstn.StreetPrefixName1                                                               as StreetPrefixName,
      Cust._DfltAddrRprstn.StreetPrefixName1                                                               as AdditionalStreetPrefixName,
      Cust._DfltAddrRprstn.StreetSuffixName1                                                               as StreetSuffixName,
      Cust._DfltAddrRprstn.StreetSuffixName2                                                               as AdditionalStreetSuffixName,
      Cust._DfltAddrRprstn.HouseNumber                                                                     as HouseNumber,
      Cust._DfltAddrRprstn.Region                                                                          as Region,

      Cust._DfltAddrRprstn,

      Cust._DfltAddrRprstn._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber                          as PhoneNumber,
      Cust._DfltAddrRprstn._CurrentDfltFaxNumber.InternationalFaxNumber                                    as FaxNumber,
      Cust._DfltAddrRprstn._CurrentDfltEmailAddress.EmailAddress                                           as EmailAddress,

      ' '                                                                                                  as WebsiteURL
      //      cast(lower(Cust._Address._DefaultURLAddress.SearchURLAddress) as ad_uri2)                         as WebsiteURL


}
where
  PartnerIsOneTimeAccount = 'X'