I_ID_StRpVATReturnOutCube

DDL: I_ID_STRPVATRETURNOUTCUBE SQL: IIDVATOUTCUBE Type: view COMPOSITE Package: GLO_FIN_IS_VAT_ID

Indonesia VAT Return Out - Cube

I_ID_StRpVATReturnOutCube is a Composite CDS View (Cube) that provides data about "Indonesia VAT Return Out - Cube" in SAP S/4HANA. It reads from 4 data sources (I_AcctDocCustomer, I_AcctDocCustomer, I_JournalEntry, I_JournalEntry) and exposes 115 fields with key fields CompanyCode, FiscalYear, AccountingDocument, TaxBoxStrucValidityStartDate, UnifiedTaxBoxStructureType. It has 3 associations to related views. Part of development package GLO_FIN_IS_VAT_ID.

Data Sources (4)

SourceAliasJoin Type
I_AcctDocCustomer _AccDocCust inner
I_AcctDocCustomer _AccDocCust inner
I_JournalEntry AccountingDocument from
I_JournalEntry AccountingDocument union_all

Parameters (7)

NameTypeDefault
P_CompanyCode fis_bukrs
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id
P_ReportingCountry land1
P_TaxBoxConfiguration figen_tdt_taxbox_config
P_FiscalYear gjahr

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[0..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] P_StRpCategoryParameter StRpCategoryParam _TaxItem.StatryRptCategory = StRpCategoryParam.ReportingCategory and _TaxItem.StatryRptgEntity = StRpCategoryParam.ReportingEntity and StRpCategoryParam.ReportingCategoryParamName = 'ID_VATOUT_OVERSEASBP'

Annotations (16)

NameValueLevelField
AbapCatalog.sqlViewName IIDVATOUTCUBE view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
Analytics.dataCategory #CUBE view
Analytics.dataExtraction.enabled false view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #CHECK view
Metadata.allowExtensions true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
Analytics.internalName #LOCAL view
EndUserText.label Indonesia VAT Return Out - Cube view

