--Count the number of unprocessed chemical compliance requests
--status = NEW
@AbapCatalog:
{
sqlViewName: 'PCCREQUPCT',
compiler.compareFilter: true
}
--Access Control: Authorizations Checks
@AccessControl:
{
authorizationCheck: #NOT_REQUIRED
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE@ObjectModel.usageType.serviceQuality: #C
--VDM view type
@VDM.viewType: #CONSUMPTION@VDM.private: truedefineview P_ChmlCmplncReqUnprocessedCT
--Select data from basic view 'Chemical Compliance Request'
asselectfrom I_ChmlCmplncReq
{
--UUID of Chemical Compliance Information/Unpackaged Product (referenced by Chemical Compliance Request)
ChmlCmplncProdUUID,
--Count the found requests
count(*) as recordCount
}
-- avoid processing of all compliance requests in the system because of empty unpackaged product relation
where ChmlCmplncProdUUID isnotnulland ChmlCmplncProdUUID <> hextobin('00000000000000000000000000000000')
--Only with status NEW (= unprocessed)
and ChmlCmplncRequestPrgrsStatus = 'NEW'
--grouped by Unpackaged Product
groupby
ChmlCmplncProdUUID
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCREQ"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/