P_HU_SD_AUDITINVOICE

DDL: P_HU_SD_AUDITINVOICE Type: view_entity COMPOSITE

P_HU_SD_AUDITINVOICE is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_CompanyCode, P_HU_SD_AUDITREPORTAGGR) and exposes 35 fields.

Data Sources (2)

SourceAliasJoin Type
I_CompanyCode _CompanyCode inner
P_HU_SD_AUDITREPORTAGGR P_HU_SD_AUDITREPORTAGGR from

Parameters (1)

NameTypeDefault
P_VAT_number stceg

Annotations (7)

NameValueLevelField
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.personalData.blocking #REQUIRED view

Fields (35)

KeyFieldSource TableSource FieldDescription
CompanyCode P_HU_SD_AUDITREPORTAGGR CompanyCode Receiver Company Code
OriginalReferenceDocument P_HU_SD_AUDITREPORTAGGR OriginalReferenceDocument Reference Key
CompanyCodeCurrency P_HU_SD_AUDITREPORTAGGR CompanyCodeCurrency Local Currency
DocumentCurrency P_HU_SD_AUDITREPORTAGGR DocumentCurrency Document Currency
DocumentReferenceID P_HU_SD_AUDITREPORTAGGR DocumentReferenceID Reference
CustomerInvoiceType P_HU_SD_AUDITREPORTAGGR CustomerInvoiceType
ReferenceDocumentType P_HU_SD_AUDITREPORTAGGR ReferenceDocumentType Reference Document Type
DocumentDate P_HU_SD_AUDITREPORTAGGR DocumentDate Journal Entry Date
PostingDate P_HU_SD_AUDITREPORTAGGR PostingDate Posting Date for GR
TaxFulfillmentDate P_HU_SD_AUDITREPORTAGGR TaxFulfillmentDate Tax Settlement Date
TaxNumber3endasstcegasCustomerTaxNumber
CustomerVATRegistration I_Customer VATRegistration VAT Registration No.
CustomerFullName
CustomerPostalCode
CustomerCityName
CustomerDistrict
CustomerStreetName
CustomerHouseNumber
CustomerBuilding
CustomerFloor
BusinessPartnerType I_BusinessPartner BusinessPartnerType Undefined range (can be used for patch levels)
SupplierTaxNumber
SupplierVATRegistration I_CompanyCode VATRegistration VAT Registration No.
SupplierFullName _SuppplierAddress AddresseeFullName Full Name
SupplierPostalCode _SuppplierAddress PostalCode Postal Code
SupplierCityName _SuppplierAddress CityName Name
SupplierDistrict _SuppplierAddress DistrictName District
SupplierStreetName _SuppplierAddress StreetName Text
SupplierHouseNumber _SuppplierAddress HouseNumber House Number
SupplierBuilding _SuppplierAddress Building Building code
SupplierFloor _SuppplierAddress Floor Floor
NetPriceAmount P_HU_SD_AUDITREPORTAGGR NetPriceAmount Net Price
TaxAmount P_HU_SD_AUDITREPORTAGGR TaxAmount Tax Amt in Rptg Crcy
GrossAmount P_HU_SD_AUDITREPORTAGGR GrossAmount Gross value
TaxAmountInCoCodeCrcy P_HU_SD_AUDITREPORTAGGR TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_HU_SD_AUDITINVOICE.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- Parameters: P_VAT_number : stceg

CREATE VIEW P_HU_SD_AUDITINVOICE AS
SELECT
  P_HU_SD_AUDITREPORTAGGR.CompanyCode AS CompanyCode,
  P_HU_SD_AUDITREPORTAGGR.OriginalReferenceDocument AS OriginalReferenceDocument,
  P_HU_SD_AUDITREPORTAGGR.CompanyCodeCurrency AS CompanyCodeCurrency,
  P_HU_SD_AUDITREPORTAGGR.DocumentCurrency AS DocumentCurrency,
  P_HU_SD_AUDITREPORTAGGR.DocumentReferenceID AS DocumentReferenceID,
  P_HU_SD_AUDITREPORTAGGR.CustomerInvoiceType AS CustomerInvoiceType,
  P_HU_SD_AUDITREPORTAGGR.ReferenceDocumentType AS ReferenceDocumentType,
  P_HU_SD_AUDITREPORTAGGR.DocumentDate AS DocumentDate,
  P_HU_SD_AUDITREPORTAGGR.PostingDate AS PostingDate,
  P_HU_SD_AUDITREPORTAGGR.TaxFulfillmentDate AS TaxFulfillmentDate,
  cast(case when I_Customer.TaxNumber3 = '' then I_Customer.TaxNumber1 else I_Customer.TaxNumber3 end as stceg) as CustomerTaxNumber AS TaxNumber3endasstcegasCustomerTaxNumber,
  I_Customer.VATRegistration AS CustomerVATRegistration,
  _BillingDocument._PayerParty._AddressRepresentation.AddresseeFullName AS CustomerFullName,
  _BillingDocument._PayerParty._AddressRepresentation.PostalCode AS CustomerPostalCode,
  _BillingDocument._PayerParty._AddressRepresentation.CityName AS CustomerCityName,
  _BillingDocument._PayerParty._AddressRepresentation.DistrictName AS CustomerDistrict,
  _BillingDocument._PayerParty._AddressRepresentation.StreetName AS CustomerStreetName,
  _BillingDocument._PayerParty._AddressRepresentation.HouseNumber AS CustomerHouseNumber,
  _BillingDocument._PayerParty._AddressRepresentation.Building AS CustomerBuilding,
  _BillingDocument._PayerParty._AddressRepresentation.Floor AS CustomerFloor,
  I_BusinessPartner.BusinessPartnerType AS BusinessPartnerType,
  $parameters.P_VAT_number AS SupplierTaxNumber,
  _CompanyCode.VATRegistration AS SupplierVATRegistration,
  _SuppplierAddress.AddresseeFullName AS SupplierFullName,
  _SuppplierAddress.PostalCode AS SupplierPostalCode,
  _SuppplierAddress.CityName AS SupplierCityName,
  _SuppplierAddress.DistrictName AS SupplierDistrict,
  _SuppplierAddress.StreetName AS SupplierStreetName,
  _SuppplierAddress.HouseNumber AS SupplierHouseNumber,
  _SuppplierAddress.Building AS SupplierBuilding,
  _SuppplierAddress.Floor AS SupplierFloor,
  P_HU_SD_AUDITREPORTAGGR.NetPriceAmount AS NetPriceAmount,
  P_HU_SD_AUDITREPORTAGGR.TaxAmount AS TaxAmount,
  P_HU_SD_AUDITREPORTAGGR.GrossAmount AS GrossAmount,
  P_HU_SD_AUDITREPORTAGGR.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcy
FROM P_HU_SD_AUDITREPORTAGGR
INNER JOIN I_CompanyCode AS _CompanyCode ON /* join condition not captured in parsed metadata */
;