Skip to content

Commit

Permalink
Downport changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 17, 2025
1 parent 1c998d2 commit 6a27dcf
Show file tree
Hide file tree
Showing 308 changed files with 12,778 additions and 4,031 deletions.
22 changes: 15 additions & 7 deletions src/00/z2ui5_cl_demo_app_135.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,27 @@ CLASS z2ui5_cl_demo_app_135 IMPLEMENTATION.
set_session_stateful( client = client
stateful = abap_true ).

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).

DATA(page) = view->shell( )->page(
DATA page TYPE REF TO z2ui5_cl_xml_view.
DATA temp1 TYPE xsdboolean.
temp1 = boolc( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ).
page = view->shell( )->page(
title = `abap2UI5 - Sample: Sticky Session with locks - (ABAP Standard Only)`
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
shownavbutton = temp1 ).

page->message_strip(
text = client->_bind( error-text )
type = 'Error'
visible = client->_bind( error-flag ) ).

DATA(vbox) = page->vbox( ).
DATA vbox TYPE REF TO z2ui5_cl_xml_view.
vbox = page->vbox( ).

DATA(hbox) = vbox->hbox( alignitems = 'Center' ).
DATA hbox TYPE REF TO z2ui5_cl_xml_view.
hbox = vbox->hbox( alignitems = 'Center' ).

hbox->info_label( text = client->_bind( session_text ) ).

Expand Down Expand Up @@ -146,13 +152,15 @@ CLASS z2ui5_cl_demo_app_135 IMPLEMENTATION.

TRY.
on_event( client ).
CATCH z2ui5_cx_util_error INTO DATA(x_error).
DATA x_error TYPE REF TO z2ui5_cx_util_error.
CATCH z2ui5_cx_util_error INTO x_error.
error-text = x_error->get_text( ).
error-flag = abap_true.
client->view_model_update( ).
ENDTRY.

CATCH cx_root INTO DATA(lx).
DATA lx TYPE REF TO cx_root.
CATCH cx_root INTO lx.
client->message_box_display( lx->get_text( ) ).
ENDTRY.
ENDMETHOD.
Expand Down
21 changes: 16 additions & 5 deletions src/00/z2ui5_cl_demo_app_135.clas.locals_imp.abap
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ CLASS lcl_locking IMPLEMENTATION.

METHOD acquire_lock.

DATA(lv_fm) = 'ENQUEUE_E_TABLE'.
DATA lv_fm TYPE c LENGTH 15.
lv_fm = 'ENQUEUE_E_TABLE'.
CALL FUNCTION lv_fm
EXPORTING
tabname = 'ZTEST'
Expand All @@ -51,7 +52,8 @@ CLASS lcl_locking IMPLEMENTATION.
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO DATA(error_text).
DATA error_text TYPE string.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO error_text.
RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING val = error_text.
ENDIF.

Expand All @@ -64,7 +66,8 @@ CLASS lcl_locking IMPLEMENTATION.
DATA argument TYPE c LENGTH 150.
argument = |ZTEST Z100*|.

DATA(lv_fm) = 'ENQUEUE_READ'.
DATA lv_fm TYPE c LENGTH 12.
lv_fm = 'ENQUEUE_READ'.
CALL FUNCTION lv_fm
EXPORTING
garg = argument
Expand All @@ -76,11 +79,19 @@ CLASS lcl_locking IMPLEMENTATION.
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO DATA(error_text).
DATA error_text TYPE string.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO error_text.
RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING val = error_text.
ENDIF.

result = VALUE #( enqueue_table[ 1 ]-gusevb OPTIONAL ).
DATA temp1 TYPE i.
CLEAR temp1.
DATA temp2 TYPE lcl_locking=>ty_seqg3.
READ TABLE enqueue_table INTO temp2 INDEX 1.
IF sy-subrc = 0.
temp1 = temp2-gusevb.
ENDIF.
result = temp1.

ENDMETHOD.

Expand Down
19 changes: 13 additions & 6 deletions src/00/z2ui5_cl_demo_app_137.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ CLASS z2ui5_cl_demo_app_137 IMPLEMENTATION.

on_event( client ).

CATCH cx_root INTO DATA(lx).
DATA lx TYPE REF TO cx_root.
CATCH cx_root INTO lx.
client->message_box_display( lx->get_text( ) ).
ENDTRY.
ENDMETHOD.
Expand All @@ -48,17 +49,23 @@ CLASS z2ui5_cl_demo_app_137 IMPLEMENTATION.
set_session_stateful( client = client
stateful = abap_true ).

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).

