Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
53
tasks_gen/train/G1097/faulty/m0_weld_fee.func.abap
Normal file
53
tasks_gen/train/G1097/faulty/m0_weld_fee.func.abap
Normal file
@@ -0,0 +1,53 @@
|
||||
FUNCTION {{p}}weld_fee
|
||||
IMPORTING
|
||||
iv_material TYPE string
|
||||
iv_seam_cm TYPE decfloat34
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_length.
|
||||
|
||||
IF iv_seam_cm >= 0.
|
||||
RAISE invalid_length.
|
||||
ENDIF.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
CASE iv_material.
|
||||
WHEN 'ST'.
|
||||
lv_rate = 12.
|
||||
WHEN 'SS'.
|
||||
lv_rate = 20.
|
||||
WHEN 'AL'.
|
||||
IF iv_seam_cm > 50.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
lv_rate = 28.
|
||||
WHEN OTHERS.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDCASE.
|
||||
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
lv_fee = round( val = iv_seam_cm * lv_rate dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF iv_seam_cm > 200.
|
||||
lv_fee = round( val = lv_fee * 9 / 10 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_fee = round( val = lv_fee * 125 / 100 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
|
||||
IF lv_fee < 40.
|
||||
lv_fee = 40.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_fee.
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user