Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
34
tasks_gen/train/G1127/reference/key_price.func.abap
Normal file
34
tasks_gen/train/G1127/reference/key_price.func.abap
Normal file
@@ -0,0 +1,34 @@
|
||||
FUNCTION {{p}}key_price
|
||||
IMPORTING
|
||||
iv_key_type TYPE string
|
||||
iv_quantity TYPE i
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
ev_valid TYPE abap_bool
|
||||
EXCEPTIONS
|
||||
invalid_quantity.
|
||||
|
||||
DATA lv_unit_price TYPE decfloat34.
|
||||
ev_price = 0.
|
||||
ev_valid = abap_false.
|
||||
IF iv_quantity < 1.
|
||||
RAISE invalid_quantity.
|
||||
ENDIF.
|
||||
CASE iv_key_type.
|
||||
WHEN 'ST'.
|
||||
lv_unit_price = '3.50'.
|
||||
WHEN 'SE'.
|
||||
lv_unit_price = '12.00'.
|
||||
WHEN 'TR'.
|
||||
lv_unit_price = '45.00'.
|
||||
WHEN OTHERS.
|
||||
RETURN.
|
||||
ENDCASE.
|
||||
ev_price = lv_unit_price * iv_quantity.
|
||||
IF iv_quantity >= 10.
|
||||
ev_price = ev_price * '0.9'.
|
||||
ENDIF.
|
||||
ev_price = round( val = ev_price dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
ev_valid = abap_true.
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user