I_RO_SAFTOneTimeSupplier
RO SAFT One Time Supplier
I_RO_SAFTOneTimeSupplier is a Composite CDS View that provides data about "RO SAFT One Time Supplier" in SAP S/4HANA. It reads from 3 data sources (I_OperationalAcctgDocItem, I_JournalEntryItemOneTimeData, P_RO_SAFTBSECTaxID) and exposes 11 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_OperationalAcctgDocItem | Bseg | inner |
| I_JournalEntryItemOneTimeData | Ots | from |
| P_RO_SAFTBSECTaxID | OtsStcd | inner |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | IROSAFTOTS | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #M | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | RO SAFT One Time Supplier | view |
Fields (11)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_JournalEntryItemOneTimeData | CompanyCode | |
| KEY | AccountingDocument | I_JournalEntryItemOneTimeData | AccountingDocument | |
| KEY | FiscalYear | I_JournalEntryItemOneTimeData | FiscalYear | |
| KEY | AccountingDocumentItem | I_JournalEntryItemOneTimeData | AccountingDocumentItem | |
| Supplier | I_OperationalAcctgDocItem | Supplier | ||
| CityName | I_JournalEntryItemOneTimeData | CityName | ||
| Country | I_JournalEntryItemOneTimeData | Country | ||
| PostalCode | I_JournalEntryItemOneTimeData | PostalCode | ||
| StreetName | I_JournalEntryItemOneTimeData | StreetAddressName | ||
| Region | I_JournalEntryItemOneTimeData | Region | ||
| BusinessPartnerName1 | I_JournalEntryItemOneTimeData | BusinessPartnerName1 |
@AbapCatalog.sqlViewName: 'IROSAFTOTS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #M
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@AccessControl.authorizationCheck: #MANDATORY
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'RO SAFT One Time Supplier'
define view I_RO_SAFTOneTimeSupplier
as select from I_JournalEntryItemOneTimeData as Ots
inner join P_RO_SAFTBSECTaxID as OtsStcd on Ots.CompanyCode = OtsStcd.CompanyCode
and Ots.AccountingDocument = OtsStcd.AccountingDocument
and Ots.FiscalYear = OtsStcd.FiscalYear
and Ots.AccountingDocumentItem = OtsStcd.AccountingDocumentItem
inner join I_OperationalAcctgDocItem as Bseg on Bseg.AccountingDocument = Ots.AccountingDocument
and Bseg.CompanyCode = Ots.CompanyCode
and Bseg.FiscalYear = Ots.FiscalYear
and Bseg.AccountingDocumentItem = Ots.AccountingDocumentItem
left outer to one join I_Country as BsegStcegCountry on BsegStcegCountry.Country = Ots.Country // BsegStcegCountry.CountryISOCode = left( Ots._OperationalAcctgDocItem.VATRegistration, 2 )
// and BsegStcegCountry.CountryISOCode <> ''
{
key Ots.CompanyCode,
key Ots.AccountingDocument,
key Ots.FiscalYear,
key Ots.AccountingDocumentItem,
cast(case
when Ots.IsNaturalPerson = 'X' then
case
when Bseg.VATRegistration = '' then
case when OtsStcd.VATRegistration = '' then
case when Ots.Country = 'RO' then concat('04', ltrim( Bseg.Supplier, '0'))
else concat('11', concat(Ots.Country, ltrim( Bseg.Supplier, '0')))
end
else concat('03', OtsStcd.VATRegistration)
end
else '080000000000000'
end
when Ots.Country = 'RO' then
case when Bseg.VATRegistration = '' then
case when OtsStcd.VATRegistration = '' then '080000000000000'
else concat('00', OtsStcd.VATRegistration)
end
else replace(Bseg.VATRegistration, 'RO', '00')
end
when BsegStcegCountry.IsEuropeanUnionMember = '' then
case when Bseg.VATRegistration = '' then
case when OtsStcd.VATRegistration = '' then concat('06', concat(Ots.Country, ltrim( Bseg.Supplier, '0')))
else case left(OtsStcd.VATRegistration, 2)
when Ots.Country then concat('02', OtsStcd.VATRegistration)
else concat('09', OtsStcd.VATRegistration)
end
end
else case left(Bseg.VATRegistration, 2)
when Ots.Country then concat('02', Bseg.VATRegistration)
else concat('09', Bseg.VATRegistration)
end
end
else case
when Bseg.VATRegistration = '' then
case when OtsStcd.VATRegistration = ''
then concat('05', concat(Ots.Country, ltrim( Bseg.Supplier, '0')))
else case left(OtsStcd.VATRegistration, 2)
when Ots.Country then concat('10', concat(Ots.Country, ltrim( Bseg.Supplier, '0')))
else concat('09', OtsStcd.VATRegistration)
end
end
else concat('01', Bseg.VATRegistration)
end
end as farp_stceg) as VATRegistration,
Bseg.Supplier,
Ots.CityName,
Ots.Country,
Ots.PostalCode,
Ots.StreetAddressName as StreetName,
Ots.Region,
Ots.BusinessPartnerName1
}
where Ots.IsOneTimeAccount = 'X' and Bseg.FinancialAccountType = 'K'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COUNTRY",
"I_JOURNALENTRYITEMONETIMEDATA",
"I_OPERATIONALACCTGDOCITEM",
"P_RO_SAFTBSECTAXID"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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