-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathzcx_dynscreen_dyna_chk_base.clas.abap
81 lines (62 loc) · 2.43 KB
/
zcx_dynscreen_dyna_chk_base.clas.abap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
CLASS zcx_dynscreen_dyna_chk_base DEFINITION PUBLIC INHERITING FROM cx_dynamic_check ABSTRACT CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES:
if_t100_message.
METHODS:
constructor IMPORTING textid LIKE if_t100_message=>t100key OPTIONAL
previous LIKE previous OPTIONAL .
PROTECTED SECTION.
TYPES:
mty_previous_error TYPE c LENGTH 200.
METHODS:
get_class_name IMPORTING io TYPE REF TO object
RETURNING VALUE(rv) TYPE seoclsname,
get_previous_text RETURNING VALUE(rv) TYPE mty_previous_error.
PRIVATE SECTION.
ENDCLASS.
CLASS zcx_dynscreen_dyna_chk_base IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
* ---------------------------------------------------------------------
super->constructor( previous = previous ).
* ---------------------------------------------------------------------
CLEAR me->textid.
* ---------------------------------------------------------------------
IF textid IS INITIAL.
if_t100_message~t100key = if_t100_message=>default_textid.
ELSE.
if_t100_message~t100key = textid.
ENDIF.
* ---------------------------------------------------------------------
ENDMETHOD.
METHOD get_class_name.
* ---------------------------------------------------------------------
IF io IS INITIAL
OR io IS NOT BOUND.
RETURN.
ENDIF.
* ---------------------------------------------------------------------
DATA(lv_class_name) = cl_abap_classdescr=>get_class_name( io ).
* ---------------------------------------------------------------------
rv = replace( val = lv_class_name
sub = '\CLASS='
with = '' ).
* ---------------------------------------------------------------------
ENDMETHOD.
METHOD get_previous_text.
* ---------------------------------------------------------------------
rv = previous->get_text( ).
* ---------------------------------------------------------------------
IF rv IS INITIAL.
rv = previous->get_longtext( ).
ENDIF.
* ---------------------------------------------------------------------
IF rv IS INITIAL.
rv = get_class_name( previous ).
ENDIF.
* ---------------------------------------------------------------------
IF rv IS NOT INITIAL.
rv = `: ` && rv.
ENDIF.
* ---------------------------------------------------------------------
ENDMETHOD.
ENDCLASS.