@@ -6,7 +6,7 @@ CLASS zsm30_cl_app_01 DEFINITION
66 INTERFACES if_serializable_object.
77 INTERFACES z2ui5_if_app.
88
9- DATA mo_layout TYPE ref to z2ui5_cl_layout.
9+ DATA mo_layout TYPE REF TO z2ui5_cl_layout.
1010 DATA mv_search_value TYPE string .
1111 DATA mt_table TYPE REF TO data .
1212 DATA mv_change_active TYPE abap_bool .
@@ -25,7 +25,6 @@ CLASS zsm30_cl_app_01 DEFINITION
2525 TYPES ty_t_keys TYPE STANDARD TABLE OF ty_s_keys WITH EMPTY KEY .
2626
2727 DATA mv_input_visible TYPE abap_bool .
28-
2928 DATA mt_dfies TYPE z2ui5_cl_util=>ty_t_dfies.
3029 DATA client TYPE REF TO z2ui5_if_client.
3130 DATA check_initialized TYPE abap_bool .
@@ -35,24 +34,31 @@ CLASS zsm30_cl_app_01 DEFINITION
3534 DATA mv_transport TYPE string .
3635 DATA mv_multi_edit TYPE abap_bool .
3736 DATA mv_key_error TYPE abap_bool .
38-
3937 DATA mv_ucomm_tmp TYPE string .
4038
4139 METHODS on_init.
42-
4340 METHODS on_event.
44-
4541 METHODS search .
46-
4742 METHODS get_data.
48-
4943 METHODS set_row_id.
50-
5144 METHODS get_dfies.
52-
5345 METHODS row_select.
54-
5546 METHODS render_main.
47+ METHODS button_save.
48+ METHODS on_event_main.
49+ METHODS on_event_layout.
50+ METHODS get_table_name.
51+ METHODS on_after_layout.
52+ METHODS get_layout.
53+ METHODS on_after_transport.
54+ METHODS transport_all.
55+ METHODS on_event_transport.
56+ METHODS button_delete.
57+ METHODS check_input.
58+ METHODS button_copy.
59+ METHODS view_model_update.
60+ METHODS on_after_popup.
61+ METHODS check_table_name.
5662
5763 METHODS get_txt
5864 IMPORTING
@@ -61,8 +67,6 @@ CLASS zsm30_cl_app_01 DEFINITION
6167 RETURNING
6268 VALUE (result ) TYPE string .
6369
64- METHODS button_save.
65-
6670 METHODS get_keys
6771 IMPORTING
6872 !table TYPE STANDARD TABLE
@@ -81,21 +85,6 @@ CLASS zsm30_cl_app_01 DEFINITION
8185 RETURNING
8286 VALUE (result ) TYPE REF TO z2ui5_cl_xml_view.
8387
84- METHODS on_event_main.
85-
86- METHODS on_event_layout.
87-
88- METHODS get_table_name.
89-
90- METHODS on_after_layout.
91-
92- METHODS get_layout.
93-
94- METHODS on_after_transport.
95-
96- METHODS transport_all.
97- METHODS on_event_transport.
98-
9988 METHODS render_ui_table
10089 IMPORTING
10190 !page TYPE REF TO z2ui5_cl_xml_view.
@@ -104,19 +93,10 @@ CLASS zsm30_cl_app_01 DEFINITION
10493 IMPORTING
10594 !page TYPE REF TO z2ui5_cl_xml_view.
10695
107- METHODS button_delete.
108- METHODS check_input.
109-
110- METHODS button_copy.
111- METHODS view_model_update.
112- METHODS on_after_popup.
113-
11496 METHODS redner_input
11597 IMPORTING
11698 !page TYPE REF TO z2ui5_cl_xml_view.
11799
118- METHODS check_table_name.
119-
120100 PRIVATE SECTION .
121101
122102ENDCLASS .
@@ -486,102 +466,13 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
486466
487467 CHECK mt_table IS BOUND .
488468
489- DATA (table ) = page->table( growing = 'true'
490- growingthreshold = '100'
491- width = 'auto'
492- autoPopinMode = abap_true
493- items = client->_bind_edit( val = mt_table->* )
494- headertext = mv_table ).
495-
496- " TODO: variable is assigned but never used (ABAP cleaner)
497- DATA (headder ) = table->header_toolbar(
498- )->overflow_toolbar(
499- )->title( text = mv_table
500- )->toolbar_spacer(
501- )->search_field( value = client->_bind_edit( mv_search_value )
502- search = client->_event( 'BUTTON_SEARCH' )
503- change = client->_event( 'BUTTON_SEARCH' )
504- id = `SEARCH`
505- width = '17.5rem' ).
506-
507- headder = z2ui5_cl_pop_display_layout=>render_layout_function( xml = headder
508- client = client ).
509-
510- DATA (columns ) = table->columns( ).
511-
512- LOOP AT mo_layout->ms_layout-t_layout REFERENCE INTO DATA (layout ).
513- DATA (lv_index ) = sy -tabix .
514-
515- columns->column( visible = client->_bind( val = layout->visible
516- tab = mo_layout->ms_layout-t_layout
517- tab_index = lv_index )
518- halign = client->_bind( val = layout->halign
519- tab = mo_layout->ms_layout-t_layout
520- tab_index = lv_index )
521- importance = client->_bind( val = layout->importance
522- tab = mo_layout->ms_layout-t_layout
523- tab_index = lv_index )
524- mergeduplicates = client->_bind( val = layout->merge
525- tab = mo_layout->ms_layout-t_layout
526- tab_index = lv_index )
527- width = client->_bind( val = layout->width
528- tab = mo_layout->ms_layout-t_layout
529- tab_index = lv_index )
530- )->text( layout->tlabel ).
531-
532- ENDLOOP .
533-
534- DATA (cells ) = columns->get_parent( )->items(
535- )->column_list_item(
536- valign = 'Middle'
537- type = 'Navigation'
538- * type = 'Active'
539- press = client->_event( val = 'ROW_SELECT'
540- t_arg = VALUE #( ( `${ROW_ID}` ) ) )
541- )->cells( ).
542-
543- LOOP AT mo_layout->ms_layout-t_layout REFERENCE INTO layout .
544-
545- IF layout->t_sub_col IS NOT INITIAL .
546-
547- DATA (sub_col ) = `` .
548- DATA (index ) = 0 .
549-
550- LOOP AT layout->t_sub_col INTO DATA (subcol ).
551-
552- index = index + 1 .
553-
554- READ TABLE mo_layout->ms_layout-t_layout INTO DATA (line ) WITH KEY fname = subcol-fname.
555-
556- IF line-reference_field IS INITIAL .
557- DATA (Column ) = | { line-tlabel } : \{{ subcol-fname } \}| .
558- ELSE .
559- column = | { line-tlabel } : \{{ subcol-fname } \} \{{ line-reference_field } \}| .
560- ENDIF .
561-
562- IF index = 1 .
563- sub_col = column .
564- ELSE .
565- sub_col = | { sub_col }{ cl_abap_char_utilities=>cr_lf }{ column } | .
566- ENDIF .
567- ENDLOOP .
568-
569- IF layout->reference_field IS NOT INITIAL .
570- cells->object_identifier( title = | \{{ layout->fname } \} \{{ layout->reference_field } \}|
571- text = sub_col ).
572- ELSE .
573- cells->object_identifier( title = | \{{ layout->fname } \}|
574- text = sub_col ).
575- ENDIF .
576-
577- ELSE .
578- IF layout->reference_field IS NOT INITIAL .
579- cells->object_identifier( text = | \{{ layout->fname } \} \{{ layout->reference_field } \}| ).
580- ELSE .
581- cells->object_identifier( text = | \{{ layout->fname } \}| ).
582- ENDIF .
583- ENDIF .
584- ENDLOOP .
469+ z2ui5_cl_xml_builder=>xml_build_table( i_data = mt_table
470+ i_search_value = REF #( mv_search_value )
471+ i_xml = page
472+ i_client = client
473+ i_layout = mo_layout
474+ i_col_BIND_TO = 'ROW_ID'
475+ i_col_type = 'Navigation' ).
585476
586477 ENDMETHOD .
587478
@@ -823,9 +714,7 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
823714 " subcolumns need rerendering to work ..
824715 render_main( ).
825716 ELSE .
826-
827717 view_model_update( ).
828-
829718 ENDIF .
830719 CATCH cx_root.
831720 ENDTRY .
@@ -840,15 +729,15 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
840729* DATA(lgnum) = ZSM30_cl_parameter_helper=>get_parameter_id( '/SCWM/LGN' ).
841730
842731 IF mv_multi_edit = abap_false .
843- DATA (control ) = z2ui5_cl_pop_display_layout =>m_table.
732+ DATA (control ) = z2ui5_cl_layout =>m_table.
844733 ELSE .
845- control = z2ui5_cl_pop_display_layout =>ui_table.
734+ control = z2ui5_cl_layout =>ui_table.
846735 ENDIF .
847736 mo_layout = z2ui5_cl_pop_display_layout=>init_layout( control = control
848737 data = mt_table
849- handle01 = CONV #( class )
850- handle02 = CONV #( mv_table )
851- handle03 = CONV #( 'SIMPLE_VIEW' ) ).
738+ handle01 = class
739+ handle02 = mv_table
740+ handle03 = 'SIMPLE_VIEW' ).
852741
853742 ENDMETHOD .
854743
@@ -922,19 +811,20 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
922811 LOOP AT mo_layout->ms_layout-t_layout REFERENCE INTO DATA (layout ).
923812 DATA (lv_index ) = sy -tabix .
924813
925- DATA (col ) = columns->ui_column( visible = client->_bind( val = layout->visible
926- tab = mo_layout->ms_layout-t_layout
927- tab_index = lv_index )
928- halign = client->_bind( val = layout->halign
929- tab = mo_layout->ms_layout-t_layout
930- tab_index = lv_index )
931- width = COND #( WHEN layout->width IS NOT INITIAL
932- THEN client->_bind( val = layout->width
933- tab = mo_layout->ms_layout-t_layout
934- tab_index = lv_index ) )
935-
936- sortproperty = layout->fname
937- filterproperty = layout->fname
814+ DATA (col ) = columns->ui_column(
815+ visible = client->_bind( val = layout->visible
816+ tab = mo_layout->ms_layout-t_layout
817+ tab_index = lv_index )
818+ halign = client->_bind( val = layout->halign
819+ tab = mo_layout->ms_layout-t_layout
820+ tab_index = lv_index )
821+ width = COND #( WHEN layout->width IS NOT INITIAL
822+ THEN client->_bind( val = layout->width
823+ tab = mo_layout->ms_layout-t_layout
824+ tab_index = lv_index ) )
825+
826+ sortproperty = layout->fname
827+ filterproperty = layout->fname
938828 )->text( layout->tlabel )->ui_template( ).
939829
940830 IF layout->fname = 'SELKZ' .
0 commit comments