Skip to content

Commit 0afc7ca

Browse files
authored
Add files via upload
0 parents  commit 0afc7ca

File tree

7 files changed

+310
-0
lines changed

7 files changed

+310
-0
lines changed

src/package.devc.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DEVC" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<DEVC>
6+
<CTEXT>Exception library</CTEXT>
7+
</DEVC>
8+
</asx:values>
9+
</asx:abap>
10+
</abapGit>

src/zcx_dynamic_check.clas.abap

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
"! <p class="shorttext synchronized" lang="EN">Excs. with Dynamic Check of RAISING Clause with t100 message</p>
2+
class zcx_dynamic_check definition
3+
public
4+
inheriting from cx_dynamic_check
5+
create public.
6+
7+
public section.
8+
9+
interfaces: if_t100_message.
10+
11+
"! <p class="shorttext synchronized" lang="EN">Create an exception. Can use either a t100 msg or a text ID</p>
12+
"! Providing <strong>both</strong> text parameters will result in a <strong>short dump</strong>
13+
"!
14+
"! @parameter i_t100_message | <p class="shorttext synchronized" lang="EN">t100 message</p>
15+
"! @parameter i_previous | <p class="shorttext synchronized" lang="EN"></p>
16+
methods constructor
17+
importing
18+
i_t100_message type ref to if_t100_message optional
19+
i_previous like previous optional
20+
preferred parameter i_t100_message.
21+
22+
data var1 type sy-msgv1 read-only.
23+
24+
data var2 type sy-msgv2 read-only.
25+
26+
data var3 type sy-msgv4 read-only.
27+
28+
data var4 type sy-msgv4 read-only.
29+
30+
protected section.
31+
32+
methods load_message_in_sy_structure
33+
importing
34+
i_t100_message type ref to if_t100_message
35+
returning
36+
value(r_self) type ref to zcx_dynamic_check.
37+
38+
endclass.
39+
class zcx_dynamic_check implementation.
40+
41+
method constructor ##ADT_SUPPRESS_GENERATION.
42+
43+
super->constructor( previous = i_previous ).
44+
45+
me->textid = value #( ).
46+
47+
if i_t100_message is supplied.
48+
49+
me->load_message_in_sy_structure( i_t100_message ).
50+
51+
me->var1 = sy-msgv1.
52+
53+
me->var2 = sy-msgv2.
54+
55+
me->var3 = sy-msgv3.
56+
57+
me->var4 = sy-msgv4.
58+
59+
me->if_t100_message~t100key = cond #( when i_t100_message is not initial
60+
then value #( msgid = sy-msgid
61+
msgno = sy-msgno
62+
attr1 = 'VAR1'
63+
attr2 = 'VAR2'
64+
attr3 = 'VAR3'
65+
attr4 = 'VAR4' )
66+
else if_t100_message=>default_textid ).
67+
68+
else.
69+
70+
me->if_t100_message~t100key = if_t100_message=>default_textid.
71+
72+
endif.
73+
74+
endmethod.
75+
method load_message_in_sy_structure.
76+
77+
cl_message_helper=>get_text_for_message( i_t100_message ).
78+
79+
r_self = me.
80+
81+
endmethod.
82+
83+
endclass.

src/zcx_dynamic_check.clas.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>ZCX_DYNAMIC_CHECK</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>.</DESCRIPT>
9+
<CATEGORY>40</CATEGORY>
10+
<STATE>1</STATE>
11+
<CLSCCINCL>X</CLSCCINCL>
12+
<FIXPT>X</FIXPT>
13+
<UNICODE>X</UNICODE>
14+
</VSEOCLASS>
15+
</asx:values>
16+
</asx:abap>
17+
</abapGit>

src/zcx_no_check.clas.abap

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
"! <p class="shorttext synchronized" lang="EN">Excs. with No Check of RAISING Clause with t100 message</p>
2+
class zcx_no_check definition
3+
public
4+
inheriting from cx_no_check
5+
create public.
6+
7+
public section.
8+
9+
interfaces: if_t100_message.
10+
11+
"! <p class="shorttext synchronized" lang="EN">Create an exception. Can use either a t100 msg or a text ID</p>
12+
"! Providing <strong>both</strong> text parameters will result in a <strong>short dump</strong>
13+
"!
14+
"! @parameter i_t100_message | <p class="shorttext synchronized" lang="EN">t100 message</p>
15+
"! @parameter i_previous | <p class="shorttext synchronized" lang="EN"></p>
16+
methods constructor
17+
importing
18+
i_t100_message type ref to if_t100_message optional
19+
i_previous like previous optional
20+
preferred parameter i_t100_message.
21+
22+
data var1 type sy-msgv1 read-only.
23+
24+
data var2 type sy-msgv2 read-only.
25+
26+
data var3 type sy-msgv4 read-only.
27+
28+
data var4 type sy-msgv4 read-only.
29+
30+
protected section.
31+
32+
methods load_message_in_sy_structure
33+
importing
34+
i_t100_message type ref to if_t100_message
35+
returning
36+
value(r_self) type ref to zcx_no_check.
37+
38+
endclass.
39+
class zcx_no_check implementation.
40+
41+
method constructor ##ADT_SUPPRESS_GENERATION.
42+
43+
super->constructor( previous = i_previous ).
44+
45+
me->textid = value #( ).
46+
47+
if i_t100_message is supplied.
48+
49+
me->load_message_in_sy_structure( i_t100_message ).
50+
51+
me->var1 = sy-msgv1.
52+
53+
me->var2 = sy-msgv2.
54+
55+
me->var3 = sy-msgv3.
56+
57+
me->var4 = sy-msgv4.
58+
59+
me->if_t100_message~t100key = cond #( when i_t100_message is not initial
60+
then value #( msgid = sy-msgid
61+
msgno = sy-msgno
62+
attr1 = 'VAR1'
63+
attr2 = 'VAR2'
64+
attr3 = 'VAR3'
65+
attr4 = 'VAR4' )
66+
else if_t100_message=>default_textid ).
67+
68+
else.
69+
70+
me->if_t100_message~t100key = if_t100_message=>default_textid.
71+
72+
endif.
73+
74+
endmethod.
75+
method load_message_in_sy_structure.
76+
77+
cl_message_helper=>get_text_for_message( i_t100_message ).
78+
79+
r_self = me.
80+
81+
endmethod.
82+
83+
endclass.

