@@ -6,7 +6,7 @@ CLASS zsm30_cl_app_01 DEFINITION
6
6
INTERFACES if_serializable_object.
7
7
INTERFACES z2ui5_if_app.
8
8
9
- DATA mo_layout TYPE ref to z2ui5_cl_layout.
9
+ DATA mo_layout TYPE REF TO z2ui5_cl_layout.
10
10
DATA mv_search_value TYPE string .
11
11
DATA mt_table TYPE REF TO data .
12
12
DATA mv_change_active TYPE abap_bool .
@@ -25,7 +25,6 @@ CLASS zsm30_cl_app_01 DEFINITION
25
25
TYPES ty_t_keys TYPE STANDARD TABLE OF ty_s_keys WITH EMPTY KEY .
26
26
27
27
DATA mv_input_visible TYPE abap_bool .
28
-
29
28
DATA mt_dfies TYPE z2ui5_cl_util=>ty_t_dfies.
30
29
DATA client TYPE REF TO z2ui5_if_client.
31
30
DATA check_initialized TYPE abap_bool .
@@ -35,24 +34,31 @@ CLASS zsm30_cl_app_01 DEFINITION
35
34
DATA mv_transport TYPE string .
36
35
DATA mv_multi_edit TYPE abap_bool .
37
36
DATA mv_key_error TYPE abap_bool .
38
-
39
37
DATA mv_ucomm_tmp TYPE string .
40
38
41
39
METHODS on_init.
42
-
43
40
METHODS on_event.
44
-
45
41
METHODS search .
46
-
47
42
METHODS get_data.
48
-
49
43
METHODS set_row_id.
50
-
51
44
METHODS get_dfies.
52
-
53
45
METHODS row_select.
54
-
55
46
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.
56
62
57
63
METHODS get_txt
58
64
IMPORTING
@@ -61,8 +67,6 @@ CLASS zsm30_cl_app_01 DEFINITION
61
67
RETURNING
62
68
VALUE (result ) TYPE string .
63
69
64
- METHODS button_save.
65
-
66
70
METHODS get_keys
67
71
IMPORTING
68
72
!table TYPE STANDARD TABLE
@@ -81,21 +85,6 @@ CLASS zsm30_cl_app_01 DEFINITION
81
85
RETURNING
82
86
VALUE (result ) TYPE REF TO z2ui5_cl_xml_view.
83
87
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
-
99
88
METHODS render_ui_table
100
89
IMPORTING
101
90
!page TYPE REF TO z2ui5_cl_xml_view.
@@ -104,19 +93,10 @@ CLASS zsm30_cl_app_01 DEFINITION
104
93
IMPORTING
105
94
!page TYPE REF TO z2ui5_cl_xml_view.
106
95
107
- METHODS button_delete.
108
- METHODS check_input.
109
-
110
- METHODS button_copy.
111
- METHODS view_model_update.
112
- METHODS on_after_popup.
113
-
114
96
METHODS redner_input
115
97
IMPORTING
116
98
!page TYPE REF TO z2ui5_cl_xml_view.
117
99
118
- METHODS check_table_name.
119
-
120
100
PRIVATE SECTION .
121
101
122
102
ENDCLASS .
@@ -486,102 +466,13 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
486
466
487
467
CHECK mt_table IS BOUND .
488
468
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' ).
585
476
586
477
ENDMETHOD .
587
478
@@ -823,9 +714,7 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
823
714
" subcolumns need rerendering to work ..
824
715
render_main( ).
825
716
ELSE .
826
-
827
717
view_model_update( ).
828
-
829
718
ENDIF .
830
719
CATCH cx_root.
831
720
ENDTRY .
@@ -840,15 +729,15 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
840
729
* DATA(lgnum) = ZSM30_cl_parameter_helper=>get_parameter_id( '/SCWM/LGN' ).
841
730
842
731
IF mv_multi_edit = abap_false .
843
- DATA (control ) = z2ui5_cl_pop_display_layout =>m_table.
732
+ DATA (control ) = z2ui5_cl_layout =>m_table.
844
733
ELSE .
845
- control = z2ui5_cl_pop_display_layout =>ui_table.
734
+ control = z2ui5_cl_layout =>ui_table.
846
735
ENDIF .
847
736
mo_layout = z2ui5_cl_pop_display_layout=>init_layout( control = control
848
737
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' ).
852
741
853
742
ENDMETHOD .
854
743
@@ -922,19 +811,20 @@ CLASS zsm30_cl_app_01 IMPLEMENTATION.
922
811
LOOP AT mo_layout->ms_layout-t_layout REFERENCE INTO DATA (layout ).
923
812
DATA (lv_index ) = sy -tabix .
924
813
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
938
828
)->text( layout->tlabel )->ui_template( ).
939
829
940
830
IF layout->fname = 'SELKZ' .
0 commit comments