- skip sy-subrc lines and CDS type lengths; CDS literal mutants; mutate helper classes - proxy: sap_short_dumps shows only dumps of the current run - 26/26 tasks pass; results in docs/faz1-tasarim.md 11g Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
42 lines
880 B
ABAP
42 lines
880 B
ABAP
FUNCTION {{p}}prd_scrap
|
|
IMPORTING
|
|
iv_quantity TYPE decfloat34
|
|
iv_scrap TYPE decfloat34
|
|
EXPORTING
|
|
ev_scrap_pct TYPE decfloat34
|
|
ev_severity TYPE string
|
|
CHANGING
|
|
cv_rework_qty TYPE decfloat34
|
|
EXCEPTIONS
|
|
invalid_quantity
|
|
scrap_too_high.
|
|
|
|
IF iv_quantity <= 0 OR iv_scrap < 0.
|
|
RAISE invalid_quantity.
|
|
ENDIF.
|
|
|
|
IF iv_scrap <= iv_quantity.
|
|
RAISE scrap_too_high.
|
|
ENDIF.
|
|
|
|
ev_scrap_pct = round( val = iv_scrap / iv_quantity * 100
|
|
dec = 1
|
|
mode = cl_abap_math=>round_half_up ).
|
|
|
|
IF ev_scrap_pct = 0.
|
|
ev_severity = 'OK'.
|
|
ELSEIF ev_scrap_pct <= 5.
|
|
ev_severity = 'LOW'.
|
|
ELSEIF ev_scrap_pct <= 20.
|
|
ev_severity = 'HIGH'.
|
|
ELSE.
|
|
ev_severity = 'CRITICAL'.
|
|
ENDIF.
|
|
|
|
CASE ev_severity.
|
|
WHEN 'HIGH' OR 'CRITICAL'.
|
|
cv_rework_qty = iv_scrap.
|
|
ENDCASE.
|
|
|
|
ENDFUNCTION.
|