Работа с cl_gui_calendar
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 |
* Стандартные примеры * SAPCALENDAR_DEMO1 * SAPCALENDAR_DRAG_DROP * RSDEMO_CALENDAR_CONTROL DATA: o_cnt TYPE REF TO cl_gui_dialogbox_container. DATA: o_cal TYPE REF TO cl_gui_calendar. PARAMETERS: p_week TYPE string. PARAMETERS: p_date TYPE string. CLASS lcl_events DEFINITION. PUBLIC SECTION. CLASS-METHODS on_close FOR EVENT close OF cl_gui_dialogbox_container IMPORTING sender. CLASS-METHODS on_date_selected FOR EVENT date_selected OF cl_gui_calendar IMPORTING date_begin date_end sender. ENDCLASS. CLASS lcl_events IMPLEMENTATION. METHOD on_close. sender->free( ). ENDMETHOD. METHOD on_date_selected. DATA: lv_date_begin TYPE cnca_utc_date. TRY. sender->get_selection( IMPORTING date_begin = lv_date_begin ). p_week = 10. p_date = lv_date_begin. CATCH cx_root INTO DATA(e_txt). ENDTRY. ENDMETHOD. ENDCLASS. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_week. o_cnt = NEW #( no_autodef_progid_dynnr = abap_true caption = 'Kalender' top = 100 left = 200 width = 640 height = 120 ). SET HANDLER lcl_events=>on_close FOR o_cnt. o_cal = NEW #( parent = o_cnt selection_style = cnca_sel_week view_style = cnca_style_h_navigator ). DATA: it_events TYPE cntl_simple_events. it_events = VALUE #( ( eventid = cl_gui_calendar=>m_id_date_selected appl_event = abap_true ) ). o_cal->set_registered_events( events = it_events ). SET HANDLER lcl_events=>on_date_selected FOR o_cal. START-OF-SELECTION. WRITE / p_week. WRITE / p_date. |