- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
881 B
ABAP
39 lines
881 B
ABAP
CLASS {{p}}cl_repl DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
|
PUBLIC SECTION.
|
|
METHODS calculate
|
|
IMPORTING
|
|
iv_stock TYPE decfloat34
|
|
iv_reorder_point TYPE decfloat34
|
|
iv_target_stock TYPE decfloat34
|
|
iv_pack_size TYPE decfloat34
|
|
iv_min_qty TYPE decfloat34
|
|
RETURNING
|
|
VALUE(rv_qty) TYPE decfloat34.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS {{p}}cl_repl IMPLEMENTATION.
|
|
METHOD calculate.
|
|
IF iv_stock >= iv_reorder_point.
|
|
rv_qty = 0.
|
|
RETURN.
|
|
ENDIF.
|
|
|
|
DATA(lv_need) = iv_target_stock - iv_stock.
|
|
DATA(lv_min_qty) = iv_min_qty.
|
|
IF lv_min_qty < 0.
|
|
lv_min_qty = 0.
|
|
ENDIF.
|
|
IF lv_need < lv_min_qty.
|
|
lv_need = lv_min_qty.
|
|
ENDIF.
|
|
|
|
IF lv_need <= 0.
|
|
rv_qty = 0.
|
|
RETURN.
|
|
ENDIF.
|
|
|
|
rv_qty = ceil( lv_need / iv_pack_size ) * iv_pack_size.
|
|
ENDMETHOD.
|
|
ENDCLASS.
|