DATA(page) = view->shell( )->page(
DATA page TYPE REF TO z2ui5_cl_xml_view.
DATA temp1 TYPE xsdboolean.
temp1 = boolc( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ).
page = view->shell( )->page(
title = `abap2UI5 - Sample: Sticky Session`
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
shownavbutton = temp1 ).

DATA(vbox) = page->vbox( ).
DATA vbox TYPE REF TO z2ui5_cl_xml_view.
vbox = page->vbox( ).
vbox->info_label( text = client->_bind( session_text ) ).

DATA(hbox) = vbox->hbox( alignitems = 'Center' ).
DATA hbox TYPE REF TO z2ui5_cl_xml_view.
hbox = vbox->hbox( alignitems = 'Center' ).
hbox->label( text = 'press button to increment counter in backend session'
class = 'sapUiTinyMarginEnd' ).
hbox->button(
Expand Down
8 changes: 5 additions & 3 deletions src/00/z2ui5_cl_demo_app_304.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CLASS z2ui5_cl_demo_app_304 IMPLEMENTATION.

me->client = client.

IF client->check_on_init( ).
IF client->check_on_init( ) IS NOT INITIAL.
view_display( ).
ENDIF.

Expand All @@ -38,7 +38,8 @@ CLASS z2ui5_cl_demo_app_304 IMPLEMENTATION.

METHOD view_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).

" Note, these are demo sounds and are part of the abap2UI5 sample repo.
" They are NOT meant to use in production.
Expand All @@ -47,7 +48,8 @@ CLASS z2ui5_cl_demo_app_304 IMPLEMENTATION.
|function playSuccess() \{ new Audio("/SAP/PUBLIC/BC/ABAP/mime_demo/z2ui5_demo_success.mp3").play(); \}|
&& |function playError() \{ new Audio("/SAP/PUBLIC/BC/ABAP/mime_demo/z2ui5_demo_error.mp3").play(); \}| ).

