1.3 KiB
1.3 KiB
1. Goal
Calculate a processing fee for a posted document. The posting program calls one event module for each document. The event module must have the same interface as the sample event module, because the posting program calls all event modules in the same way.
2. Open questions
None.
3. Context
- Function group {{P}}FG_EVT exists in package $TMP.
- Function module {{P}}EVT_SAMPLE exists in this group. It is the sample event module. Its interface is the interface that all event modules must use.
4. Contract
- Create the function module {{P}}EVT_FEE in function group {{P}}FG_EVT.
- Use exactly the interface of {{P}}EVT_SAMPLE: the same parameter names, kinds, types, and exceptions.
5. Business rules
- If the amount is less than 0, raise the exception INVALID_AMOUNT.
- Set the skip flag to false, except in rule 4.
- Document type IN: the fee is 2 % of the amount, rounded half up to 2 decimals. The minimum fee is 1.00. The maximum fee is 50.00.
- Document type CR: set the skip flag to true. Do not change the fee.
- Other document types: the fee is 0.
6. Constraints
- Release target: 7.58.
- Out of scope: do not change {{P}}EVT_SAMPLE.
7. Acceptance
- The function module is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.