Fields (115)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode Receiver Company Code
KEY FiscalYear I_JournalEntry FiscalYear G/L Fiscal Year
KEY AccountingDocument I_JournalEntry AccountingDocument Journal Entry
KEY TaxBoxStrucValidityStartDate _TaxItem TaxBoxStrucValidityStartDate
KEY UnifiedTaxBoxStructureType _TaxItem UnifiedTaxBoxStructureType
char35asDCoDocumentReference
TaxItem _TaxItem TaxItem Tax Item
TaxCode TaxCode Tax Code
TaxRate
TaxRateValidityStartDate _TaxItem TaxRateValidityStartDate Tax Rate Validity Start Date
TaxBoxStrucValidityEndDate _TaxItem TaxBoxStrucValidityEndDate
AccountingDocumentType I_JournalEntry AccountingDocumentType Journal Entry Type
ReferenceDocumentType I_JournalEntry ReferenceDocumentType Reference Document Type
BusinessPlace I_AcctDocCustomer BusinessPlace Business place
FiscalPeriod I_JournalEntry FiscalPeriod Tax period
DocumentDate I_JournalEntry DocumentDate Journal Entry Date
PostingDate I_JournalEntry PostingDate Posting Date for GR
TransactionCode I_JournalEntry TransactionCode Transaction Code
DocumentReferenceID
AccrualTransactionType
CharcStatus
BillingDocument
AccountingDocumentHeaderText I_JournalEntry AccountingDocumentHeaderText Doc.Header Text
Reference1InDocumentHeader I_JournalEntry Reference1InDocumentHeader Reference 1
Reference2InDocumentHeader I_JournalEntry Reference2InDocumentHeader Reference 2
OriginalReferenceDocument I_JournalEntry OriginalReferenceDocument Reference Key
SupplierendasCustomerSupplierAccount
Customer I_AcctDocCustomer Customer Sold-to Party
Supplier I_AcctDocCustomer Supplier Supplier
VATRegistrationendasVATRegistration
endendasTaxNumber1
TaxNumber2endendasTaxNumber2
TaxNumber3endendasTaxNumber3
BPSupplierNameendendendasCustomerName
Country1endendasAddressLine1
TaxNumber1asbptaxnumendendasBPTaxNumber
BPSupplierNameendendasCustomerFullName
AddressLine2 AddressLine2
VillageNameendendasVillageName
DistrictNameendasDistrictName
BuildingendasBuilding
HouseNumberendasHouseNumber
StreetNameendendasStreetName
CityNameendendasCityName
RegionendendasRegion
PostalCodeendendasPostalCode
PhoneNumber
AddressIDendasAddressID
Country
PersonNumber
JrnlEntryCntrySpecificRef2 I_JournalEntry JrnlEntryCntrySpecificRef2 Country/Region Specific Reference 2
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency Local Currency
TaxableAmountendasTaxableAmount
TaxAmountendasTaxAmount
LuxuryTaxAmtendasLuxuryTaxAmt
DownPaytTaxableAmt
DownPaymentTaxAmount
CompanyCodeasCompanyCode
KEY FiscalYear I_JournalEntry FiscalYear G/L Fiscal Year
KEY AccountingDocument I_JournalEntry AccountingDocument Journal Entry
KEY TaxBoxStrucValidityStartDate _TaxItem TaxBoxStrucValidityStartDate
KEY UnifiedTaxBoxStructureType _TaxItem UnifiedTaxBoxStructureType
char35asDCoDocumentReference
TaxItem _TaxItem TaxItem Tax Item
TaxCode TaxCode Tax Code
TaxRate
TaxRateValidityStartDate _TaxItem TaxRateValidityStartDate Tax Rate Validity Start Date
TaxBoxStrucValidityEndDate _TaxItem TaxBoxStrucValidityEndDate
AccountingDocumentType I_JournalEntry AccountingDocumentType Journal Entry Type
ReferenceDocumentType I_JournalEntry ReferenceDocumentType Reference Document Type
BusinessPlace I_AcctDocCustomer BusinessPlace Business place
FiscalPeriod I_JournalEntry FiscalPeriod Tax period
DocumentDate I_JournalEntry DocumentDate Journal Entry Date
PostingDate I_JournalEntry PostingDate Posting Date for GR
TransactionCode I_JournalEntry TransactionCode Transaction Code
DocumentReferenceID
AccrualTransactionType
CharcStatus
BillingDocument
AccountingDocumentHeaderText I_JournalEntry AccountingDocumentHeaderText Doc.Header Text
Reference1InDocumentHeader I_JournalEntry Reference1InDocumentHeader Reference 1
Reference2InDocumentHeader I_JournalEntry Reference2InDocumentHeader Reference 2
OriginalReferenceDocument I_JournalEntry OriginalReferenceDocument Reference Key
SupplierendasCustomerSupplierAccount
Customer I_AcctDocCustomer Customer Sold-to Party
Supplier I_AcctDocCustomer Supplier Supplier
VATRegistrationendasVATRegistration
endendasTaxNumber1
TaxNumber2endendasTaxNumber2
TaxNumber3endendasTaxNumber3
BPSupplierNameendendendasCustomerName
Country1endendasAddressLine1
TaxNumber1asbptaxnumendendasBPTaxNumber
BPSupplierNameendendasCustomerFullName
AddressLine2 AddressLine2
VillageNameendendasVillageName
DistrictNameendasDistrictName
BuildingendasBuilding
HouseNumberendasHouseNumber
StreetNameendendasStreetName
CityNameendendasCityName
RegionendendasRegion
PostalCodeendendasPostalCode
PhoneNumber
AddressIDendasAddressID
Country
PersonNumber
JrnlEntryCntrySpecificRef2 I_JournalEntry JrnlEntryCntrySpecificRef2 Country/Region Specific Reference 2
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency Local Currency
TaxableAmountendasTaxableAmount
TaxAmountendasTaxAmount
LuxuryTaxAmtendasLuxuryTaxAmt
DownPaytTaxableAmt
DownPaymentTaxAmount
LuxuryTaxDownPaytAmt

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 I_ID_StRpVATReturnOutCube.
-- 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.
-- SQL view name: IIDVATOUTCUBE
-- Parameters: P_CompanyCode : fis_bukrs, P_StatryRptgEntity : srf_reporting_entity, P_StatryRptCategory : srf_rep_cat_id, P_StatryRptRunID : srf_report_run_id, P_ReportingCountry : land1, P_TaxBoxConfiguration : figen_tdt_taxbox_config, P_FiscalYear : gjahr