DATA(vbox) = view->page( title = `Play success and error sounds` )->vbox( class = `sapUiSmallMargin` ).
DATA vbox TYPE REF TO z2ui5_cl_xml_view.
vbox = view->page( title = `Play success and error sounds` )->vbox( class = `sapUiSmallMargin` ).
vbox->message_strip(
text = client->_bind( message-text )
type = client->_bind( message-type )
Expand Down
15 changes: 10 additions & 5 deletions src/01/z2ui5_cl_demo_app_lp_01.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ CLASS z2ui5_cl_demo_app_lp_01 IMPLEMENTATION.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell( )->page( showheader = abap_false ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).
DATA page TYPE REF TO z2ui5_cl_xml_view.
page = view->shell( )->page( showheader = abap_false ).
client->view_display( page->simple_form( title = 'Laucnhpad I - Read Startup Parameters' editable = abap_true
)->content( 'form'
)->label( ``
Expand All @@ -35,9 +37,12 @@ CLASS z2ui5_cl_demo_app_lp_01 IMPLEMENTATION.
CASE client->get( )-event.

WHEN 'READ_PARAMS'.
DATA(lv_text) = `Start Parameter: `.
DATA(lt_params) = client->get( )-t_comp_params.
LOOP AT lt_params INTO DATA(ls_param).
DATA lv_text TYPE string.
lv_text = `Start Parameter: `.
DATA lt_params TYPE z2ui5_if_types=>ty_t_name_value.
lt_params = client->get( )-t_comp_params.
DATA ls_param LIKE LINE OF lt_params.
LOOP AT lt_params INTO ls_param.
lv_text = |{ lv_text } / { ls_param-n } = { ls_param-v }|.
ENDLOOP.
client->message_box_display( lv_text ).
Expand Down
15 changes: 10 additions & 5 deletions src/01/z2ui5_cl_demo_app_lp_02.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ CLASS Z2UI5_CL_DEMO_APP_LP_02 IMPLEMENTATION.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(shell) = z2ui5_cl_xml_view=>factory( )->shell( ).
DATA shell TYPE REF TO z2ui5_cl_xml_view.
shell = z2ui5_cl_xml_view=>factory( )->shell( ).
IF client->get( )-check_launchpad_active = abap_true.
DATA(page) = shell->page( showheader = abap_false ).
DATA page TYPE REF TO z2ui5_cl_xml_view.
page = shell->page( showheader = abap_false ).
page->_z2ui5( )->lp_title( client->_bind_edit( mv_title ) ).
ELSE.
page = shell->page( title = client->_bind_edit( mv_title ) ).
Expand All @@ -45,9 +47,12 @@ CLASS Z2UI5_CL_DEMO_APP_LP_02 IMPLEMENTATION.
CASE client->get( )-event.

WHEN 'READ_PARAMS'.
DATA(lv_text) = `Start Parameter: `.
DATA(lt_params) = client->get( )-t_comp_params.
LOOP AT lt_params INTO DATA(ls_param).
DATA lv_text TYPE string.
lv_text = `Start Parameter: `.
DATA lt_params TYPE z2ui5_if_types=>ty_t_name_value.
lt_params = client->get( )-t_comp_params.
DATA ls_param LIKE LINE OF lt_params.
LOOP AT lt_params INTO ls_param.
lv_text = |{ lv_text } / { ls_param-n } = { ls_param-v }|.
ENDLOOP.
client->message_box_display( lv_text ).
Expand Down
26 changes: 17 additions & 9 deletions src/01/z2ui5_cl_demo_app_lp_03.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

DATA(lt_startup_params) = client->get( )-s_config-t_startup_params.
DATA lt_startup_params TYPE z2ui5_if_types=>ty_t_name_value.
lt_startup_params = client->get( )-s_config-t_startup_params.

IF check_initialized = abap_false.
check_initialized = abap_true.
Expand All @@ -36,13 +37,24 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).
DATA temp1 TYPE string_table.
CLEAR temp1.
INSERT `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }` INTO TABLE temp1.
DATA temp2 LIKE LINE OF temp1.
temp2 = `$` && client->_bind_edit( nav_params ).
INSERT temp2 INTO TABLE temp1.
DATA temp3 TYPE xsdboolean.
temp3 = boolc( abap_false = client->get( )-check_launchpad_active ).
DATA temp4 TYPE xsdboolean.
temp4 = boolc( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ).
client->view_display( view->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
showheader = temp3
title = 'abap2UI5 - Cross App Navigation App 127 - This App only works when started via Launchpad'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
shownavbutton = temp4
)->header_content(
)->link(
text = 'Source_Code'
Expand All @@ -58,11 +70,7 @@ CLASS z2ui5_cl_demo_app_lp_03 IMPLEMENTATION.
text = 'go to app 128'
press = client->_event_client(
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #(
( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }` )
* ( `{ "Product" : "102343333" }` )
( `$` && client->_bind_edit( nav_params ) )
)
t_arg = temp1
)
)->stringify( ) ).

Expand Down
30 changes: 24 additions & 6 deletions src/01/z2ui5_cl_demo_app_lp_04.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,46 @@ CLASS z2ui5_cl_demo_app_lp_04 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA view TYPE REF TO z2ui5_cl_xml_view.
view = z2ui5_cl_xml_view=>factory( ).
product_url = z2ui5_cl_util=>url_param_get(
val = `product`
url = client->get( )-s_config-search ).
check_launchpad_active = client->get( )-check_launchpad_active.

data(lt_params) = client->get( )-t_comp_params.
DATA lt_params TYPE z2ui5_if_types=>ty_t_name_value.
lt_params = client->get( )-t_comp_params.
try.
product = lt_params[ n = `PRODUCT` ]-v.
DATA temp1 LIKE LINE OF lt_params.
DATA temp2 LIKE sy-tabix.
temp2 = sy-tabix.
READ TABLE lt_params WITH KEY n = `PRODUCT` INTO temp1.
sy-tabix = temp2.
IF sy-subrc <> 0.
ASSERT 1 = 0.
ENDIF.
product = temp1-v.
catch cx_root.
endtry.
IF check_initialized = abap_false.
check_initialized = abap_true.

quantity = '500'.

DATA temp3 TYPE string_table.
CLEAR temp3.
INSERT `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_03", action: "display" }` INTO TABLE temp3.
INSERT `{ ProductID : "123234" }` INTO TABLE temp3.
DATA temp4 TYPE xsdboolean.
temp4 = boolc( abap_false = client->get( )-check_launchpad_active ).
DATA temp5 TYPE xsdboolean.
temp5 = boolc( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ).
client->view_display( view->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
showheader = temp4
title = 'abap2UI5 - Cross App Navigation App 128'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
shownavbutton = temp5
)->header_content(
)->link(
text = 'Source_Code'
Expand All @@ -62,7 +80,7 @@ CLASS z2ui5_cl_demo_app_lp_04 IMPLEMENTATION.
text = 'go to app 127'
press = client->_event_client(
val = client->cs_event-cross_app_nav_to_ext
t_arg = VALUE #( ( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_03", action: "display" }` ) ( `{ ProductID : "123234" }`) )
t_arg = temp3
)
)->stringify( ) ).

Expand Down
Loading

0 comments on commit 6a27dcf

Please sign in to comment.