SAP Knowledge Base Article - Public

3589948 - Duration calculation in the 'Production Execution Duration' app

Symptom

This documentation provides insights of the duration calculation logic in the Production Execution Duration app (ID: F2172)

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP S/4HANA Cloud Public Edition

Cause

The Production Execution Duration analytical app is a comparison of planned and actual (confirmed) durations in the Production Order as deviation, in total and in %.

Resolution

All the calculations in the Production Execution Duration app are performed with the lowest useful unit of measure for durations, the second. This gives the best result as it needs to be rounded up or down only once. Later the result is transferred to a more comfortable unit of measure.

Thus, in the app the duration can be seen in two units of measures:
- In seconds (which has a rather high value in most cases)
- And a more suitable one

This conversion is done hard-coded as follows:

      case

        when ddis.ActualWorkdayDurnInSeconds < 60        then cast('S'   as actualdurationunit)

        when ddis.ActualWorkdayDurnInSeconds < 3600      then cast('MIN' as actualdurationunit)

        when ddis.ActualWorkdayDurnInSeconds < 86400     then cast('STD' as actualdurationunit)

        when ddis.ActualWorkdayDurnInSeconds < 604800    then cast('TAG' as actualdurationunit)

        when ddis.ActualWorkdayDurnInSeconds < 2592000   then cast('WCH' as actualdurationunit)   

        when ddis.ActualWorkdayDurnInSeconds < 31536000  then cast('MON' as actualdurationunit)       

        else cast('JHR' as actualdurationunit)   

 

In some cases this may lead to different units for the planned and the actual duration, for example if there is a bigger difference, like the planned duration is 3000 seconds but the actual is 7200 seconds. Then the apps displays 50 MIN for the planned duration but 2 HRS for the actual one.

This is in order to avoid a zero (0) before the decimal point.

The duration calculation is based on the factory calendar, therefore a weekend or a holiday is considered if it lays between a start and an end date. 

See Also

For reference, please see also SAP Help Portal: Production Execution Duration

Keywords

Production Execution Duration, App, F2172,Production Order, Operation, Confirmed, Time, Date, Unit of Measure, UoM, seconds, minutes, hours, Factory Calendar, S/4HANA Cloud Public Edition, Manufacturing, Production Planning and Control, Production Operations, Discrete Manufacturing. , KBA , PP-SFC-2CL , Production Orders (Public Cloud) , How To

Product

SAP S/4HANA Cloud Public Edition 2502