P_IN_ProductGSTHealthCheck

DDL: P_IN_PRODUCTGSTHEALTHCHECK Type: view_entity COMPOSITE

Product GST India Health Check

P_IN_ProductGSTHealthCheck is a Composite CDS View that provides data about "Product GST India Health Check" in SAP S/4HANA. It reads from 3 data sources (I_ProductPlantBasic, I_ProductPurchaseTax, I_IN_ProductGSTHlthChkList) and exposes 15 fields with key fields CompanyCode, Plant, Product, IN_GSTHlthChkCategory, IN_GSTHealthCheck.

Data Sources (3)

SourceAliasJoin Type
I_ProductPlantBasic I_ProductPlantBasic from
I_ProductPurchaseTax I_ProductPurchaseTax inner
I_IN_ProductGSTHlthChkList ProdMasterCheckList cross

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Product GST India Health Check view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode
KEY Plant I_ProductPlantBasic Plant
KEY Product I_ProductPlantBasic Product
KEY IN_GSTHlthChkCategory I_IN_ProductGSTHlthChkList IN_GSTHlthChkCategory
KEY IN_GSTHealthCheck I_IN_ProductGSTHlthChkList IN_GSTHealthCheck
CompanyCodeName
PlantName
ProductDescription
ProductGroup
ProductGroupName
IN_GSTHlthChkCatFldName I_IN_ProductGSTHlthChkList IN_GSTHlthChkCatFldName
IN_GSTHealthCheckCatDesc I_IN_ProductGSTHlthChkList IN_GSTHealthCheckCatDesc
ConsumptionTaxCtrlCode
char100elseendasIN_GSTHlthChkCatFldVal
IN_GSTHlthChkCrrtnStp I_IN_ProductGSTHlthChkList IN_GSTHlthChkCrrtnStp
@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":""
}
}*/