File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,13 @@ CLASS cl_abap_tstmp IMPLEMENTATION.
92
92
ENDMETHOD .
93
93
94
94
METHOD td_add .
95
- ASSERT 1 = 'todo' .
95
+
96
+ DATA (td ) = add(
97
+ tstmp = | { date }{ time } |
98
+ secs = secs ).
99
+
100
+ CONVERT TIME STAMP td INTO DATE res_date TIME res_time.
101
+
96
102
ENDMETHOD .
97
103
98
104
METHOD systemtstmp_utc2syst .
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
11
11
METHODS systemtstmp_syst2utc_initial FOR TESTING RAISING cx_static_check.
12
12
METHODS move_to_short1 FOR TESTING RAISING cx_static_check.
13
13
METHODS td_subtract1 FOR TESTING RAISING cx_static_check.
14
+ METHODS td_add1 FOR TESTING RAISING cx_static_check.
14
15
15
16
ENDCLASS .
16
17
@@ -170,4 +171,28 @@ CLASS ltcl_test IMPLEMENTATION.
170
171
exp = 600 ).
171
172
ENDMETHOD .
172
173
174
+ METHOD td_add1 .
175
+
176
+ DATA lv_date TYPE d .
177
+ DATA lv_time TYPE t .
178
+
179
+ cl_abap_tstmp=>td_add(
180
+ EXPORTING
181
+ date = '20250505'
182
+ time = '111111'
183
+ secs = 100
184
+ IMPORTING
185
+ res_date = lv_date
186
+ res_time = lv_time ).
187
+
188
+ cl_abap_unit_assert=>assert_equals(
189
+ act = lv_date
190
+ exp = '20250505' ).
191
+
192
+ cl_abap_unit_assert=>assert_equals(
193
+ act = lv_time
194
+ exp = '111251' ).
195
+
196
+ ENDMETHOD .
197
+
173
198
ENDCLASS .
You can’t perform that action at this time.
0 commit comments