Skip to content

Commit e6d3896

Browse files
committed
Replace old string syntax ('...') with modern pipe syntax (|...|) in ABAP code snippets
Updated all abap2UI5 code examples throughout the documentation to use the modern ABAP string literal syntax with pipe delimiters |...| instead of the legacy single quote syntax '...'. This affects: - Event handling (WHEN statements, client->_event() calls) - String literals in method parameters - View definitions - Message and error handling - Data initialization 16 files modified with consistent string delimiter updates.
1 parent 43f1f48 commit e6d3896

File tree

16 files changed

+86
-86
lines changed

16 files changed

+86
-86
lines changed

docs/advanced/extensibility/custom_js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ METHOD z2ui5_if_app~main.
1818
)->_cc_plain_xml(
1919
|function myFunction() \{ console.log( `Hello World` ); \}|
2020
).
21-
view->page(
21+
view->page(
2222
)->button( text = `call custom JS`
23-
press = client->_event( 'CUSTOM_JS' ) ).
23+
press = client->_event( |CUSTOM_JS| ) ).
2424
client->view_display( view->stringify( ) ).
2525
ENDIF.
2626
27-
IF client->get( )-event = 'CUSTOM_JS'.
27+
IF client->get( )-event = |CUSTOM_JS|.
2828
client->follow_up_action( `myFunction()` ).
2929
ENDIF.
3030

docs/development/events.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ METHOD z2ui5_if_app~main.
1616
1717
client->view_display( z2ui5_cl_xml_view=>factory(
1818
)->button(
19-
text = 'post'
20-
press = client->_event( 'BUTTON_POST' )
19+
text = |post|
20+
press = client->_event( |BUTTON_POST| )
2121
)->stringify( ) ).
2222
2323
CASE client->get( )-event.
24-
WHEN 'BUTTON_POST'.
24+
WHEN |BUTTON_POST|.
2525
client->message_box_display( |Your name is { name }| ).
2626
ENDCASE.
2727
@@ -41,7 +41,7 @@ METHOD z2ui5_if_app~main.
4141
)->stringify( ) ).
4242
4343
CASE client->get( )-event.
44-
WHEN 'BUTTON_POST'.
44+
WHEN |BUTTON_POST|.
4545
client->message_box_display( |The button text is { client->get_event_arg( ) }| ).
4646
ENDCASE.
4747
@@ -60,7 +60,7 @@ METHOD z2ui5_if_app~main.
6060
)->stringify( ) ).
6161
6262
CASE client->get( )-event.
63-
WHEN 'BUTTON_POST'.
63+
WHEN |BUTTON_POST|.
6464
"mainView--button_id
6565
client->message_box_display( |The button id is { client->get_event_arg( ) }| ).
6666
ENDCASE.
@@ -80,7 +80,7 @@ METHOD z2ui5_if_app~main.
8080
)->stringify( ) ).
8181
8282
CASE client->get( )-event.
83-
WHEN 'BUTTON_POST'.
83+
WHEN |BUTTON_POST|.
8484
"press
8585
client->message_box_display( |The evend id is { client->get_event_arg( ) }| ).
8686
ENDCASE.
@@ -112,7 +112,7 @@ METHOD z2ui5_if_app~main.
112112
)->stringify( ) ).
113113
114114
CASE client->get( )-event.
115-
WHEN 'BUTTON_POST'.
115+
WHEN |BUTTON_POST|.
116116
client->message_box_display( |The name is { client->get_event_arg( ) }| ).
117117
ENDCASE.
118118

docs/development/general.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ CLASS z2ui5_cl_app IMPLEMENTATION.
3131
3232
"handle events after frontend
3333
CASE client->get( )-event.
34-
WHEN 'OK'.
34+
WHEN |OK|.
3535
DATA(lt_arg) = client->get_event_arg( ).
3636
"event handling
37-
WHEN 'CANCEL'.
37+
WHEN |CANCEL|.
3838
"...
3939
ENDCASE.
4040

docs/development/messages.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ For error messages, simply change the type:
3535
```abap
3636
METHOD z2ui5_if_app~main.
3737
38-
client->message_box_display(
39-
text = 'This is an error message'
40-
type = 'error' ).
38+
client->message_box_display(
39+
text = |This is an error message|
40+
type = |error| ).
4141
4242
ENDMETHOD.
4343
```
@@ -89,8 +89,8 @@ The message box provides basic output. For a more detailed output, use the popup
8989
METHOD z2ui5_if_app~main.
9090
9191
data(lt_msg) = value bapirettab(
92-
( type = 'E' id = 'MSG1' number = '001' message = 'An empty Report field causes an empty XML Message to be sent' )
93-
( type = 'I' id = 'MSG2' number = '002' message = 'Product already in use' ) ).
92+
( type = |E| id = |MSG1| number = |001| message = |An empty Report field causes an empty XML Message to be sent| )
93+
( type = |I| id = |MSG2| number = |002| message = |Product already in use| ) ).
9494
9595
client->nav_app_call( z2ui5_cl_pop_messages=>factory( lt_msg ) ).
9696

