Fdm_Coll_Tax_View

DDL: FDM_COLL_TAX SQL: FDM_COLL_TAX Type: view

Tax to be added to Payments

Fdm_Coll_Tax_View is a CDS View that provides data about "Tax to be added to Payments" in SAP S/4HANA. It reads from 1 data source (bseg).

Data Sources (1)

SourceAliasJoin Type
bseg x inner

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName FDM_COLL_TAX view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.sizeCategory #L view
EndUserText.label Tax to be added to Payments view
@AbapCatalog.sqlViewName: 'FDM_COLL_TAX'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.sizeCategory: #L
@EndUserText.label: 'Tax to be added to Payments'
define view Fdm_Coll_Tax_View
//  with parameters @Environment.systemField: #SYSTEM_DATE

//                  today : syst_datum

  //read the taxes

  as select
    b.mandt,
    b.bukrs                                               as comp_code,
//    t.waers                                               as local_currency,

    b.gjahr                                               as fiscal_year,
    b.belnr                                               as invoice_no,
    b.buzei                                               as doc_item,
    b.kunnr                                               as customer,
    b.h_bldat                                             as inv_date,
    b.h_budat                                             as posting_date,
    b.manst                                               as dunning_level,
    b.madat                                               as dunning_date,
    b.netdt                                               as due_date,
    b.netdt                                               as inv_due_date,
    b.sk1dt                                               as discount_date,
    0                                                     as invoice_amount,
    case x.shkzg when 'S' then x.wrbtr else -x.wrbtr end  as tax_amount,
    case x.shkzg when 'S' then x.dmbtr else -x.dmbtr end  as tax_amount_local_currency,
    0                                                     as paid_amount,
    '     '                                               as payment_currency,
    case b.manst when '0' then 0 else b.wrbtr end         as dunning_amount,
    b.h_waers                                             as currency,
    b.augdt                                               as payment_date,
    b.mansp                                               as fdm_mansp,
    b.umskz                                               as spgl_ind,
    b.rebzj,
    'TAX'                                                 as rebzg,
    b.rebzz
  from bseg as b
//       inner join t001 as t on b.mandt = t.mandt and b.bukrs = t.bukrs

       inner join bseg as x 
       on b.mandt = x.mandt 
       and b.bukrs = x.bukrs 
       and b.gjahr = x.gjahr 
       and b.belnr = x.belnr 
       and ( x.shkzg = 'H' and ( x.mwart = 'V' or x.mwart = 'A' ) or x.ktosl = 'MVA' )
  where
         b.koart = 'D'
//    and  umskz != 'A'

    and  b.h_bstat != 'S'
    and  b.shkzg = 'H'
//read only taxes for credit memos as those must include the tax lines - the invoices have them already included in the debtor line

    and  b.augbl = ''
    and(
         b.rebzg = ''
      or b.rebzg = 'V'
    )   and b.filkd = ''     
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"BSEG"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/