ACR_PL_SAFT_HELPER_ITEM_TOTAL

DDL: ACR_PL_SAFT_HELPER_ITEM_TOTAL SQL: ACRPLSAFTHLPITOT Type: view

SAF-T PL: Helper class for item totals

ACR_PL_SAFT_HELPER_ITEM_TOTAL is a CDS View that provides data about "SAF-T PL: Helper class for item totals" in SAP S/4HANA. It reads from 2 data sources (I_SAPClient, P_PL_SAFTTaxItemTotal) and exposes 2 fields.

Data Sources (2)

SourceAliasJoin Type
I_SAPClient a from
P_PL_SAFTTaxItemTotal P_PL_SAFTTaxItemTotal left_outer

Parameters (6)

NameTypeDefault
P_CompanyCode bukrs
P_StartDate datum
P_EndDate datum
P_TaxType mwart
P_CompanyCodeCurrency waers
P_Loc_Curr saft_pl_vat_local_currency

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName ACRPLSAFTHLPITOT view
AccessControl.authorizationCheck #NOT_ALLOWED view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.type #INHERITED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #X view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label SAF-T PL: Helper class for item totals view

Fields (2)

KeyFieldSource TableSource FieldDescription
CompanyCodeCurrency
NumberOfLines
@AbapCatalog.sqlViewName: 'ACRPLSAFTHLPITOT'
@AccessControl.authorizationCheck: #NOT_ALLOWED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling: { type: #INHERITED, algorithm: #SESSION_VARIABLE }
@ObjectModel.usageType: { dataClass: #MIXED, sizeCategory: #XXL, serviceQuality: #X }
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true
@EndUserText.label: 'SAF-T PL: Helper class for item totals'
define view ACR_PL_SAFT_HELPER_ITEM_TOTAL
  with parameters
    P_CompanyCode         : bukrs,
    P_StartDate           : datum,
    P_EndDate             : datum,
    P_TaxType             : mwart,
    P_CompanyCodeCurrency : waers,
    P_Loc_Curr            : saft_pl_vat_local_currency
  as select from    I_SAPClient                                               as a
    left outer join P_PL_SAFTTaxItemTotal( P_StartDate: $parameters.P_StartDate,
                                           P_EndDate: $parameters.P_EndDate ) as b on  b.CompanyCode = $parameters.P_CompanyCode
                                                                                   and b.TaxType     = $parameters.P_TaxType

{

  // if no items exist, value '0' must be in the number of lines and total amount


  @Semantics.currencyCode: true
  $parameters.P_CompanyCodeCurrency as CompanyCodeCurrency,

  coalesce(NumberOfLines,0)         as NumberOfLines,

  @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
  case $parameters.P_Loc_Curr
    when 'X' then

     case $parameters.P_TaxType
       when '1' then coalesce(- TotalTaxAmountInCoCodeCrcy,0)
        else coalesce(TotalTaxAmountInCoCodeCrcy,0)
     end
    else
     case $parameters.P_TaxType
        when '1'then coalesce(- TotalTaxAmountInCountryCrcy,0)
        else coalesce(TotalTaxAmountInCountryCrcy,0)
     end
  end                             as TotalTaxAmountInCountryCrcy




//    @Semantics.amount.currencyCode: 'CompanyCodeCurrency'

//    case $parameters.P_TaxType

//     when '1'then coalesce(- TotalTaxAmountInCoCodeCrcy,0)

//     else coalesce(TotalTaxAmountInCoCodeCrcy,0)

//    end                               as TotalTaxAmountInCoCodeCrcy,

//  

//    @Semantics.amount.currencyCode: 'CompanyCodeCurrency'

//    case $parameters.P_TaxType

//     when '1'then coalesce(- TotalTaxAmountInCountryCrcy,0)

//     else coalesce(TotalTaxAmountInCountryCrcy,0)

//    end                               as TotalTaxAmountInCountryCrcy

}