Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
29 lines
878 B
ABAP
29 lines
878 B
ABAP
CLASS {{p}}cx_grain DEFINITION PUBLIC FINAL CREATE PUBLIC INHERITING FROM cx_static_check.
|
|
PUBLIC SECTION.
|
|
DATA mv_reason TYPE string READ-ONLY.
|
|
DATA mv_text TYPE string READ-ONLY.
|
|
METHODS constructor IMPORTING iv_reason TYPE string.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS {{p}}cx_grain IMPLEMENTATION.
|
|
METHOD constructor.
|
|
super->constructor( ).
|
|
mv_reason = iv_reason.
|
|
CASE iv_reason.
|
|
WHEN 'WEIGHT'.
|
|
mv_text = 'Weight must be greater than zero'.
|
|
WHEN 'SUPPLIER'.
|
|
mv_text = 'Supplier is not filled'.
|
|
WHEN 'GRAIN_TYPE'.
|
|
mv_text = 'Grain type is not supported'.
|
|
WHEN 'MOISTURE_RANGE'.
|
|
mv_text = 'Moisture is outside the range 0 to 100'.
|
|
WHEN 'MOISTURE'.
|
|
mv_text = 'Moisture is above the limit of the grain type'.
|
|
WHEN OTHERS.
|
|
mv_text = 'Unknown reason'.
|
|
ENDCASE.
|
|
ENDMETHOD.
|
|
ENDCLASS.
|