FISTRPGSTR1ITEM

DDL: FISTRPGSTR1ITEM SQL: FISRGSTR1ITM Type: view

FISTRPGSTR1ITEM is a CDS View in SAP S/4HANA. It reads from 19 data sources and exposes 110 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, TaxCode.

Data Sources (19)

SourceAliasJoin Type
adrc _Address left_outer
vbrp _BillingDocumentItem left_outer
bseg _bseg left_outer
I_BusinessPartnerCustomer _BUSINESSPARTNERCUSTOMER left_outer
bseg _cbseg left_outer
j_1iexcdefn _CodeName left_outer
I_BusPartAddrDepdntTaxNmbr _DFKKBPTAXNUM_ADR left_outer
I_JournalEntry _Inv left_outer
I_JournalEntry _JE inner
knvi _knvi left_outer
I_CustSlsAreaAddrDepdntTaxInfo _knvi_addr left_outer
bseg _mbseg left_outer
vbpa _partnerFunction left_outer
j_1istatecdm _StateCode left_outer
edointxcodemap _taxcodemap left_outer
edoinuqc _UoM left_outer
FIACCDOCINGST FIACCDOCINGST left_outer
I_BillingDocument I_BillingDocument left_outer
t604n t604n left_outer

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName FISRGSTR1ITM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.preserveKey true view

