Skip to content

Commit 5f11c94

Browse files
authored
new demo (#187)
demo 197 for faucet filter (wip) demo 198 for t_arg object return.
1 parent 3c43cf6 commit 5f11c94

File tree

4 files changed

+248
-0
lines changed

4 files changed

+248
-0
lines changed
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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.

src/z2ui5_cl_demo_app_197.clas.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_197</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>facet filteer</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
class Z2UI5_CL_DEMO_APP_198 definition
2+
public
3+
create public .
4+
5+
public section.
6+
7+
interfaces IF_SERIALIZABLE_OBJECT .
8+
interfaces Z2UI5_IF_APP .
9+
10+
data PRODUCT type STRING .
11+
data QUANTITY type STRING .
12+
data CHECK_INITIALIZED type ABAP_BOOL .
13+
PROTECTED SECTION.
14+
PRIVATE SECTION.
15+
ENDCLASS.
16+
17+
18+
19+
CLASS Z2UI5_CL_DEMO_APP_198 IMPLEMENTATION.
20+
21+
22+
METHOD Z2UI5_IF_APP~MAIN.
23+
24+
IF check_initialized = abap_false.
25+
check_initialized = abap_true.
26+
27+
product = 'tomato'.
28+
quantity = '500'.
29+
30+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
31+
view->_generic( ns = `html` name = `style` )->_cc_plain_xml( `.my-style{ background: black !important; opacity: 0.6; color: white; }` ).
32+
client->view_display( view->shell(
33+
)->page(
34+
title = 'abap2UI5 - First Example'
35+
navbuttonpress = client->_event( val = 'BACK' s_ctrl = VALUE #( check_view_destroy = abap_true ) )
36+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
37+
)->button(
38+
text = 'post'
39+
press = client->_event( val = 'BUTTON_POST' t_arg = VALUE #( ( `$event.mParameters` ) ) )
40+
)->stringify( ) ).
41+
42+
ENDIF.
43+
44+
CASE client->get( )-event.
45+
46+
WHEN 'BUTTON_POST'.
47+
DATA(lt_arg) = client->get( )-t_event_arg.
48+
49+
WHEN 'BACK'.
50+
client->nav_app_leave( ).
51+
52+
ENDCASE.
53+
54+
ENDMETHOD.
55+
ENDCLASS.

src/z2ui5_cl_demo_app_198.clas.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_198</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>t_arg object example</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>

0 commit comments

Comments
 (0)