@EndUserText.label: 'Excise Duelist from Billing Document'
@ObjectModel.representativeKey: 'BillingDocument'
@AbapCatalog.sqlViewName: 'CSDEXDUEDOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions:true
@ObjectModel.usageType.serviceQuality:#D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@Analytics:{
dataCategory:#DIMENSION , dataExtraction.enabled:true }
define view C_ExciseDueDocument
as select distinct from I_ExciseDueDocHdr
left outer join P_ExciseDutyDefnMerge on I_ExciseDueDocHdr.BillingDocument = P_ExciseDutyDefnMerge.BillingDocument
association [1..*] to C_ExciseDueDocItem as _ExciseDueItem on $projection.BillingDocument = _ExciseDueItem.BillingDocument
association [0..1] to I_Currency as _TransactionCurrency on $projection.TransactionCurrency = _TransactionCurrency.Currency
association [1..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
association [1..1] to I_CompanyCodeStdVH as _CompanyCodeStdVH on $projection.CompanyCode = _CompanyCodeStdVH.CompanyCode
association [0..1] to I_DistributionChannel as _DistributionChannel on $projection.DistributionChannel = _DistributionChannel.DistributionChannel
association [0..1] to I_Division as _Division on $projection.Division = _Division.Division
association [0..1] to I_SalesOrganization as _SalesOrganization on $projection.SalesOrganization = _SalesOrganization.SalesOrganization
/*association [0..1] to I_ExciseSeriesGrpDetrmn as _ExciseSeriesGrpDtmn on $projection.SalesOrganization = _ExciseSeriesGrpDtmn.SalesOrganization
and $projection.DistributionChannel = _ExciseSeriesGrpDtmn.DistributionChannel
and $projection.Division = _ExciseSeriesGrpDtmn.Division
and $projection.ShippingPoint = _ExciseSeriesGrpDtmn.ShippingPoint*/
{
key I_ExciseDueDocHdr.BillingDocument,
I_ExciseDueDocHdr.BillingDocumentItem,
@ObjectModel.foreignKey.association: '_SalesOrganization'
I_ExciseDueDocHdr.SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
I_ExciseDueDocHdr.DistributionChannel,
@ObjectModel.foreignKey.association: '_Division'
I_ExciseDueDocHdr.Division,
I_ExciseDueDocHdr.BillingDocumentCategory,
I_ExciseDueDocHdr.SoldToParty,
//I_ExciseDueDocHdr.BaseUnit,
I_ExciseDueDocHdr.BillingDocumentDate,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
I_ExciseDueDocHdr.TransactionCurrency,
I_ExciseDueDocHdr.ExciseDocStatus,
I_ExciseDueDocHdr.ShippingPoint,
I_ExciseDueDocHdr.CompanyCode,
I_ExciseDueDocHdr.Plant,
I_ExciseDueDocHdr.PlantName,
I_ExciseDueDocHdr.PricingDocument,
I_ExciseDueDocHdr.TaxCalculationProcedure,
I_ExciseDueDocHdr.SDPricingProcedure,
@Semantics.currencyCode: true
I_ExciseDueDocHdr.Currency,
//I_ExciseDueDocHdr.DeliveryDocument,
//substring( cast( tstmp_current_utctimestamp() as abap.char(17) ), 1, 8 ) as PostingDate,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.AEDAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.AEDAmount
end as AEDAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.BEDAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.BEDAmount
end as BEDAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.SEDAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.SEDAmount
end as SEDAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.NCCDAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.NCCDAmount
end as NCCDAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.CESSAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.CESSAmount
end as CESSAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.ECSAmount,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.ECSAmount
end as ECSAmount,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.AdditionalTax1Value,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.AdditionalTax1Value
end as AdditionalTax1Value,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.AdditionalTax2Value,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.AdditionalTax2Value
end as AdditionalTax2Value,
@Semantics.amount.currencyCode: 'Currency'
case
when TransactionCurrency != Currency then
currency_conversion( amount => P_ExciseDutyDefnMerge.AdditionalTax3Value,
source_currency => I_ExciseDueDocHdr.TransactionCurrency,
target_currency => I_ExciseDueDocHdr.Currency,
exchange_rate_date => I_ExciseDueDocHdr.PricingDate)
else
P_ExciseDutyDefnMerge.AdditionalTax3Value
end as AdditionalTax3Value,
/* Associations */
I_ExciseDueDocHdr._BillingDocumentCategory,
I_ExciseDueDocHdr._Item,
_ExciseDueItem,
_CompanyCode,
_CompanyCodeStdVH,
_Division,
_DistributionChannel,
_TransactionCurrency,
_SalesOrganization,
_ExciseSeriesGrpDtmn,
_Partner
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EXCISEDUEDOCHDR",
"P_EXCISEDUTYDEFNMERGE"
],
"ASSOCIATED":
[
"C_EXCISEDUEDOCITEM",
"I_BILLINGDOCUMENTCATEGORY",
"I_BILLINGDOCUMENTITEM",
"I_COMPANYCODE",
"I_COMPANYCODESTDVH",
"I_CURRENCY",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_EXCISESERIESGRPDETRMN",
"I_SALESORGANIZATION",
"I_SDDOCUMENTCOMPLETEPARTNERS"
],
"BASE":
[
"I_EXCISEDUEDOCHDR"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/