Fields (110)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_StRpTaxItem CompanyCode
KEY AccountingDocument I_StRpTaxItem AccountingDocument
KEY FiscalYear I_StRpTaxItem FiscalYear
KEY TaxItem TaxItem
KEY TaxCode TaxCode
KEY TransactionTypeDetermination TransactionTypeDetermination
TaxCalculationProcedure TaxCalculationProcedure
TaxRate I_StRpTaxItem TaxRate
GLAccount GLAccount
TaxItemGroup TaxItemGroup
BusinessPlace I_StRpTaxItem BusinessPlace
TaxJurisdiction TaxJurisdiction
LowestLevelTaxJurisdiction LowestLevelTaxJurisdiction
AccountingDocumentType I_StRpTaxItem AccountingDocumentType
ReferenceDocumentType I_StRpTaxItem ReferenceDocumentType
ReverseDocument I_StRpTaxItem ReverseDocument
ReverseDocumentFiscalYear I_StRpTaxItem ReverseDocumentFiscalYear
EUTaxClassification I_StRpTaxItem EUTaxClassification
Ledger I_StRpTaxItem Ledger
LedgerGroup I_StRpTaxItem LedgerGroup
PostingDate I_StRpTaxItem PostingDate
DocumentDate I_StRpTaxItem DocumentDate
TaxReportingDate I_StRpTaxItem TaxReportingDate
ReportingDate ReportingDate
FiscalPeriod I_StRpTaxItem FiscalPeriod
ExchangeRate I_StRpTaxItem ExchangeRate
IsReversal I_StRpTaxItem IsReversal
IsReversed I_StRpTaxItem IsReversed
DocumentReferenceID I_JournalEntry DocumentReferenceID
AlternativeReferenceDocument I_JournalEntry AlternativeReferenceDocument
AccountingDocumentHeaderText I_StRpTaxItem AccountingDocumentHeaderText
CompanyCodeCountry CompanyCodeCountry
ReportingCountry ReportingCountry
TaxReturnCountry TaxReturnCountry
CompanyCodeCurrency I_StRpTaxItem CompanyCodeCurrency
CountryCurrency CountryCurrency
DocumentCurrency DocumentCurrency
ReportingCurrency ReportingCurrency
AdditionalCurrency1 I_StRpTaxItem AdditionalCurrency1
AdditionalCurrency2 I_StRpTaxItem AdditionalCurrency2
TaxBaseAmountInRptgCrcy TaxBaseAmountInRptgCrcy
TaxAmountInRptgCrcy TaxAmountInRptgCrcy
TaxAmountInCoCodeCrcy TaxAmountInCoCodeCrcy
TaxBaseAmountInCoCodeCrcy TaxBaseAmountInCoCodeCrcy
TaxAmount TaxAmount
TaxBaseAmountInCountryCrcy TaxBaseAmountInCountryCrcy
TaxAmountInCountryCrcy TaxAmountInCountryCrcy
TaxBaseAmountInTransCrcy TaxBaseAmountInTransCrcy
TaxBaseAmtInAdditionalCrcy1 TaxBaseAmtInAdditionalCrcy1
TaxBaseAmtInAdditionalCrcy2 TaxBaseAmtInAdditionalCrcy2
TaxAmountInAdditionalCurrency1 TaxAmountInAdditionalCurrency1
TaxAmountInAdditionalCurrency2 TaxAmountInAdditionalCurrency2
Customer
Customer I_StRpTaxItem Customer
TaxType TaxType
TargetTaxCode TargetTaxCode
TaxNumber1 TaxNumber1
TaxNumber2 TaxNumber2
TaxNumber3endasTaxNumber3
BusinessPartner
BusinessPartner I_StRpTaxItem BusinessPartner
BusinessPartnerName BusinessPartnerName
CustomerSupplierAddress CustomerSupplierAddress
SupplierAccountGroup SupplierAccountGroup
ConditionType ConditionType
TaxIsNotDeductible TaxIsNotDeductible
umsks bseg umsks
shkzg bseg shkzg
rebzg bseg rebzg
rebzj bseg rebzj
rebzz bseg rebzz
rebzt bseg rebzt
invxblnr I_JournalEntry DocumentReferenceID
bldat I_JournalEntry DocumentDate
vatdate I_JournalEntry TaxReportingDate
invdmbtr bseg dmbtr
land1 I_BusinessPartnerCustomer Country
land vbpa land1
SDDocumentCategory I_BillingDocument SDDocumentCategory
TaxCountry I_StRpTaxItem TaxCountry
niltype niltype
rvchrg rvchrg
import import
OriginalReferenceDocument I_JournalEntry OriginalReferenceDocument
cond_name j_1iexcdefn cond_name
hsn_sac bseg hsn_sac
matnr bseg matnr
menge bseg menge
meins bseg meins
werks bseg werks
hkont bseg hkont
text1 t604n text1
edoc_in_uqc edoc_in_uqc
condname FIACCDOCINGST condname
kbetr FIACCDOCINGST kbetr
taxkd knvi taxkd
CustomerTaxClassification I_CustSlsAreaAddrDepdntTaxInfo CustomerTaxClassification
TaxNumber3thenUelseRendasRegisteredInd
BPTaxNumber I_BusPartAddrDepdntTaxNmbr BPTaxNumber
_AccountingDocument I_StRpTaxItem _AccountingDocument
_DebtorCreditorRblsPyblsItem _DebtorCreditorRblsPyblsItem
_GLAccount _GLAccount
_ReceivablesPayablesItem _ReceivablesPayablesItem
_ReportedItemsLog _ReportedItemsLog
_ReportingCurrency _ReportingCurrency
_TaxCodeText _TaxCodeText
_TaxJurisdiction _TaxJurisdiction
_TaxReceivablesPayablesItem _TaxReceivablesPayablesItem
_TaxTypeText _TaxTypeText
prsfd vbrp prsfd
@AbapCatalog.sqlViewName: 'FISRGSTR1ITM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass:  #MIXED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
define view FISTRPGSTR1ITEM
  as select distinct from I_StRpTaxItem

    inner join            I_JournalEntry                 as _JE                      on  _JE.CompanyCode        = I_StRpTaxItem.CompanyCode
                                                                                     and _JE.AccountingDocument = I_StRpTaxItem.AccountingDocument
                                                                                     and _JE.FiscalYear         = I_StRpTaxItem.FiscalYear

  //Changed for FOC case

    left outer join       bseg                           as _bseg                    on  I_StRpTaxItem.CompanyCode        = _bseg.bukrs
                                                                                     and I_StRpTaxItem.AccountingDocument = _bseg.belnr
                                                                                     and I_StRpTaxItem.FiscalYear         = _bseg.gjahr
                                                                                     and _bseg.koart                      = 'D'

    left outer join       j_1iexcdefn                    as _CodeName                on  I_StRpTaxItem.TaxCalculationProcedure = _CodeName.kalsm
                                                                                     and I_StRpTaxItem.ConditionType           = _CodeName.kschl

  -- Start of change for FOC (Commented)
  //left outer join       kna1           as _kna1            on _bseg.kunnr = _kna1.kunnr


  //left outer join       knvi           as _knvi            on  _knvi.kunnr = _bseg.kunnr

  //                                                       and _knvi.aland = 'IN'

  //                                                     and _knvi.tatyp = I_StRpTaxItem.ConditionType


  //left outer join       j_1istatecdm   as _StateCode       on  _StateCode.land1          = 'IN'

  //                                                     and _StateCode.std_state_code = _bseg.plc_sup

  --end of change for FOC (commented)

    left outer join       I_BillingDocument                                          on  I_BillingDocument.BillingDocument   = _JE.OriginalReferenceDocument
                                                                                     and I_StRpTaxItem.ReferenceDocumentType = 'VBRK'

    left outer join       vbpa                           as _partnerFunction         on  _partnerFunction.vbeln = I_BillingDocument.BillingDocument
                                                                                     and _partnerFunction.parvw = 'RE'

  -- Start of change for FOC ( New lines added)
  //    left outer join       kna1           as _kna1                on _bseg.kunnr                = _kna1.kunnr

  //                                                                 or (

  //                                                                    (

  //                                                                      _bseg.gst_part           is initial

  //                                                                      or _bseg.gst_part        is null

  //                                                                    )

  //                                                                    and _partnerFunction.kunnr = _kna1.kunnr

  //                                                                  )

    left outer join       knvi                           as _knvi                    on
 -- Start of change for gst_part issue
                                                                                         (
                                                                                           //         _knvi.kunnr     = _bseg.kunnr

                                                                                           //         or

                                                                                           _knvi.kunnr                  = _bseg.gst_part
                                                                                           or
-- End of change for gst_part issue
                                                                                           (
                                                                                             (
                                                                                               _bseg.gst_part           is initial
                                                                                               or _bseg.gst_part        is null
                                                                                             )
                                                                                             and _partnerFunction.kunnr = _knvi.kunnr
                                                                                           )
                                                                                         )
                                                                                     and _knvi.aland                    = 'IN'
                                                                                     and _knvi.tatyp                    = I_StRpTaxItem.ConditionType
    left outer join       vbrp                           as _BillingDocumentItem     on  I_BillingDocument.BillingDocument = _BillingDocumentItem.vbeln
                                                                                     and _BillingDocumentItem.prsfd        = 'B'

    left outer join       I_BusinessPartnerCustomer      as _BUSINESSPARTNERCUSTOMER on
    -- Start of change for gst_part issue
    // _bseg.kunnr = _BUSINESSPARTNERCUSTOMER.Customer

                                                                     (
                                                                       _bseg.gst_part               = _BUSINESSPARTNERCUSTOMER.Customer
      -- End of change for gst_part issue
                                                                     or(
                                                                        (
                                                                           _bseg.gst_part           is initial
                                                                            or _bseg.gst_part        is null
                                                                        )
                                                                            and _partnerFunction.kunnr = _BUSINESSPARTNERCUSTOMER.Customer
                                                                       )
                                                                      )
    left outer join       adrc                           as _Address                 on _BUSINESSPARTNERCUSTOMER.AddressID = _Address.addrnumber
                                                                                     and(
                                                                                       _bseg.plc_sup                       is initial
                                                                                       or _bseg.plc_sup                    is null
                                                                                     )

    left outer join       j_1istatecdm                   as _StateCode               on _StateCode.land1               = 'IN'
                                                                                     and(
                                                                                       _StateCode.std_state_code       = _bseg.plc_sup
                                                                                       or(
                                                                                         (
                                                                                           _bseg.plc_sup               is initial
                                                                                           or _bseg.plc_sup            is null
                                                                                         )
                                                                                         and _StateCode.std_state_code = _Address.region
                                                                                       )
                                                                                     )
  --end of change for FOC
  ---Multiple Address---
    left outer join       I_BusPartAddrDepdntTaxNmbr     as _DFKKBPTAXNUM_ADR        on  _BUSINESSPARTNERCUSTOMER.BusinessPartner = _DFKKBPTAXNUM_ADR.BusinessPartner
                                                                                     and _bseg.glo_ref1                           = _DFKKBPTAXNUM_ADR.BusinessPartnerAddressID
    left outer join       I_CustSlsAreaAddrDepdntTaxInfo as _knvi_addr               on  (
  --Start of change for gst_part issue  
                                                                                        // _knvi_addr.Customer           = _bseg.kunnr

                                                                                          _knvi_addr.Customer           = _bseg.gst_part
  -- End of change for gst_part issue                      
                                                                                         or(
                                                                                           (
                                                                                             _bseg.gst_part            is initial
                                                                                             or _bseg.gst_part         is null
                                                                                           )
                                                                                           and _partnerFunction.kunnr  = _knvi_addr.Customer
                                                                                         )
                                                                                       )
                                                                                     and _bseg.glo_ref1                 = _knvi_addr.AddressID
                                                                                     and _knvi_addr.DepartureCountry    = 'IN'
                                                                                     and _knvi_addr.CustomerTaxCategory = I_StRpTaxItem.ConditionType
  ---Multiple Address---
    left outer join       edointxcodemap                 as _taxcodemap              on  _taxcodemap.kalsm = I_StRpTaxItem.TaxCalculationProcedure
                                                                                     and _taxcodemap.mwskz = I_StRpTaxItem.TaxCode

    left outer join       I_JournalEntry                 as _Inv                     on  _Inv.CompanyCode        = _bseg.bukrs
                                                                                     and _Inv.AccountingDocument = _bseg.rebzg
                                                                                     and _Inv.FiscalYear         = _bseg.rebzj

    left outer join       bseg                           as _cbseg                   on  _cbseg.bukrs = _bseg.bukrs
                                                                                     and _cbseg.belnr = _bseg.rebzg
                                                                                     and _cbseg.gjahr = _bseg.rebzj
                                                                                     and _cbseg.koart = 'D'

    left outer join       bseg                           as _mbseg                   on  I_StRpTaxItem.CompanyCode        = _mbseg.bukrs
                                                                                     and I_StRpTaxItem.AccountingDocument = _mbseg.belnr
                                                                                     and I_StRpTaxItem.FiscalYear         = _mbseg.gjahr
                                                                                     and I_StRpTaxItem.TaxCode            = _mbseg.mwskz
                                                                                     and I_StRpTaxItem.TaxItemGroup       = _mbseg.txgrp
                                                                                     and _mbseg.mwart                     = ''
                                                                                     and _mbseg.koart                     = 'S'
                                                                                     and _mbseg.buzid                     = ''

    left outer join       edoinuqc                       as _UoM                     on msehi = _mbseg.meins

    left outer join       t604n                          as t604n                    on  t604n.spras = 'E'
                                                                                     and t604n.land1 = 'IN'
                                                                                     and t604n.steuc = _mbseg.hsn_sac

    left outer join       FIACCDOCINGST                  as FIACCDOCINGST            on  I_StRpTaxItem.CompanyCode        = FIACCDOCINGST.CompanyCode
                                                                                     and I_StRpTaxItem.AccountingDocument = FIACCDOCINGST.AccountingDocument
                                                                                     and I_StRpTaxItem.FiscalYear         = FIACCDOCINGST.FiscalYear
                                                                                     and I_StRpTaxItem.BusinessPlace      = FIACCDOCINGST.BusinessPlace

