- 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>
57 lines
2.4 KiB
Markdown
57 lines
2.4 KiB
Markdown
# 1. Goal
|
|
The program {{P}}STOCK_NET_OLD is a legacy report. It shows the net stock
|
|
quantity for each material and plant in a period. The report is slow and hard
|
|
to read. Write the program {{P}}STOCK_NET. The new program has the same
|
|
selection screen and the same result as the legacy report, but the code is
|
|
clean and the movements are read with one database access.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- The table {{P}}MOVE exists in package $TMP and contains data. Fields:
|
|
- MOV_ID (INT4, key): the movement number.
|
|
- MATERIAL (CHAR 10): the material number.
|
|
- PLANT (CHAR 4): the plant.
|
|
- MOVE_DATE (DATS): the movement date.
|
|
- MOVE_TYPE (CHAR 2): 'GR' for a goods receipt, 'GI' for a goods issue.
|
|
- QUANTITY (DEC 15,3): the movement quantity.
|
|
- The program {{P}}STOCK_NET_OLD exists in package $TMP. It is legacy code. It
|
|
gives the correct result.
|
|
- The class {{P}}SEED_MOVE fills the table {{P}}MOVE with data.
|
|
|
|
# 4. Contract
|
|
- Create the executable program {{P}}STOCK_NET in package $TMP.
|
|
- Selection screen:
|
|
- Parameter P_FROM, type DATS, mandatory: the first movement date to include.
|
|
- Parameter P_TO, type DATS, mandatory: the last movement date to include.
|
|
- Select-option S_MATNR for the material number.
|
|
- Show the result with CL_SALV_TABLE. The output table has these columns with
|
|
these names: MATERIAL, PLANT, NET_QTY, MOVE_COUNT.
|
|
|
|
# 5. Business rules
|
|
1. Include a movement only if MOVE_DATE is on or after P_FROM, MOVE_DATE is on
|
|
or before P_TO, and MATERIAL is in S_MATNR.
|
|
2. Group the included movements by MATERIAL and PLANT.
|
|
3. NET_QTY is the sum of QUANTITY of all included goods receipts in the group
|
|
minus the sum of QUANTITY of all included goods issues in the group.
|
|
4. MOVE_COUNT is the number of included movements in the group.
|
|
5. Show one line for each material and plant that has at least one included
|
|
movement.
|
|
6. Sort the lines by MATERIAL in ascending order and by PLANT in ascending
|
|
order.
|
|
7. The result of {{P}}STOCK_NET is the same as the result of
|
|
{{P}}STOCK_NET_OLD.
|
|
|
|
# 6. Constraints
|
|
- Release target: 8.16.
|
|
- Coding standards: Clean ABAP. Methods have less than 40 statements. Read the
|
|
movements with one database access. Do not use obsolete statements.
|
|
- Out of scope: do not change the table {{P}}MOVE, the class {{P}}SEED_MOVE and
|
|
the program {{P}}STOCK_NET_OLD.
|
|
|
|
# 7. Acceptance
|
|
- The program is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests as local test classes in the program.
|