CREATE VIEW I_ID_StRpVATReturnOutCube AS
SELECT
  AccountingDocument.CompanyCode AS CompanyCode,
  AccountingDocument.FiscalYear AS FiscalYear,
  AccountingDocument.AccountingDocument AS AccountingDocument,
  _TaxItem.TaxBoxStrucValidityStartDate AS TaxBoxStrucValidityStartDate,
  _TaxItem.UnifiedTaxBoxStructureType AS UnifiedTaxBoxStructureType,
  cast(case when AccountingDocument.DocumentReferenceID != '' then AccountingDocument.DocumentReferenceID else AccountingDocument.AccountingDocument end as abap.char(35)) as DCoDocumentReference AS char35asDCoDocumentReference,
  _TaxItem.TaxItem AS TaxItem,
  TaxCode,
  _TaxItem._StRpBPTaxItem.TaxRate AS TaxRate,
  _TaxItem.TaxRateValidityStartDate AS TaxRateValidityStartDate,
  _TaxItem.TaxBoxStrucValidityEndDate AS TaxBoxStrucValidityEndDate,
  AccountingDocument.AccountingDocumentType AS AccountingDocumentType,
  AccountingDocument.ReferenceDocumentType AS ReferenceDocumentType,
  _AccDocCust.BusinessPlace AS BusinessPlace,
  AccountingDocument.FiscalPeriod AS FiscalPeriod,
  AccountingDocument.DocumentDate AS DocumentDate,
  AccountingDocument.PostingDate AS PostingDate,
  AccountingDocument.TransactionCode AS TransactionCode,
  substring(AccountingDocument.DocumentReferenceID, 4, 16) AS DocumentReferenceID,
  substring(AccountingDocument.DocumentReferenceID, 1, 2) AS AccrualTransactionType,
  substring(AccountingDocument.DocumentReferenceID, 3, 1) AS CharcStatus,
  substring(_AccDocCust.BillingDocument, 1, 10) AS BillingDocument,
  AccountingDocument.AccountingDocumentHeaderText AS AccountingDocumentHeaderText,
  AccountingDocument.Reference1InDocumentHeader AS Reference1InDocumentHeader,
  AccountingDocument.Reference2InDocumentHeader AS Reference2InDocumentHeader,
  AccountingDocument.OriginalReferenceDocument AS OriginalReferenceDocument,
  case when _AccDocCust.Customer != '' then _AccDocCust.Customer else _AccDocCust.Supplier end as CustomerSupplierAccount AS SupplierendasCustomerSupplierAccount,
  _AccDocCust.Customer AS Customer,
  _AccDocCust.Supplier AS Supplier,
  case when _AccDocCust.Customer != '' then _Customer.VATRegistration else _Supplier.VATRegistration end as VATRegistration AS VATRegistrationendasVATRegistration,
  case when _TaxItem._OneTimeAccountBP.TaxID1!='' then replace(replace( _TaxItem._OneTimeAccountBP.TaxID1, '.', '' ),'-','') else case when _AccDocCust.Customer != '' then replace(replace(_Customer.TaxNumber1, '.', '' ),'-','') else replace(replace(_Supplier.TaxNumber1, '.', '' ),'-','') end end as TaxNumber1 AS endendasTaxNumber1,
  case when _TaxItem._OneTimeAccountBP.TaxID2!='' then _TaxItem._OneTimeAccountBP.TaxID2 else case when _AccDocCust.Customer != '' then _Customer.TaxNumber2 else _Supplier.TaxNumber2 end end as TaxNumber2 AS TaxNumber2endendasTaxNumber2,
  case when _TaxItem._OneTimeAccountBP.TaxID3!='' then _TaxItem._OneTimeAccountBP.TaxID3 else case when _AccDocCust.Customer != '' then _Customer.TaxNumber3 else _Supplier.TaxNumber3 end end as TaxNumber3 AS TaxNumber3endendasTaxNumber3,
  case when BusinessPartnerName!= '' then replace( BusinessPartnerName,',','') else case when _AccDocCust.Customer != '' then case when _Customer._CustomerToBusinessPartner._BusinessPartner.PersonNumber != '' then case when _Customer.TaxNumber3 != '' then concat(concat(replace(_Customer.BPCustomerName, ',', ''), '#NIK/Passport#'), _Customer.TaxNumber3) else case when _Customer.TaxNumber2 != '' then concat(concat(replace(_Customer.BPCustomerName, ',', ''), '#NIK/Passport#'), _Customer.TaxNumber2) else replace(_Customer.BPCustomerName, ',', '') end end else replace(_Customer.BPCustomerName, ',', '') end else case when _Supplier._SupplierToBusinessPartner._BusinessPartner.PersonNumber != '' then case when _Supplier.TaxNumber3 != '' then concat(concat(replace(_Supplier.BPSupplierName, ',', ''), '#NIK/Passport#'), _Supplier.TaxNumber3) else case when _Supplier.TaxNumber2 != '' then concat(concat(replace(_Supplier.BPSupplierName, ',', ''), '#NIK/Passport#'), _Supplier.TaxNumber2) else replace(_Supplier.BPSupplierName, ',', '') end end else replace(_Supplier.BPSupplierName, ',', '') end end end as CustomerName AS BPSupplierNameendendendasCustomerName,
  case when AddressLine2!='' then AddressLine2 else case when _AccDocCust.Customer != '' then concat_with_space(concat_with_space(concat_with_space(concat_with_space(concat_with_space(concat( concat(_Customer._AddressDefaultRepresentation.StreetPrefixName1, ','), _Customer._AddressDefaultRepresentation.StreetPrefixName2), concat_with_space(_Customer._AddressDefaultRepresentation.StreetName, _Customer._AddressDefaultRepresentation.HouseNumber, 1), 1), concat(concat(_Customer._AddressDefaultRepresentation.StreetSuffixName1, ','), _Customer._AddressDefaultRepresentation.StreetSuffixName2), 1), concat(concat(_Customer._AddressDefaultRepresentation.VillageName, ','), _Customer._AddressDefaultRepresentation.DistrictName), 1), concat(concat(_Customer._AddressDefaultRepresentation.CityName, ','), _Customer._AddressDefaultRepresentation.PostalCode), 1), _Customer._AddressDefaultRepresentation.Country, 1) else concat_with_space(concat_with_space(concat_with_space(concat_with_space(concat_with_space(concat( concat(_Supplier._AddressDefaultRepresentation.StreetPrefixName1, ','), _Supplier._AddressDefaultRepresentation.StreetPrefixName2), concat_with_space(_Supplier._AddressDefaultRepresentation.StreetName, _Supplier._AddressDefaultRepresentation.HouseNumber, 1), 1), concat(concat(_Supplier._AddressDefaultRepresentation.StreetSuffixName1, ','), _Supplier._AddressDefaultRepresentation.StreetSuffixName2), 1), concat(concat(_Supplier._AddressDefaultRepresentation.VillageName, ','), _Supplier._AddressDefaultRepresentation.DistrictName), 1), concat(concat(_Supplier._AddressDefaultRepresentation.CityName, ','), _Supplier._AddressDefaultRepresentation.PostalCode), 1), _Supplier._AddressDefaultRepresentation.Country, 1) end end as AddressLine1 AS Country1endendasAddressLine1,
  case when _TaxItem._OneTimeAccountBP.TaxID1 != '' then _TaxItem._OneTimeAccountBP.TaxID1 else case when _AccDocCust.Customer != '' then cast(_Customer.TaxNumber1 as bptaxnum) else cast(_Supplier.TaxNumber1 as bptaxnum) end end as BPTaxNumber AS TaxNumber1asbptaxnumendendasBPTaxNumber,
  case when BusinessPartnerName!= '' then BusinessPartnerName else case when _AccDocCust.Customer != '' then _Customer.BPCustomerName else _Supplier.BPSupplierName end end as CustomerFullName AS BPSupplierNameendendasCustomerFullName,
  AddressLine2,
  case when _TaxItem._OneTimeAccountBP.CityName != '' then _TaxItem._OneTimeAccountBP.CityName else case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.VillageName else _Supplier._AddressDefaultRepresentation.VillageName end end as VillageName AS VillageNameendendasVillageName,
  case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.DistrictName else _Supplier._AddressDefaultRepresentation.DistrictName end as DistrictName AS DistrictNameendasDistrictName,
  case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.Building else _Supplier._AddressDefaultRepresentation.Building end as Building AS BuildingendasBuilding,
  case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.HouseNumber else _Supplier._AddressDefaultRepresentation.HouseNumber end as HouseNumber AS HouseNumberendasHouseNumber,
  case when _TaxItem._OneTimeAccountBP.StreetAddressName != '' then _TaxItem._OneTimeAccountBP.StreetAddressName else case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.StreetName else _Supplier._AddressDefaultRepresentation.StreetName end end as StreetName AS StreetNameendendasStreetName,
  case when _TaxItem._OneTimeAccountBP.CityName != '' then _TaxItem._OneTimeAccountBP.CityName else case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.CityName else _Supplier._AddressDefaultRepresentation.CityName end end as CityName AS CityNameendendasCityName,
  case when _TaxItem._OneTimeAccountBP.Region != '' then _TaxItem._OneTimeAccountBP.Region else case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.Region else _Supplier._AddressDefaultRepresentation.Region end end as Region AS RegionendendasRegion,
  case when _TaxItem._OneTimeAccountBP.PostalCode != '' then _TaxItem._OneTimeAccountBP.PostalCode else case when _AccDocCust.Customer != '' then _Customer._AddressDefaultRepresentation.PostalCode else _Supplier._AddressDefaultRepresentation.PostalCode end end as PostalCode AS PostalCodeendendasPostalCode,
  _TaxItem._OneTimeAccountBP._CompanyCode._OrgAddressDefaultRprstn._PhoneNumber.PhoneAreaCodeSubscriberNumber AS PhoneNumber,
  case when _AccDocCust.Customer != '' then _Customer.AddressID else _Supplier.AddressID end as AddressID AS AddressIDendasAddressID,
  coalesce(_Customer.Country, _Supplier.Country) AS Country,
  coalesce(_Customer._CustomerToBusinessPartner._BusinessPartner.PersonNumber, _Supplier._SupplierToBusinessPartner._BusinessPartner.PersonNumber) AS PersonNumber,
  AccountingDocument.JrnlEntryCntrySpecificRef2 AS JrnlEntryCntrySpecificRef2,
  AccountingDocument.CompanyCodeCurrency AS CompanyCodeCurrency,
  case when _AccDocCust.IsNegativePosting = 'X' then _TaxItem.TaxableAmount else -(_TaxItem.TaxableAmount) end as TaxableAmount AS TaxableAmountendasTaxableAmount,
  case when _AccDocCust.IsNegativePosting = 'X' then _TaxItem.TaxAmount else -(_TaxItem.TaxAmount) end as TaxAmount AS TaxAmountendasTaxAmount,
  case when _AccDocCust.IsNegativePosting = 'X' then _TaxItem.LuxuryTaxAmt else -(_TaxItem.LuxuryTaxAmt) end as LuxuryTaxAmt AS LuxuryTaxAmtendasLuxuryTaxAmt,
  abs(_TaxItem.DownPaytTaxableAmt) AS DownPaytTaxableAmt,
  abs(_TaxItem.DownPaymentTaxAmount) AS DownPaymentTaxAmount,
  abs(_TaxItem.LuxuryTaxDownPaytAmt) AS LuxuryTaxDownPaytAmt
FROM I_JournalEntry AS AccountingDocument
INNER JOIN I_AcctDocCustomer AS _AccDocCust ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [0..1]
LEFT OUTER JOIN P_StRpCategoryParameter AS StRpCategoryParam ON _TaxItem.StatryRptCategory = StRpCategoryParam.ReportingCategory AND _TaxItem.StatryRptgEntity = StRpCategoryParam.ReportingEntity AND StRpCategoryParam.ReportingCategoryParamName = 'ID_VATOUT_OVERSEASBP'  -- association [0..1]
-- UNION ALL with additional select branch(es): I_JournalEntry
;