-
Notifications
You must be signed in to change notification settings - Fork 13
/
zrstpda_script_wp_field_symbol.prog.abap
102 lines (76 loc) · 2.71 KB
/
zrstpda_script_wp_field_symbol.prog.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
*<SCRIPT:PERSISTENT>
REPORT rstpda_script_template.
*<SCRIPT:HEADER>
*<SCRIPTNAME>ZRSTPDA_SCRIPT_WP_FIELD_SYMBOL</SCRIPTNAME>
*<SCRIPT_CLASS>LCL_DEBUGGER_SCRIPT</SCRIPT_CLASS>
*<SINGLE_STEP>X</SINGLE_STEP>
*</SCRIPT:HEADER>
*<SCRIPT:PRESETTINGS>
*</SCRIPT:PRESETTINGS>
*<SCRIPT:SCRIPT_CLASS>
*---------------------------------------------------------------------*
* CLASS lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script DEFINITION INHERITING FROM cl_tpda_script_class_super.
PUBLIC SECTION.
METHODS: prologue REDEFINITION,
init REDEFINITION,
script REDEFINITION,
end REDEFINITION.
PRIVATE SECTION.
DATA: returncode TYPE char01,
field_symbol TYPE string,
old_value TYPE tpda_var_value.
ENDCLASS. "lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
* CLASS lcl_debugger_script IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script IMPLEMENTATION.
METHOD prologue.
ENDMETHOD. "prolog
METHOD init.
DATA: fields TYPE STANDARD TABLE OF sval.
INSERT VALUE #( tabname = 'DD03L'
fieldname = 'FIELDNAME'
fieldtext = 'Field-Symbol'(001)
field_obl = abap_true )
INTO TABLE fields
REFERENCE INTO DATA(ref_field_symbol).
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
popup_title = text-001
IMPORTING
returncode = returncode
TABLES
fields = fields " Table fields, values and attributes
EXCEPTIONS
error_in_fields = 1
OTHERS = 2.
IF returncode <> space OR sy-subrc <> 0.
me->break( ).
RETURN.
ENDIF.
field_symbol = ref_field_symbol->value.
ENDMETHOD. "init
METHOD script.
CHECK field_symbol IS NOT INITIAL.
TRY.
DATA(new_value) = cl_tpda_script_data_descr=>get_simple_value( field_symbol ).
IF new_value <> old_value.
DATA(text) = |Watchpoint { field_symbol } reached|.
MESSAGE text TYPE 'S'.
me->break( ).
ENDIF.
old_value = new_value.
CATCH cx_tpda INTO DATA(error).
ENDTRY.
ENDMETHOD. "script
METHOD end.
ENDMETHOD. "end
ENDCLASS. "lcl_debugger_script IMPLEMENTATION
*</SCRIPT:SCRIPT_CLASS>
*</SCRIPT:PERSISTENT>