STRU and exception tasks accepted; G6 cascade fix, exception class mutants, RTTI unit notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
73
tasks_gen/train/G1904/reference/cx_issue_error.clas.abap
Normal file
73
tasks_gen/train/G1904/reference/cx_issue_error.clas.abap
Normal file
@@ -0,0 +1,73 @@
|
||||
CLASS {{p}}cx_issue_error DEFINITION
|
||||
PUBLIC
|
||||
INHERITING FROM cx_static_check
|
||||
FINAL
|
||||
CREATE PUBLIC.
|
||||
|
||||
PUBLIC SECTION.
|
||||
INTERFACES {{p}}if_issue_error_info.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_case,
|
||||
unknown_material TYPE {{p}}if_issue_error_info=>ty_case VALUE 'UNKNOWN_MATERIAL',
|
||||
zero_quantity TYPE {{p}}if_issue_error_info=>ty_case VALUE 'ZERO_QUANTITY',
|
||||
over_limit TYPE {{p}}if_issue_error_info=>ty_case VALUE 'OVER_LIMIT',
|
||||
END OF c_case.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
iv_case TYPE {{p}}if_issue_error_info=>ty_case
|
||||
iv_material TYPE string
|
||||
iv_quantity TYPE i
|
||||
iv_limit TYPE i.
|
||||
|
||||
METHODS get_text REDEFINITION.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA mv_case TYPE {{p}}if_issue_error_info=>ty_case.
|
||||
DATA mv_material TYPE string.
|
||||
DATA mv_quantity TYPE i.
|
||||
DATA mv_limit TYPE i.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}cx_issue_error IMPLEMENTATION.
|
||||
|
||||
METHOD constructor.
|
||||
super->constructor( ).
|
||||
mv_case = iv_case.
|
||||
mv_material = iv_material.
|
||||
mv_quantity = iv_quantity.
|
||||
mv_limit = iv_limit.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_issue_error_info~get_case.
|
||||
rv_case = mv_case.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_issue_error_info~get_material.
|
||||
rv_material = mv_material.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_issue_error_info~get_quantity.
|
||||
rv_quantity = mv_quantity.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_issue_error_info~get_limit.
|
||||
rv_limit = mv_limit.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_text.
|
||||
CASE mv_case.
|
||||
WHEN c_case-unknown_material.
|
||||
result = |Material { mv_material } is not known|.
|
||||
WHEN c_case-zero_quantity.
|
||||
result = |Quantity must not be zero for material { mv_material }|.
|
||||
WHEN c_case-over_limit.
|
||||
result = |Quantity { mv_quantity } exceeds limit { mv_limit } for material { mv_material }|.
|
||||
WHEN OTHERS.
|
||||
result = |Stock issue failed for material { mv_material }|.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user