Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
1011 B
Create function module {{P}}PRD_SCRAP in function group {{P}}FG_PROD. Use the interface of {{P}}PRD_SAMPLE: importing iv_quantity and iv_scrap, exporting ev_scrap_pct and ev_severity, changing cv_rework_qty. Use the same types and exceptions as {{P}}PRD_SAMPLE. If iv_quantity is less than or equal to 0, raise INVALID_QUANTITY. If iv_scrap is less than 0, raise INVALID_QUANTITY. If iv_scrap is greater than iv_quantity, raise SCRAP_TOO_HIGH. Calculate ev_scrap_pct as iv_scrap divided by iv_quantity, multiplied by 100. Round the result half up to 1 decimal. Set ev_severity from ev_scrap_pct: equal to 0 = OK; greater than 0 and less than or equal to 5 = LOW; greater than 5 and less than or equal to 20 = HIGH; greater than 20 = CRITICAL. If ev_severity is HIGH or CRITICAL, set cv_rework_qty to iv_scrap. Otherwise do not change cv_rework_qty. Release target is 7.58. Do not change {{P}}PRD_SAMPLE. Write ABAP Unit tests in a global test class. The function module must be active and have no syntax error.