{

      //P_StRpTaxReturn

  key I_StRpTaxItem.CompanyCode,
  key I_StRpTaxItem.AccountingDocument,
  key I_StRpTaxItem.FiscalYear,
  key TaxItem,
  key TaxCode,
  key TransactionTypeDetermination,
      //  DebitCreditCode,

      TaxCalculationProcedure,
      I_StRpTaxItem.TaxRate,
      GLAccount,
      TaxItemGroup,
      I_StRpTaxItem.BusinessPlace,
      TaxJurisdiction,
      LowestLevelTaxJurisdiction,
      I_StRpTaxItem.AccountingDocumentType,
      I_StRpTaxItem.ReferenceDocumentType,
      I_StRpTaxItem.ReverseDocument,
      I_StRpTaxItem.ReverseDocumentFiscalYear,
      I_StRpTaxItem.EUTaxClassification,
      I_StRpTaxItem.Ledger,
      I_StRpTaxItem.LedgerGroup,
      I_StRpTaxItem.PostingDate,
      I_StRpTaxItem.DocumentDate,
      I_StRpTaxItem.TaxReportingDate,
      ReportingDate,
      I_StRpTaxItem.FiscalPeriod,
      I_StRpTaxItem.ExchangeRate,
      I_StRpTaxItem.IsReversal,
      I_StRpTaxItem.IsReversed,
      _JE.DocumentReferenceID,
      _JE.AlternativeReferenceDocument,
      I_StRpTaxItem.AccountingDocumentHeaderText,
      CompanyCodeCountry,
      ReportingCountry,
      TaxReturnCountry,
      I_StRpTaxItem.CompanyCodeCurrency,
      CountryCurrency,
      DocumentCurrency,
      ReportingCurrency,
      I_StRpTaxItem.AdditionalCurrency1,
      I_StRpTaxItem.AdditionalCurrency2,
      TaxBaseAmountInRptgCrcy,
      TaxAmountInRptgCrcy,
      TaxAmountInCoCodeCrcy,
      TaxBaseAmountInCoCodeCrcy,
      TaxAmount,
      TaxBaseAmountInCountryCrcy,
      TaxAmountInCountryCrcy,
      TaxBaseAmountInTransCrcy,
      TaxBaseAmtInAdditionalCrcy1,
      TaxBaseAmtInAdditionalCrcy2,
      TaxAmountInAdditionalCurrency1,
      TaxAmountInAdditionalCurrency2,
      --Customer,
      I_StRpTaxItem.Customer,
      TaxType,
      TargetTaxCode,
      TaxNumber1,
      TaxNumber2,
   //   case when ( TaxNumber3 is initial and _BillingDocumentItem.prsfd = 'B' ) then _CustomerToBusinessPartner._Customer.TaxNumber3  else  //FOC

     // TaxNumber3 end                   as TaxNumber3, //FOC

//  gst_part changes

      case when ( _CustomerToBusinessPartner._Customer.TaxNumber3 is initial ) then TaxNumber3
           else _CustomerToBusinessPartner._Customer.TaxNumber3 end as TaxNumber3,
      -- BusinessPartner,
      I_StRpTaxItem.BusinessPartner,
      BusinessPartnerName,
      CustomerSupplierAddress,
      SupplierAccountGroup,
      ConditionType,
      TaxIsNotDeductible,

      _bseg.umsks,
      _bseg.shkzg,
      _bseg.rebzg,
      _bseg.rebzj,
      _bseg.rebzz,
      _bseg.rebzt,
      _Inv.DocumentReferenceID         as invxblnr,
      _Inv.DocumentDate                as bldat,
      _Inv.TaxReportingDate            as vatdate,
      _cbseg.dmbtr                     as invdmbtr,
      _BUSINESSPARTNERCUSTOMER.Country as land1,
      // _kna1.land1,

      _partnerFunction.land1           as land,
      I_BillingDocument.SDDocumentCategory,
      I_StRpTaxItem.TaxCountry as TaxCountry,
      niltype,
      rvchrg,
      import,
      _JE.OriginalReferenceDocument,

      _CodeName.cond_name,
      _mbseg.hsn_sac,
      _mbseg.matnr,
      _mbseg.menge,
      _mbseg.meins,
      _mbseg.werks,
      _mbseg.hkont,
      t604n.text1,
      edoc_in_uqc,

      FIACCDOCINGST.condname,
      FIACCDOCINGST.kbetr,
      // Start of change for FOC ------

      case when _BillingDocumentItem.prsfd = 'B' and ( _bseg.kunnr is initial or _bseg.kunnr is null )
           then  ( TaxBaseAmountInCoCodeCrcy +  TaxAmountInCoCodeCrcy )
           else _bseg.dmbtr end        as dmbtr,

      case when ( _bseg.plc_sup is initial  or _bseg.plc_sup is null )
           then _Address.region
      else _bseg.plc_sup
      end                              as plc_sup,

      case when _BillingDocumentItem.prsfd = 'B' and ( _bseg.kunnr is initial or _bseg.kunnr is null )
      then _partnerFunction.kunnr
      else _bseg.gst_part end          as gst_part,

      //_bseg.dmbtr,

      // _bseg.plc_sup,

      // _bseg.gst_part,

      -- end of change for FOC------

      _StateCode.legal_state_code,
      _knvi.taxkd,
      _knvi_addr.CustomerTaxClassification, //Adoption for Multiple address in BP

      //      case

      //       when (_kna1.stcd3 is null or _kna1.stcd3 = '' ) then 'U'

      //       else 'R'

      //      end                      as RegisteredInd,

      case
      when ( _CustomerToBusinessPartner._Customer.TaxNumber3  is null or _CustomerToBusinessPartner._Customer.TaxNumber3 = '' )
      then 'U'
      else 'R'
      end                              as RegisteredInd,

      _DFKKBPTAXNUM_ADR.BPTaxNumber,
      /* Associations */
      //P_StRpTaxReturn

      I_StRpTaxItem._AccountingDocument,
      _DebtorCreditorRblsPyblsItem,
      _GLAccount,
      _ReceivablesPayablesItem,
      _ReportedItemsLog,
      _ReportingCurrency,
      _TaxCodeText,
      _TaxJurisdiction,
      _TaxReceivablesPayablesItem,
      _TaxTypeText,
      _BillingDocumentItem.prsfd //FOC case

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"FIACCDOCINGST",
"I_BILLINGDOCUMENT",
"I_BUSINESSPARTNERCUSTOMER",
"I_BUSPARTADDRDEPDNTTAXNMBR",
"I_CUSTOMER",
"I_CUSTOMER_TO_BUSINESSPARTNER",
"I_CUSTSLSAREAADDRDEPDNTTAXINFO",
"I_JOURNALENTRY",
"I_STRPTAXITEM",
"ADRC",
"BSEG",
"EDOINTXCODEMAP",
"EDOINUQC",
"J_1IEXCDEFN",
"J_1ISTATECDM",
"KNVI",
"T604N",
"VBPA",
"VBRP"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT",
"I_CURRENCY",
"I_GLACCOUNT",
"I_OPERATIONALACCTGDOCITEM",
"I_STRPJOURNALENTRYLOG",
"I_TAXCODETEXT",
"I_TAXJURISDICTION",
"I_TAXTYPETEXT"
],
"BASE":
[
"I_STRPTAXITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/