Skip to content

Commit 3f6fbf6

Browse files
committed
Fix remaining METHOD indentation issues across documentation
- Fixed 20 METHOD declarations to have 2 spaces indentation - Updated code snippets in 8 documentation files - Also fixed code group label capitalization: LCL_HELP→lcl_help - Ensures consistent ABAP code formatting throughout documentation Files updated: - docs/development/events.md (3 methods) - docs/development/messages.md (9 methods) - docs/development/model/odata.md (1 method) - docs/development/specific/barcodes.md (1 method) - docs/development/specific/cds.md (1 method) - docs/development/specific/files.md (1 method) - docs/development/specific/xlsx.md (1 method) - docs/development/translation.md (3 methods + label fix)
1 parent b898c86 commit 3f6fbf6

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

docs/development/events.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ You can trigger backend processing when an event occurs using the `client->_even
1212
As an example, we will use the `press` property of a button. To trigger events in the backend, assign the result of `client->_event(`MY_EVENT_NAME`)` to the relevant UI5 control property. Once triggered, the backend can retrieve the event details with `client->get( )-event`.
1313

1414
```abap
15-
METHOD z2ui5_if_app~main.
16-
15+
METHOD z2ui5_if_app~main.
16+
1717
client->view_display( z2ui5_cl_xml_view=>factory(
1818
)->button(
1919
text = `post`
@@ -32,8 +32,8 @@ If the backend needs additional information about the specific event, use parame
3232
#### Source
3333
Send properties of the event source control to the backend:
3434
```abap
35-
METHOD z2ui5_if_app~main.
36-
35+
METHOD z2ui5_if_app~main.
36+
3737
client->view_display( z2ui5_cl_xml_view=>factory(
3838
)->button( text = `post` press = client->_event(
3939
val = `BUTTON_POST`
@@ -51,8 +51,8 @@ ENDMETHOD.
5151
#### Parameters
5252
Retrieve parameters of the event:
5353
```abap
54-
METHOD z2ui5_if_app~main.
55-
54+
METHOD z2ui5_if_app~main.
55+
5656
client->view_display( z2ui5_cl_xml_view=>factory(
5757
)->button( text = `post` id = `button_id` press = client->_event(
5858
val = `BUTTON_POST`
@@ -71,8 +71,8 @@ ENDMETHOD.
7171
#### Event
7272
Retrieve specific properties of the event:
7373
```abap
74-
METHOD z2ui5_if_app~main.
75-
74+
METHOD z2ui5_if_app~main.
75+
7676
client->view_display( z2ui5_cl_xml_view=>factory(
7777
)->button( text = `post` press = client->_event(
7878
val = `BUTTON_POST`
@@ -102,8 +102,8 @@ CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC CREATE PUBLIC.
102102
103103
ENDCLASS.
104104
105-
METHOD z2ui5_if_app~main.
106-
105+
METHOD z2ui5_if_app~main.
106+
107107
client->view_display( z2ui5_cl_xml_view=>factory(
108108
)->input( client->_bind_edit( name )
109109
)->button( text = `post` press = client->_event(
@@ -144,8 +144,8 @@ If you don't want to process the event in the backend, you can also directly tri
144144
```
145145
For example, to open a new tab with the corresponding event:
146146
```abap
147-
METHOD z2ui5_if_app~main.
148-
147+
METHOD z2ui5_if_app~main.
148+
149149
client->view_display( z2ui5_cl_xml_view=>factory(
150150
)->button(
151151
text = `post`
@@ -160,7 +160,7 @@ ENDMETHOD.
160160
### Follow Up Action
161161
Sometimes, you might want to first call a backend function and then immediately perform an action in the frontend. This is possible with the follow-up action event:
162162
```abap
163-
METHOD z2ui5_if_app~main.
163+
METHOD z2ui5_if_app~main.
164164
165165
client->follow_up_action( client->_event_client(
166166
val = client->cs_event-open_new_tab

docs/development/messages.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Displaying messages and errors is an everyday requirement for ABAP developers. T
1111
For short-duration messages, such as success notifications, you can use the message toast:
1212

1313
```abap
14-
METHOD z2ui5_if_app~main.
14+
METHOD z2ui5_if_app~main.
1515
1616
client->message_toast_display( `this is a message` ).
1717
@@ -23,7 +23,7 @@ ENDMETHOD.
2323
Want the user to acknowledge the message? You can display a message box that requires manual closure:
2424

2525
```abap
26-
METHOD z2ui5_if_app~main.
26+
METHOD z2ui5_if_app~main.
2727
2828
client->message_box_display( `this is a message` ).
2929
@@ -33,7 +33,7 @@ ENDMETHOD.
3333
For error messages, simply change the type:
3434

3535
```abap
36-
METHOD z2ui5_if_app~main.
36+
METHOD z2ui5_if_app~main.
3737
3838
client->message_box_display(
3939
text = `This is an error message`
@@ -46,16 +46,16 @@ ENDMETHOD.
4646
You can directly pass common message structures, objects, and variables to the functions:
4747
###### SY
4848
```abap
49-
METHOD z2ui5_if_app~main.
50-
49+
METHOD z2ui5_if_app~main.
50+
5151
MESSAGE ID `NET` TYPE `I` NUMBER `001` INTO DATA(lv_dummy).
5252
client->message_box_display( sy ).
5353
5454
ENDMETHOD.
5555
```
5656
###### BAPIRET
5757
```abap
58-
METHOD z2ui5_if_app~main.
58+
METHOD z2ui5_if_app~main.
5959
6060
DATA lt_bapiret TYPE STANDARD TABLE OF bapiret2.
6161
CALL FUNCTION `BAPI_USER_GET_DETAIL`
@@ -71,7 +71,7 @@ ENDMETHOD.
7171
```
7272
###### CX_ROOT
7373
```abap
74-
METHOD z2ui5_if_app~main.
74+
METHOD z2ui5_if_app~main.
7575
7676
TRY.
7777
DATA(lv_val) = 1 / 0.
@@ -83,10 +83,10 @@ ENDMETHOD.
8383
```
8484
Other imports are supported as well. Just import your message structure, and the message box will display it.
8585

86-
#### Popup Multi Message
86+
#### Popup Multi Message
8787
The message box provides basic output. For a more detailed output, use the popup `z2ui5_cl_pop_messages`:
8888
```abap
89-
METHOD z2ui5_if_app~main.
89+
METHOD z2ui5_if_app~main.
9090
9191
DATA(lt_msg) = VALUE bapirettab(
9292
( type = `E` id = `MSG1` number = `001` message = `An empty Report field causes an empty XML Message to be sent` )
@@ -99,7 +99,7 @@ ENDMETHOD.
9999
#### Popup Error
100100
To show a detailed view of your exception, use the following code:
101101
```abap
102-
METHOD z2ui5_if_app~main.
102+
METHOD z2ui5_if_app~main.
103103
104104
TRY.
105105
DATA(lv_val) = 1 / 0.
@@ -113,15 +113,15 @@ ENDMETHOD.
113113
#### Uncaught Errors
114114
What happens if errors are uncaught? In this case, the default HTTP handler exception output is used. The processing is interrupted, and the user will need to refresh the browser. Use this only for unexpected behavior:
115115
```abap
116-
METHOD z2ui5_if_app~main.
116+
METHOD z2ui5_if_app~main.
117117
118118
ASSERT 1 = `This is an error message!`.
119119
120120
ENDMETHOD.
121121
```
122122
Alternatively, achieve the same behavior with an uncaught exception:
123123
```abap
124-
METHOD z2ui5_if_app~main.
124+
METHOD z2ui5_if_app~main.
125125
126126
RAISE EXCEPTION NEW cx_sy_itab_line_not_found( ).
127127

docs/development/model/odata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ tab->items( )->column_list_item( )->cells(
3636
By using the growing property we can make use of the feature that not all data is loaded at once, leveraging performance.
3737

3838
#### Full Example
39-
Heres the complete source code:
39+
Here's the complete source code:
4040
```abap
41-
METHOD z2ui5_if_app~main.
42-
41+
METHOD z2ui5_if_app~main.
42+
4343
DATA(tab) = z2ui5_cl_xml_view=>factory( )->page( )->table(
4444
items = `{FLIGHT>/Airport}`
4545
growing = abap_true ).

docs/development/specific/barcodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This section provides all the information you need to get started easily.
1616
Since UI5 version 1.102, the `sap.ndc.BarcodeScannerButton` control is part of the UI5 library, making barcode scanning simple and straightforward. You can use the barcode scanner control like any other UI5 control with abap2UI5. Below is an example demonstrating basic functionality. You can customize the handling after the scanning event is triggered:
1717

1818
```abap
19-
METHOD z2ui5_if_app~main.
19+
METHOD z2ui5_if_app~main.
2020
2121
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
2222
)->page(

docs/development/specific/cds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ENDCLASS.
8787
The following example demonstrates how to create a sales order using `MODIFY` in an abap2UI5 application:
8888

8989
```abap
90-
METHOD z2ui5_if_app~main.
90+
METHOD z2ui5_if_app~main.
9191
9292
MODIFY ENTITIES OF i_salesordertp
9393
ENTITY salesorder

docs/development/specific/files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ENDCLASS.
4242
#### Download
4343
See also `Z2UI5_CL_DEMO_APP_186`
4444
```abap
45-
METHOD z2ui5_if_app~main.
45+
METHOD z2ui5_if_app~main.
4646
4747
client->view_display( z2ui5_cl_xml_view=>factory(
4848
)->page(

docs/development/specific/xlsx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Instead of using the above XLSX API (which may change between releases), conside
183183
::: code-group
184184

185185
```abap
186-
METHOD z2ui5_if_app~main.
186+
METHOD z2ui5_if_app~main.
187187
188188
client->view_display( z2ui5_cl_xml_view=>factory(
189189
)->page(

docs/development/translation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In UI5 apps, translations are typically managed through i18n files, with transla
88
### Text Element
99
Messages can be translated using the ABAP text elements, making them available in different languages without changing the code:
1010
```abap
11-
METHOD z2ui5_if_app~main.
11+
METHOD z2ui5_if_app~main.
1212
1313
DATA(lv_msg_translated) = `this is a translatable message in english`(001).
1414
client->message_box_display( lv_msg_translated ).
@@ -19,7 +19,7 @@ ENDMETHOD.
1919
### Messages
2020
Messages are translated using message classes, ensuring that translations are managed centrally and can be maintained easily in different languages:
2121
```abap
22-
METHOD z2ui5_if_app~main.
22+
METHOD z2ui5_if_app~main.
2323
2424
MESSAGE ID `NET` TYPE `I` NUMBER `001` INTO DATA(lv_msg_translated).
2525
client->message_box_display( lv_msg_translated ).
@@ -33,15 +33,15 @@ You can also retrieve and display the short, medium, or long descriptions of dat
3333
::: code-group
3434

3535
```abap
36-
METHOD z2ui5_if_app~main.
36+
METHOD z2ui5_if_app~main.
3737
3838
DATA(ls_product_label) = lcl_help=>get_data_element_text( `PRODUCT` ).
3939
client->message_box_display( |{ ls_product_label-short }: 100 | ).
4040
4141
ENDMETHOD.
4242
```
4343

44-
```abap [LCL_HELP]
44+
```abap [lcl_help]
4545
CLASS lcl_help DEFINITION
4646
CREATE PUBLIC.
4747

0 commit comments

Comments
 (0)