|
| 1 | +CLASS z2ui5_cl_demo_app_197 DEFINITION |
| 2 | + PUBLIC |
| 3 | + CREATE PUBLIC . |
| 4 | + |
| 5 | + PUBLIC SECTION. |
| 6 | + |
| 7 | + INTERFACES if_serializable_object . |
| 8 | + INTERFACES z2ui5_if_app . |
| 9 | + |
| 10 | + TYPES: |
| 11 | + BEGIN OF ty_s_tab, |
| 12 | + selkz TYPE abap_bool, |
| 13 | + product TYPE string, |
| 14 | + create_date TYPE string, |
| 15 | + create_by TYPE string, |
| 16 | + storage_location TYPE string, |
| 17 | + quantity TYPE i, |
| 18 | + END OF ty_s_tab . |
| 19 | + TYPES: |
| 20 | + ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY . |
| 21 | + |
| 22 | + DATA mt_table TYPE ty_t_table . |
| 23 | + DATA mt_table_products TYPE ty_t_table . |
| 24 | + DATA check_initialized TYPE abap_bool . |
| 25 | + DATA client TYPE REF TO z2ui5_if_client . |
| 26 | + DATA mv_check_popover TYPE abap_bool . |
| 27 | + DATA mv_product TYPE string . |
| 28 | + |
| 29 | + METHODS z2ui5_set_data . |
| 30 | + METHODS z2ui5_display_view . |
| 31 | + |
| 32 | + PROTECTED SECTION. |
| 33 | + PRIVATE SECTION. |
| 34 | +ENDCLASS. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +CLASS Z2UI5_CL_DEMO_APP_197 IMPLEMENTATION. |
| 39 | + |
| 40 | + |
| 41 | + METHOD z2ui5_display_view. |
| 42 | + |
| 43 | + DATA(view) = z2ui5_cl_xml_view=>factory( ). |
| 44 | + |
| 45 | + DATA(page) = view->page( id = `page_main` |
| 46 | + title = 'abap2UI5 - List Report Features' |
| 47 | + navbuttonpress = client->_event( 'BACK' ) |
| 48 | + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). |
| 49 | + |
| 50 | + DATA(facet) = page->facet_filter( id = `idFacetFilter` type = `Light` showpersonalization = abap_true showreset = abap_true "lists = client->_bind( mt_table_products ) |
| 51 | + )->facet_filter_list( title = `Products` mode = `MultiSelect` items = client->_bind( mt_table_products ) listclose = client->_event( val = `FILTER` |
| 52 | +* t_arg = VALUE #( ( `${$parameters>/selectedAll}` ) ) ) |
| 53 | + t_arg = VALUE #( ( `$event}` ) ) ) |
| 54 | + )->facet_filter_item( text = `{PRODUCT}` ). |
| 55 | + |
| 56 | + DATA(tab) = page->table( id = `tab` items = client->_bind_edit( val = mt_table ) ). |
| 57 | + |
| 58 | + DATA(lo_columns) = tab->columns( ). |
| 59 | + lo_columns->column( )->text( text = `Product` ). |
| 60 | + lo_columns->column( )->text( text = `Date` ). |
| 61 | + lo_columns->column( )->text( text = `Name` ). |
| 62 | + lo_columns->column( )->text( text = `Location` ). |
| 63 | + lo_columns->column( )->text( text = `Quantity` ). |
| 64 | + |
| 65 | + DATA(lo_cells) = tab->items( )->column_list_item( ). |
| 66 | + lo_cells->link( id = `link` text = '{PRODUCT}' press = client->_event( val = `POPOVER_DETAIL` ) ). |
| 67 | + lo_cells->text( `{CREATE_DATE}` ). |
| 68 | + lo_cells->text( `{CREATE_BY}` ). |
| 69 | + lo_cells->text( `{STORAGE_LOCATION}` ). |
| 70 | + lo_cells->text( `{QUANTITY}` ). |
| 71 | + |
| 72 | + client->view_display( view->stringify( ) ). |
| 73 | + |
| 74 | + ENDMETHOD. |
| 75 | + |
| 76 | + |
| 77 | + METHOD z2ui5_if_app~main. |
| 78 | + |
| 79 | + me->client = client. |
| 80 | + |
| 81 | + IF check_initialized = abap_false. |
| 82 | + check_initialized = abap_true. |
| 83 | + z2ui5_display_view( ). |
| 84 | + z2ui5_set_data( ). |
| 85 | + RETURN. |
| 86 | + ENDIF. |
| 87 | + |
| 88 | + CASE client->get( )-event. |
| 89 | + WHEN 'FILTER'. |
| 90 | + |
| 91 | + DATA(lt_arg) = client->get( )-t_event_arg. |
| 92 | + DATA(lt3) = lt_arg. |
| 93 | + WHEN 'BACK'. |
| 94 | + client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). |
| 95 | + |
| 96 | + ENDCASE. |
| 97 | + |
| 98 | + ENDMETHOD. |
| 99 | + |
| 100 | + |
| 101 | + METHOD z2ui5_set_data. |
| 102 | + |
| 103 | + mt_table = VALUE #( |
| 104 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 105 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 106 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 107 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 108 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 109 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 110 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 111 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 112 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 113 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 114 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 115 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 116 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 117 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 118 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 119 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 120 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 121 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 122 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 123 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 124 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 125 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 126 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 127 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 128 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 129 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 130 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 131 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 132 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 133 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 134 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 135 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 136 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 137 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 138 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 139 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 140 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 141 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 142 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 143 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 144 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 145 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 146 | + ( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) |
| 147 | + ( product = 'chair' create_date = `01.01.2022` create_by = `James` storage_location = `AREA_001` quantity = 123 ) |
| 148 | + ( product = 'sofa' create_date = `01.05.2021` create_by = `Simone` storage_location = `AREA_001` quantity = 700 ) |
| 149 | + ( product = 'computer' create_date = `27.01.2023` create_by = `Theo` storage_location = `AREA_001` quantity = 200 ) |
| 150 | + ( product = 'printer' create_date = `01.01.2023` create_by = `Hannah` storage_location = `AREA_001` quantity = 90 ) |
| 151 | + ( product = 'table2' create_date = `01.01.2023` create_by = `Julia` storage_location = `AREA_001` quantity = 110 ) |
| 152 | + ). |
| 153 | + |
| 154 | + mt_table_products = mt_table. |
| 155 | + |
| 156 | + SORT mt_table_products BY product. |
| 157 | + |
| 158 | + DELETE ADJACENT DUPLICATES FROM mt_table_products COMPARING product. |
| 159 | + |
| 160 | + ENDMETHOD. |
| 161 | +ENDCLASS. |
0 commit comments