docs/development/model/model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
2121
METHOD z2ui5_if_app~main.
2222
2323
client->view_display( z2ui5_cl_xml_view=>factory(
24-
)->page( 'abap2UI5 - Hello World'
24+
)->page( |abap2UI5 - Hello World|
2525
)->text( `My Text`
2626
)->text( client->_bind( name )
2727
)->stringify( ) ).
@@ -47,14 +47,14 @@ CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
4747
METHOD z2ui5_if_app~main.
4848
4949
client->view_display( z2ui5_cl_xml_view=>factory(
50-
)->page( 'abap2UI5 - Hello World'
50+
)->page( |abap2UI5 - Hello World|
5151
)->text( `Enter your name`
5252
)->input( client->_bind_edit( name )
53-
)->button( text = 'post' press = client->_event( 'POST' )
53+
)->button( text = |post| press = client->_event( |POST| )
5454
)->stringify( ) ).
5555
5656
CASE client->get( )-event.
57-
WHEN 'POST'.
57+
WHEN |POST|.
5858
client->message_box_display( |Your name is { name }.| ).
5959
RETURN.
6060
ENDCASE.

docs/development/navigation/app_state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ CLASS z2ui5_cl_sample_app_state IMPLEMENTATION.
2626
view->label( 'quantity'
2727
)->input( client->_bind_edit( mv_quantity )
2828
)->button(
29-
text = 'post with state'
30-
press = client->_event( val = 'BUTTON_POST' )
29+
text = |post with state|
30+
press = client->_event( val = |BUTTON_POST| )
3131
)->stringify( ) ).
3232
ENDIF.
3333

docs/development/navigation/share.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ CLASS z2ui5_cl_sample_share IMPLEMENTATION.
2222
)->label( 'quantity'
2323
)->input( client->_bind_edit( mv_quantity )
2424
)->button(
25-
text = 'share'
26-
press = client->_event( val = 'BUTTON_POST' )
25+
text = |share|
26+
press = client->_event( val = |BUTTON_POST| )
2727
)->stringify( ) ).
2828
ENDIF.
2929

