I_PT_SAFTTaxCodeCheck
Tax Code used for SAFT File
I_PT_SAFTTaxCodeCheck is a Composite CDS View that provides data about "Tax Code used for SAFT File" in SAP S/4HANA. It reads from 9 data sources and exposes 17 fields with key fields CompanyCode, PortugueseInvoiceNumber, BillingDocumentItem, DocumentDate, PortugueseInvoiceNumber. Part of development package GLO_FIN_IS_SAFT_PT.
Data Sources (9)
| Source | Alias | Join Type |
|---|---|---|
| I_PT_BillgDocDgtlSgntr | DigSig | inner |
| I_PT_AcctgDocDgtlSgntr | DigSig | inner |
| I_PT_SettlmtDocsDgtlSgntr | DigSig | inner |
| I_PT_DeliveryDgtlSgntr | DigSig | inner |
| I_OperationalAcctgDocItem | Document | from |
| I_OperationalAcctgDocItem | Document | union |
| R_SetlMgmtDocItmCustPrcgElmnt | Document | union |
| I_PT_SAFTDeliveryItemTax | Document | union |
| R_SettlmtMgmtDocItem | DocumentItem | inner |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.personalData.blocking | #REQUIRED | view | |
| EndUserText.label | Tax Code used for SAFT File | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (17)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_PT_SAFTDeliveryItemTax | CompanyCode | |
| KEY | PortugueseInvoiceNumber | I_PT_DeliveryDgtlSgntr | PortugueseInvoiceNumber | |
| KEY | BillingDocumentItem | I_PT_SAFTDeliveryItemTax | BillingDocumentItem | |
| KEY | DocumentDate | I_PT_SAFTDeliveryItemTax | BillingDocumentDate | |
| CompanyCode | ||||
| KEY | PortugueseInvoiceNumber | I_PT_DeliveryDgtlSgntr | PortugueseInvoiceNumber | |
| KEY | BillingDocumentItem | |||
| KEY | DocumentDate | I_PT_SAFTDeliveryItemTax | DocumentDate | |
| CompanyCode | ||||
| KEY | PortugueseInvoiceNumber | I_PT_DeliveryDgtlSgntr | ReferenceDocumentNumber | |
| KEY | BillingDocumentItem | |||
| KEY | DocumentDate | I_PT_DeliveryDgtlSgntr | InvoiceDate | |
| CompanyCode | ||||
| KEY | PortugueseInvoiceNumber | I_PT_DeliveryDgtlSgntr | PortugueseDeliveryNumber | |
| KEY | BillingDocumentItem | |||
| KEY | DocumentDate | I_PT_SAFTDeliveryItemTax | DeliveryDate | |
| TaxCode |
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #COMPOSITE
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Tax Code used for SAFT File'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #D,
sizeCategory: #XXL,
dataClass: #MIXED
}
define view entity I_PT_SAFTTaxCodeCheck
as select distinct from I_BillingDocumentItem as Document
inner join I_PT_BillgDocDgtlSgntr as DigSig on DigSig.BillingDocument = Document.BillingDocument
and DigSig.CompanyCode = Document.CompanyCode
// inner join I_PT_SAFTBillgMasterDataTax as TaxTab on Document.TaxCode = TaxTab.TaxCode
// and Document.BillingDocumentDate >= TaxTab.StartDate
// and Document.BillingDocumentDate <= TaxTab.EndDate
{
key Document.CompanyCode,
key DigSig.PortugueseInvoiceNumber,
key Document.BillingDocumentItem,
key Document.BillingDocumentDate as DocumentDate,
cast(Document.TaxCode as mwskz) as TaxCode
}
union select from I_OperationalAcctgDocItem as Document
inner join I_PT_AcctgDocDgtlSgntr as DigSig on DigSig.AccountingDocument = Document.AccountingDocument
and DigSig.CompanyCode = Document.CompanyCode
and DigSig.FiscalYear = Document.FiscalYear
// inner join I_PT_SAFTBillgMasterDataTax as TaxTab on Document.TaxCode = TaxTab.TaxCode
// and Document.DocumentDate between TaxTab.StartDate and TaxTab.EndDate
{
key Document.CompanyCode,
key DigSig.PortugueseInvoiceNumber,
key cast(Document.AccountingDocumentItem as abap.char(6)) as BillingDocumentItem,
key Document.DocumentDate,
cast(Document.TaxCode as mwskz) as TaxCode
}
where
Document.AccountingDocumentItemType <> 'T'
and Document.FinancialAccountType = 'S'
union select from R_SetlMgmtDocItmCustPrcgElmnt as Document
inner join R_SettlmtMgmtDocItem as DocumentItem on Document.SettlmtMgmtDoc = DocumentItem.SettlmtMgmtDoc
and Document.SettlmtMgmtDocItem = DocumentItem.SettlmtMgmtDocItem
inner join I_PT_SettlmtDocsDgtlSgntr as DigSig on Document.SettlmtMgmtDoc = DigSig.InvoiceDocumentNumber
and DocumentItem.CompanyCode = DigSig.CompanyCode
// inner join I_PT_SAFTBillgMasterDataTax as TaxTab on Document.TaxCode = TaxTab.TaxCode
// and DigSig.InvoiceDate between TaxTab.StartDate and TaxTab.EndDate
{
key DocumentItem.CompanyCode,
key DigSig.ReferenceDocumentNumber as PortugueseInvoiceNumber,
key cast(DocumentItem.SettlmtMgmtDocItem as abap.char(6)) as BillingDocumentItem,
key DigSig.InvoiceDate as DocumentDate,
cast(Document.TaxCode as mwskz) as TaxCode
}
where
Document.ConditionClass = 'D'
and Document.ConditionIsForStatistics = ''
and(
Document.ConditionInactiveReason = ''
or Document.ConditionInactiveReason = 'W'
)
union select from I_PT_SAFTDeliveryItemTax as Document
inner join I_PT_DeliveryDgtlSgntr as DigSig on Document.DeliveryDocument = DigSig.DeliveryDocument
// inner join I_PT_SAFTBillgMasterDataTax as TaxTab on Document.TaxCode = TaxTab.TaxCode
// and Document.DeliveryDate between TaxTab.StartDate and TaxTab.EndDate
{
key Document.CompanyCode,
key DigSig.PortugueseDeliveryNumber as PortugueseInvoiceNumber,
key cast(Document.DeliveryDocumentItem as abap.char(6)) as BillingDocumentItem,
key Document.DeliveryDate as DocumentDate,
cast(Document.TaxCode as mwskz) as TaxCode
}
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA