Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions src/z2ui5_cl_demo_app_056.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ CLASS z2ui5_cl_demo_app_056 IMPLEMENTATION.

METHOD set_data.

"replace this with a db select here...
mt_table = VALUE #(
( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
( product = 'chair' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
Expand All @@ -83,8 +82,6 @@ CLASS z2ui5_cl_demo_app_056 IMPLEMENTATION.
( product = 'table2' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
).

"put the range in the where clause of your abap sql command
"here we use an internal table instead
DELETE mt_table WHERE product NOT IN mt_range.

ENDMETHOD.
Expand All @@ -98,17 +95,14 @@ CLASS z2ui5_cl_demo_app_056 IMPLEMENTATION.
title = 'abap2UI5 - Select-Options'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code' target = '_blank'
)->get_parent( ).

DATA(vbox) = view->vbox( ).
vbox->_z2ui5( )->multiinput_ext(
addedtokens = client->_bind_edit( mt_tokens_added )
removedtokens = client->_bind_edit( mt_tokens_removed )
change = client->_event( 'UPDATE_TOKENS' )
multiinputid = `MultiInput` ).
change = client->_event( 'UPDATE_TOKENS' )
multiinputid = `MultiInput` ).

DATA(tab) = vbox->table(
items = client->_bind( val = mt_table )
Expand Down Expand Up @@ -169,12 +163,15 @@ CLASS z2ui5_cl_demo_app_056 IMPLEMENTATION.
IF client->get( )-check_on_navigated = abap_true.
TRY.
DATA(lo_value_help) = CAST z2ui5_cl_pop_get_range( client->get_app( client->get( )-s_draft-id_prev_app ) ).
IF lo_value_help->result( )-check_confirmed = abap_true.
mt_range = lo_value_help->result( )-t_range.
mt_token = z2ui5_cl_util=>filter_get_token_t_by_range_t( mt_range ).
set_data( ).
client->view_model_update( ).
IF lo_value_help->result( )-check_confirmed = abap_false.
RETURN.
ENDIF.

mt_range = lo_value_help->result( )-t_range.
mt_token = z2ui5_cl_util=>filter_get_token_t_by_range_t( mt_range ).
set_data( ).
client->view_model_update( ).

CATCH cx_root.
ENDTRY.
RETURN.
Expand Down
38 changes: 15 additions & 23 deletions src/z2ui5_cl_demo_app_150.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ ENDCLASS.
CLASS Z2UI5_CL_DEMO_APP_150 IMPLEMENTATION.


METHOD ui5_event.

CASE client->get( )-event.

WHEN 'POPUP'.
DATA(lo_app) = z2ui5_cl_pop_to_confirm=>factory( `this is a question` ).
client->nav_app_call( lo_app ).

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).

ENDCASE.

ENDMETHOD.

METHOD ui5_callback.

TRY.
Expand All @@ -30,7 +45,6 @@ CLASS Z2UI5_CL_DEMO_APP_150 IMPLEMENTATION.

ENDMETHOD.


METHOD ui5_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
Expand All @@ -39,12 +53,6 @@ CLASS Z2UI5_CL_DEMO_APP_150 IMPLEMENTATION.
title = 'abap2UI5 - Popup To Confirm'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code'
target = '_blank'

)->get_parent(
)->button(
text = 'Open Popup...'
press = client->_event( 'POPUP' ) ).
Expand All @@ -54,22 +62,6 @@ CLASS Z2UI5_CL_DEMO_APP_150 IMPLEMENTATION.
ENDMETHOD.


METHOD ui5_event.

CASE client->get( )-event.

WHEN 'POPUP'.
DATA(lo_app) = z2ui5_cl_pop_to_confirm=>factory( `this is a question` ).
client->nav_app_call( lo_app ).

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).

ENDCASE.

ENDMETHOD.


METHOD z2ui5_if_app~main.

me->client = client.
Expand Down
17 changes: 7 additions & 10 deletions src/z2ui5_cl_demo_app_162.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
TYPES ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY.

DATA mt_table TYPE ty_t_table.
DATA mt_sql TYPE z2ui5_cl_util=>ty_t_filter_multi.
DATA mt_filter TYPE z2ui5_cl_util=>ty_t_filter_multi.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
Expand All @@ -42,7 +42,7 @@
client->view_model_update( ).

WHEN `PREVIEW_FILTER`.
client->nav_app_call( z2ui5_cl_pop_get_range_m=>factory( mt_sql ) ).
client->nav_app_call( z2ui5_cl_pop_get_range_m=>factory( mt_filter ) ).

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
Expand All @@ -53,7 +53,6 @@

METHOD set_data.

"replace this with a db select here...
mt_table = VALUE #(
( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
( product = 'chair' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
Expand All @@ -65,7 +64,7 @@

z2ui5_cl_util=>filter_itab(
EXPORTING
filter = mt_sql
filter = mt_filter
CHANGING
val = mt_table
).
Expand All @@ -81,10 +80,7 @@
title = 'abap2UI5 - Select-Options'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code' target = '_blank'
)->get_parent( ).
).

DATA(vbox) = view->vbox( ).

Expand Down Expand Up @@ -122,7 +118,8 @@

IF mv_check_initialized = abap_false.
mv_check_initialized = abap_true.
mt_sql = z2ui5_cl_util=>filter_get_multi_by_data( mt_table ).
mt_filter = z2ui5_cl_util=>filter_get_multi_by_data( mt_table ).
DELETE mt_filter WHERE name = `SELKZ`.
view_display( ).
RETURN.
ENDIF.
Expand All @@ -131,7 +128,7 @@
TRY.
DATA(lo_value_help) = CAST z2ui5_cl_pop_get_range_m( client->get_app( client->get( )-s_draft-id_prev_app ) ).
IF lo_value_help->result( )-check_confirmed = abap_true.
mt_sql = lo_value_help->result( )-t_sql.
mt_filter = lo_value_help->result( )-t_filter.

Check failure on line 131 in src/z2ui5_cl_demo_app_162.clas.abap

View check run for this annotation

abaplint / abaplint

Component "t_filter" not found in structure

https://rules.abaplint.org/check_syntax

Check failure on line 131 in src/z2ui5_cl_demo_app_162.clas.abap

View check run for this annotation

abaplint / abaplint / abap_cloud_readiness

Component "t_filter" not found in structure

https://rules.abaplint.org/check_syntax
set_data( ).
client->view_model_update( ).
ENDIF.
Expand Down