docs/development/popups.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ To display a popup, use the method `client->popup_display` instead of `client->v
1414
METHOD z2ui5_if_app~main.
1515
1616
DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
17-
)->dialog( 'Popup - Info'
18-
)->text( 'this is an information shown in a popup' ).
17+
)->dialog( |Popup - Info|
18+
)->text( |this is an information shown in a popup| ).
1919
client->popup_display( lo_popup->stringify( ) ).
2020
2121
ENDMETHOD.
@@ -28,26 +28,26 @@ METHOD Z2UI5_if_app~main.
2828
2929
IF client->check_on_init( ).
3030
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
31-
)->page( 'abap2UI5 - Popups'
31+
)->page( |abap2UI5 - Popups|
3232
)->button(
33-
text = 'popup rendering, no background rendering'
34-
press = client->_event( 'POPUP_OPEN' ) ).
33+
text = |popup rendering, no background rendering|
34+
press = client->_event( |POPUP_OPEN| ) ).
3535
client->view_display( lo_view->stringify( ) ).
3636
3737
ENDIF.
3838
3939
CASE client->get( )-event.
4040
41-
WHEN 'POPUP_OPEN'.
42-
DATA(lo_popup) = Z2UI5_cl_xml_view=>factory_popup(
43-
)->dialog( 'Popup'
44-
)->text( 'this is a text in a popup'
41+
WHEN |POPUP_OPEN|.
42+
DATA(lo_popup) = Z2UI5_cl_xml_view=>factory_popup(
43+
)->dialog( |Popup|
44+
)->text( |this is a text in a popup|
4545
)->button(
46-
text = 'close'
47-
press = client->_event( 'POPUP_CLOSE' ) ).
46+
text = |close|
47+
press = client->_event( |POPUP_CLOSE| ) ).
4848
client->popup_display( lo_popup->stringify( ) ).
4949
50-
WHEN 'POPUP_CLOSE'.
50+
WHEN |POPUP_CLOSE|.
5151
client->popup_destroy( ).
5252
5353
ENDCASE.
@@ -84,22 +84,22 @@ To display a popover, use the method `client->popover_display` and specify the I
8484
METHOD Z2UI5_if_app~main.
8585
8686
IF client->check_on_init( ).
87-
DATA(view) = z2ui5_cl_xml_view=>factory(
87+
DATA(view) = z2ui5_cl_xml_view=>factory(
8888
)->shell(
89-
)->page( 'Popover Example'
89+
)->page( |Popover Example|
9090
)->button(
91-
text = 'display popover'
92-
press = client->_event( 'POPOVER_OPEN' )
93-
id = 'TEST' ).
91+
text = |display popover|
92+
press = client->_event( |POPOVER_OPEN| )
93+
id = |TEST| ).
9494
client->view_display( view->stringify( ) ).
9595
9696
ENDIF.
9797
9898
CASE client->get( )-event.
9999
100-
WHEN 'POPOVER_OPEN'.
100+
WHEN |POPOVER_OPEN|.
101101
DATA(popover) = Z2UI5_cl_xml_view=>factory_popup(
102-
)->popover( placement = 'Left'
102+
)->popover( placement = |Left|
103103
)->text( `this is a popover`
104104
)->button(
105105
id = `my_id`
@@ -109,7 +109,7 @@ METHOD Z2UI5_if_app~main.
109109
xml = view->stringify( )
110110
by_id = `my_id` ).
111111
112-
WHEN 'POPOVER_CLOSE'.
112+
WHEN |POPOVER_CLOSE|.
113113
client->popover_destroy( ).
114114
ENDCASE.
115115

docs/development/specific/barcodes.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ METHOD z2ui5_if_app~main.
2222
)->page(
2323
)->barcode_scanner_button(
2424
dialogtitle = `Barcode Scanner`
25-
scansuccess = client->_event(
26-
val = 'SCAN_SUCCESS'
25+
scansuccess = client->_event(
26+
val = |SCAN_SUCCESS|
2727
t_arg = VALUE #(
2828
( `${$parameters>/text}` )
2929
( `${$parameters>/format}` ) ) ) ).
3030
3131
client->view_display( lo_view->stringify( ) ).
3232
33-
IF client->get( )-event = 'SCAN_SUCCESS'.
33+
IF client->get( )-event = |SCAN_SUCCESS|.
3434
3535
DATA(lv_input) = client->get_event_arg( 1 ).
3636
DATA(lv_format) = client->get_event_arg( 2 ).
@@ -75,23 +75,23 @@ CLASS z2ui5_cl_sample_focus IMPLEMENTATION.
7575
)->input(
7676
id = 'id1'
7777
value = client->_bind_edit( one )
78-
submit = client->_event( 'one_enter' )
78+
submit = client->_event( |one_enter| )
7979
)->label( 'Two'
8080
)->input(
8181
id = 'id2'
8282
value = client->_bind_edit( two )
83-
submit = client->_event( 'two_enter' ) ).
83+
submit = client->_event( |two_enter| ) ).
8484
8585
page->_z2ui5( )->focus( client->_bind( focus_id ) ).
8686
client->view_display( page->stringify( ) ).
8787
8888
ENDIF.
8989
9090
CASE client->get( )-event.
91-
WHEN 'one_enter'.
91+
WHEN |one_enter|.
9292
focus_id = 'id2'.
9393
client->view_model_update( ).
94-
WHEN 'two_enter'.
94+
WHEN |two_enter|.
9595
focus_id = 'id1'.
9696
client->view_model_update( ).
9797
ENDCASE.
@@ -128,17 +128,17 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
128128
value = client->_bind_edit( company_code )
129129
type = `Number`
130130
placeholder = `Company Code`
131-
submit = client->_event( 'CUSTOM_JS_FROM_EB' ) ).
131+
submit = client->_event( |CUSTOM_JS_FROM_EB| ) ).
132132
vbox->button( text = `call custom JS from EB`
133-
press = client->_event( 'CUSTOM_JS_FROM_EB' ) ).
133+
press = client->_event( |CUSTOM_JS_FROM_EB| ) ).
134134
135135
client->view_display( view->stringify( ) ).
136136
ENDIF.
137137
138-
IF client->get( )-event = 'CUSTOM_JS_FROM_EB'.
138+
IF client->get( )-event = |CUSTOM_JS_FROM_EB|.
139139
IF company_code IS INITIAL.
140140
client->follow_up_action( val = `playSound()` ).
141-
client->message_box_display( type = 'error' text = 'Input is empty!' ).
141+
client->message_box_display( type = |error| text = |Input is empty!| ).
142142
ELSE.
143143
CLEAR company_code.
144144
ENDIF.

docs/development/specific/camera.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ CLASS z2ui5_cl_demo_app_306 IMPLEMENTATION.
1818
METHOD z2ui5_if_app~main.
1919
2020
IF client->check_on_init( ).
21-
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page( 'abap2UI5 - Device Camera Picture'
21+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page( |abap2UI5 - Device Camera Picture|
2222
)->_z2ui5( )->camera_picture(
2323
value = client->_bind_edit( mv_picture_base )
24-
onphoto = client->_event( 'CAPTURE' ) ).
24+
onphoto = client->_event( |CAPTURE| ) ).
2525
client->view_display( page->stringify( ) ).
2626
ENDIF.
2727

0 commit comments

Comments
 (0)