Files
abap-llm/tasks_gen/train/G1097/spec.md
2026-10-05 18:02:52 +02:00

2.1 KiB

1. Goal

A mobile welding shop repairs metal parts. For each weld seam of a repair order, the order desk calls one event module. The event module calculates the charge of the seam. The event module must have the same interface as the sample event module, because the order desk calls all event modules in the same way.

2. Open questions

None.

3. Context

  • Function group {{P}}FG_WELD exists in package $TMP.
  • Function module {{P}}WELD_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}}WELD_FEE in function group {{P}}FG_WELD.
  • Use exactly the interface of {{P}}WELD_SAMPLE: the same parameter names, kinds, types, and exceptions.

5. Business rules

  1. If the seam length is less than 0, raise the exception INVALID_LENGTH.
  2. Set the skip flag to false.
  3. Material ST (steel): the rate is 12.00 per centimetre.
  4. Material SS (stainless steel): the rate is 20.00 per centimetre.
  5. Material AL (aluminium): the rate is 28.00 per centimetre. The shop welds an aluminium seam only if the seam is at most 50 cm long.
  6. If the material is AL and the seam is longer than 50 cm, set the skip flag to true and stop. Do not change the charge.
  7. For all other materials, set the skip flag to true and stop. Do not change the charge.
  8. The charge is the rate multiplied by the seam length, rounded half up to 2 decimals.
  9. If the seam is longer than 200 cm, the charge gets a discount of 10 %. Round the result half up to 2 decimals.
  10. If the express flag is true, the charge gets a surcharge of 25 %. Round the result half up to 2 decimals.
  11. Apply rule 9 before rule 10.
  12. The minimum charge is 40.00. If the charge is less than 40.00, use 40.00.

6. Constraints

  • Release target: 8.16.
  • Coding standards: Clean ABAP. Keep every method below 40 statements.
  • Out of scope: do not change {{P}}WELD_SAMPLE.

7. Acceptance

  • The function module {{P}}WELD_FEE is active and has no syntax error.
  • The hidden tests pass.
  • Write ABAP Unit tests for the function module in a global test class.