class zcl_epoch definition
public
final
create public .
public section.
class-methods get_time
returning
value(value) type numc13 .
protected section.
private section.
endclass.
class zcl_epoch implementation.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZCL_EPOCH=>GET_TIME
* +-------------------------------------------------------------------------------------------------+
* | [<-()] VALUE TYPE NUMC13
* +--------------------------------------------------------------------------------------</SIGNATURE>
method get_time.
data time type tzntstmpl.
data str1 type string.
data str2 type string.
data tstmp1 type p.
data tstmp2 type p.
data secs type tzntstmpl.
get time stamp field time.
tstmp1 = time.
tstmp2 = '19700101000000'.
try.
secs = cl_abap_tstmp=>subtract(
tstmp1 = tstmp1
tstmp2 = tstmp2
).
catch cx_parameter_invalid_range .
catch cx_parameter_invalid_type .
endtry.
str1 = secs.
str2 = time.
value = str1(10) && str2+15(3).
endmethod.
endclass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 |