- 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>
2.5 KiB
2.5 KiB
1. Goal
A warehouse system needs the quantity for a replenishment order of a storage bin. The calling program calls the function module {{P}}REPL_CALC. The calculation logic must be in the class {{P}}CL_REPL, because other programs also use this logic.
2. Open questions
None.
3. Context
- Function group {{P}}FG_REPL exists in package $TMP.
- Function module {{P}}REPL_SAMPLE exists in this function group. It shows bin information. Do not change it.
- The class {{P}}CL_REPL does not exist. Create it first.
4. Contract
4.1 Class {{P}}CL_REPL
- Package: $TMP.
- The class is instantiable without parameters.
- Public instance method calculate:
- importing iv_stock, type decfloat34
- importing iv_reorder_point, type decfloat34
- importing iv_target_stock, type decfloat34
- importing iv_pack_size, type decfloat34
- importing iv_min_qty, type decfloat34
- returning rv_qty, type decfloat34
- The method has no exception. Call it only with a positive pack size.
4.2 Function module {{P}}REPL_CALC
- Function group: {{P}}FG_REPL.
- Importing parameters:
- iv_stock, type decfloat34
- iv_reorder_point, type decfloat34
- iv_target_stock, type decfloat34
- iv_pack_size, type decfloat34
- iv_min_qty, type decfloat34
- Exporting parameters:
- ev_qty, type decfloat34
- Exceptions: invalid_pack_size.
- The function module {{P}}REPL_CALC must call the method calculate of the class {{P}}CL_REPL. Create and activate the class before you activate the function module.
5. Business rules
- If the pack size is not positive, the function module raises the exception INVALID_PACK_SIZE. The class method is not called in this case.
- If the stock is greater than or equal to the reorder point, the replenishment quantity is 0.
- Otherwise, the requirement is the target stock minus the stock.
- If the requirement is less than the minimum quantity, the requirement is the minimum quantity. A minimum quantity below 0 counts as 0.
- If the requirement is not positive, the replenishment quantity is 0.
- Otherwise, round the requirement up to the next full multiple of the pack size. The replenishment quantity is this multiple multiplied by the pack size.
6. Constraints
- Release target: 7.58.
- Use Clean ABAP. Keep each method below 40 statements.
- Out of scope: do not change {{P}}REPL_SAMPLE. Do not create database tables.
7. Acceptance
- The function module and the class are active and have no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.