class ZCL_ABAP_DATE_CONSTANTS definition
public
final
create public .
public section.
constants maximum_date type d value '99991231'.
constants first_day_of_year type string value '0101'.
constants last_day_of_year type string value '1231'.
constants minimum_date type d value '00010101'.
protected section.
private section.
ENDCLASS.
* Working
call_method( zcl_abap_date_constants=>maximum_date ).
data date_constants type ref to zcl_abap_date_constants.
data common_types type ref to zcl_abap_common_types.
" Working for types
data binary_table type common_types->binary_table.
" Not working for constants --> syntax error
call_method( date_constants->maximum_date ).
class app definition.
public section.
methods constructor.
methods main.
private section.
data date_constants type ref to ZCL_ABAP_DATE_CONSTANTS.
endclass.
class app implementation.
method constructor.
date_constants = new #( ).
endmethod.
method main.
cl_demo_output=>display( date_constants->maximum_date ).
endmethod.
endclass.
class constants definition final inheriting from zcl_abap_date_constants.
endclass.
* Working
call_method( constants=>maximum_date ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 |