Closed cawoodmonads closed 4 months ago
Hello cawoodmonads,
yes, the reasoning behind this is as follows:
ASSERT it_table IS NOT INITIAL
into your product code, you call cx_…_assert=>assert_not_initial( it_table )
. The class then checks the condition and in case the condition is violated, raises a class based exception:CLASS cx_xyz_assert DEFINITION PUBLIC
INHERITING FROM cx_no_check FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor
IMPORTING previous LIKE previous OPTIONAL.
CLASS-METHODS assert_not_initial
IMPORTING VALUE(act) TYPE any.
" ...
ENDCLASS.
CLASS cx_xyz_assert IMPLEMENTATION.
METHOD constructor.
super->constructor( previous = previous ).
ENDMETHOD.
METHOD assert_not_initial.
IF act IS INITIAL.
RAISE EXCEPTION NEW cx_xyz_assert( ).
ENDIF.
ENDMETHOD.
" ...
ENDCLASS.
Kind regards, Jörg-Michael
P.S.: Putting the "documentation" label, because it would certainly be helpful to have a better explanation within the cleanup rule (e.g. in the example code)
Hi cawoodmonads,
I meanwhile enhanced the examples of this cleanup rule with some explanation (similar to my comments above), so hopefully this is better understandable now. Thanks again for bringing it up – this is available now with version 1.18.0, which was just released!
Kind regards, Jörg-Michael
There is a check that no
ASSERT
is used but insteadcx_assert
. However the classcx_assert
does not exist in any SAP system we know of. How are users supposed to proceed? Create and configure azcx_assert
?