src/zcx_no_check.clas.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>ZCX_NO_CHECK</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>.</DESCRIPT>
9+
<CATEGORY>40</CATEGORY>
10+
<STATE>1</STATE>
11+
<CLSCCINCL>X</CLSCCINCL>
12+
<FIXPT>X</FIXPT>
13+
<UNICODE>X</UNICODE>
14+
</VSEOCLASS>
15+
</asx:values>
16+
</asx:abap>
17+
</abapGit>

src/zcx_static_check.clas.abap

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
"! <p class="shorttext synchronized" lang="EN">Excs. with Static Check of RAISING Clause with t100 message</p>
2+
class zcx_static_check definition
3+
public
4+
inheriting from cx_static_check
5+
create public.
6+
7+
public section.
8+
9+
interfaces: if_t100_message.
10+
11+
"! <p class="shorttext synchronized" lang="EN">Create an exception. Can use either a t100 msg or a text ID</p>
12+
"! Providing <strong>both</strong> text parameters will result in a <strong>short dump</strong>
13+
"!
14+
"! @parameter i_t100_message | <p class="shorttext synchronized" lang="EN">t100 message</p>
15+
"! @parameter i_previous | <p class="shorttext synchronized" lang="EN"></p>
16+
methods constructor
17+
importing
18+
i_t100_message type ref to if_t100_message optional
19+
i_previous like previous optional
20+
preferred parameter i_t100_message.
21+
22+
data var1 type sy-msgv1 read-only.
23+
24+
data var2 type sy-msgv2 read-only.
25+
26+
data var3 type sy-msgv4 read-only.
27+
28+
data var4 type sy-msgv4 read-only.
29+
30+
protected section.
31+
32+
methods load_message_in_sy_structure
33+
importing
34+
i_t100_message type ref to if_t100_message
35+
returning
36+
value(r_self) type ref to zcx_static_check.
37+
38+
endclass.
39+
class zcx_static_check implementation.
40+
41+
method constructor ##ADT_SUPPRESS_GENERATION.
42+
43+
super->constructor( previous = i_previous ).
44+
45+
me->textid = value #( ).
46+
47+
if i_t100_message is supplied.
48+
49+
me->load_message_in_sy_structure( i_t100_message ).
50+
51+
me->var1 = sy-msgv1.
52+
53+
me->var2 = sy-msgv2.
54+
55+
me->var3 = sy-msgv3.
56+
57+
me->var4 = sy-msgv4.
58+
59+
me->if_t100_message~t100key = cond #( when i_t100_message is not initial
60+
then value #( msgid = sy-msgid
61+
msgno = sy-msgno
62+
attr1 = 'VAR1'
63+
attr2 = 'VAR2'
64+
attr3 = 'VAR3'
65+
attr4 = 'VAR4' )
66+
else if_t100_message=>default_textid ).
67+
68+
else.
69+
70+
me->if_t100_message~t100key = if_t100_message=>default_textid.
71+
72+
endif.
73+
74+
endmethod.
75+
method load_message_in_sy_structure.
76+
77+
cl_message_helper=>get_text_for_message( i_t100_message ).
78+
79+
r_self = me.
80+
81+
endmethod.
82+
83+
endclass.

src/zcx_static_check.clas.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>ZCX_STATIC_CHECK</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>.</DESCRIPT>
9+
<CATEGORY>40</CATEGORY>
10+
<STATE>1</STATE>
11+
<CLSCCINCL>X</CLSCCINCL>
12+
<FIXPT>X</FIXPT>
13+
<UNICODE>X</UNICODE>
14+
</VSEOCLASS>
15+
</asx:values>
16+
</asx:abap>
17+
</abapGit>

0 commit comments

Comments
 (0)