21 lines
1004 B
Plaintext
21 lines
1004 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Fabric roll grade'
|
|
define view entity {{P}}I_ROLL_GRADE
|
|
as select from {{p}}roll as roll
|
|
inner join {{p}}fabric as fabric on fabric.fabric <> roll.fabric
|
|
{
|
|
key roll.roll_id as roll_id,
|
|
fabric.fabric_name as fabric_name,
|
|
case when fabric.fibre = 'C' or fabric.fibre = 'W'
|
|
or fabric.fibre = 'S'
|
|
then 'N'
|
|
else 'S' end as fibre_class,
|
|
substring( roll.roll_id, 1, 3 ) as loom,
|
|
round( cast( roll.length_cm as abap.dec(15,2) )
|
|
* cast( roll.width_cm as abap.dec(15,2) )
|
|
/ 10000, 2 ) as area_sqm,
|
|
case when roll.defects = 0 then 'A'
|
|
when roll.defects <= 3 then 'B'
|
|
else 'C' end as grade
|
|
}
|