@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Product GST India Health Check'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #XXL,
dataClass: #MIXED
}
@VDM.viewType: #COMPOSITE
@VDM.private:true
define view entity P_IN_ProductGSTHealthCheck
as select from I_ProductPlantBasic
inner join I_ProductPurchaseTax on I_ProductPlantBasic.Product = I_ProductPurchaseTax.Product
and I_ProductPurchaseTax.SourceLocationCountry = 'IN'
and I_ProductPurchaseTax.TaxIndicator <> '2'
cross join I_IN_ProductGSTHlthChkList as ProdMasterCheckList
{
@ObjectModel.text.element: ['CompanyCodeName']
key I_ProductPlantBasic._Plant._ValuationArea.CompanyCode as CompanyCode,
@ObjectModel.text.element: ['PlantName']
key I_ProductPlantBasic.Plant as Plant,
@ObjectModel.text.element: ['ProductDescription']
key I_ProductPlantBasic.Product as Product,
key ProdMasterCheckList.IN_GSTHlthChkCategory,
key ProdMasterCheckList.IN_GSTHealthCheck,
@Semantics.text: true
I_ProductPlantBasic._Plant._ValuationArea._CompanyCode.CompanyCodeName,
@Semantics.text: true
I_ProductPlantBasic._Plant.PlantName,
@Semantics.text: true
I_ProductPlantBasic._Text[Language = 'E'].ProductDescription,
@ObjectModel.text.element: ['ProductGroupName']
I_ProductPlantBasic._Product.ProductGroup,
@Semantics.text: true
I_ProductPlantBasic._Product._ProductGroupText_2[Language = 'E'].ProductGroupName,
ProdMasterCheckList.IN_GSTHlthChkCatFldName,
ProdMasterCheckList.IN_GSTHealthCheckCatDesc,
replace_regexpr( pcre => '[A-Za-z0-9]', value => rpad(I_ProductPlantBasic.ConsumptionTaxCtrlCode, 8, 'Z' ), with => 'Z', result_length => 8 ) as ConsumptionTaxCtrlCode,
//HSN/SAC Code Initial Check
case when ProdMasterCheckList.IN_GSTHlthChkCategory = '006'
and ProdMasterCheckList.IN_GSTHealthCheck = '00001'
and I_ProductPlantBasic.ConsumptionTaxCtrlCode is initial then 'X'
//HSN/SAC Code Length Check
when ProdMasterCheckList.IN_GSTHlthChkCategory = '006'
and ProdMasterCheckList.IN_GSTHealthCheck = '00005'
and I_ProductPlantBasic.ConsumptionTaxCtrlCode is not initial
and length(I_ProductPlantBasic.ConsumptionTaxCtrlCode) > 8 then 'X'
//HSN/SAC Code Special Charcter Check
when ProdMasterCheckList.IN_GSTHlthChkCategory = '006'
and ProdMasterCheckList.IN_GSTHealthCheck = '00004'
and I_ProductPlantBasic.ConsumptionTaxCtrlCode is not initial
and length(I_ProductPlantBasic.ConsumptionTaxCtrlCode) <= 8
and $projection.ConsumptionTaxCtrlCode <> 'ZZZZZZZZ' then 'X'
else ''
end as IN_ProdHasGSTHlthChkErr,
case when ProdMasterCheckList.IN_GSTHlthChkCategory = '006'
then cast( I_ProductPlantBasic.ConsumptionTaxCtrlCode as abap.char (100) )
else ''
end as IN_GSTHlthChkCatFldVal,
case when ( ProdMasterCheckList.IN_GSTHlthChkCategory = '006' )
and ProdMasterCheckList.IN_GSTHealthCheck = '00001'
then replace( ProdMasterCheckList.IN_GSTHealthCheckErrDesc, '&1', ProdMasterCheckList.IN_GSTHealthCheckCatDesc )
when ProdMasterCheckList.IN_GSTHlthChkCategory = '006'
and ProdMasterCheckList.IN_GSTHealthCheck = '00005'
then replace( ProdMasterCheckList.IN_GSTHealthCheckErrDesc, '&1', '8' )
else ProdMasterCheckList.IN_GSTHealthCheckErrDesc
end as IN_GSTHealthCheckErrDesc,
ProdMasterCheckList.IN_GSTHlthChkCrrtnStp
}
where I_ProductPlantBasic._Plant._ValuationArea._CompanyCode.Country = 'IN';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_IN_PRODUCTGSTHLTHCHKLIST",
"I_PLANT",
"I_PRODUCT",
"I_PRODUCTDESCRIPTION",
"I_PRODUCTGROUPTEXT_2",
"I_PRODUCTPLANTBASIC",
"I_PRODUCTPURCHASETAX",
"I_VALUATIONAREA"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/