Skip to content

Commit 4ac9da9

Browse files
authored
Merge pull request #35 from abap2UI5/claude/fix-string-delimiters-01PgDBDWnGZWUMAJgeUbnmbi
Fix indentation inconsistencies in ABAP code snippets
2 parents 9f1648d + 3f6fbf6 commit 4ac9da9

File tree

17 files changed

+151
-152
lines changed

17 files changed

+151
-152
lines changed

docs/advanced/extensibility/custom_js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The idea is to send the custom JavaScript function along with the view to the fr
1010
Below is a working example that you can use as a starting point:
1111

1212
```abap
13-
METHOD z2ui5_if_app~main.
13+
METHOD z2ui5_if_app~main.
1414
1515
IF client->check_on_init( ).
1616
DATA(view) = z2ui5_cl_xml_view=>factory( ).

docs/advanced/fiori.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ sap.ui.core.Component.create({
6565
```
6666

6767
5. Create ABAP2U5 app class
68-
```abap
69-
METHOD z2ui5_if_app~main.
68+
```abap
69+
METHOD z2ui5_if_app~main.
7070
7171
IF check_initialized = abap_false.
7272
check_initialized = abap_true.

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: 14 additions & 14 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-
51-
MESSAGE ID `NET` TYPE `I` NUMBER `001` into data(lv_dummy).
49+
METHOD z2ui5_if_app~main.
50+
51+
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,12 +83,12 @@ 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
91-
data(lt_msg) = value bapirettab(
91+
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` )
9393
( type = `I` id = `MSG2` number = `002` message = `Product already in use` ) ).
9494
@@ -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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ As an example, we will use the test OData service `/sap/opu/odata/DMO/UI_FLIGHT_
1010
```abap
1111
client->follow_up_action( client->_event_client(
1212
val = z2ui5_if_client=>cs_event-set_odata_model
13-
t_arg = value #(
13+
t_arg = VALUE #(
1414
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
1515
( `FLIGHT` ) ) ) ).
1616
```
@@ -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 ).
@@ -60,7 +60,7 @@ METHOD z2ui5_if_app~main.
6060
6161
client->follow_up_action( client->_event_client(
6262
val = z2ui5_if_client=>cs_event-set_odata_model
63-
t_arg = value #(
63+
t_arg = VALUE #(
6464
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
6565
( `FLIGHT` ) ) ) ).
6666
@@ -90,7 +90,7 @@ client->view_display( tab->stringify( ) ).
9090
9191
client->follow_up_action( client->_event_client(
9292
val = z2ui5_if_client=>cs_event-set_odata_model
93-
t_arg = value #(
93+
t_arg = VALUE #(
9494
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
9595
( `TRAVEL` ) ) ) ).
9696
```
@@ -114,7 +114,7 @@ In SAP contexts, OData services are often enriched with additional annotations.
114114
We can use these SAP annotations in our UI5 view to utilize backend translations via the property `label`. Here’s an example:
115115
```abap
116116
117-
data(tab) = page->table(
117+
DATA(tab) = page->table(
118118
items = `{TRAVEL>/Currency}`
119119
growing = abap_true ).
120120
@@ -134,7 +134,7 @@ client->view_display( tab->stringify( ) ).
134134
135135
client->follow_up_action( client->_event_client(
136136
val = z2ui5_if_client=>cs_event-set_odata_model
137-
t_arg = value #(
137+
t_arg = VALUE #(
138138
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
139139
( `TRAVEL` ) ) ) ).
140140
```

docs/development/model/tables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CLASS z2ui5_cl_sample_tab IMPLEMENTATION.
2222
METHOD z2ui5_if_app~main.
2323
2424
DO 100 TIMES.
25-
INSERT value #(
25+
INSERT VALUE #(
2626
count = sy-index
2727
value = `red`
2828
descr = `this is a description` ) INTO TABLE mt_itab.
@@ -50,7 +50,7 @@ Making a table editable is a simple change. You just need to switch the binding
5050
METHOD z2ui5_if_app~main.
5151
5252
DO 100 TIMES.
53-
INSERT value #(
53+
INSERT VALUE #(
5454
count = sy-index
5555
value = `red`
5656
descr = `this is a description` ) INTO TABLE mt_itab.

docs/development/navigation/navigation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In abap2UI5, each application is represented by a single ABAP class. While you c
1010
#### Backend
1111
To call an ABAP class, use the following code:
1212
```abap
13-
METHOD z2ui5_if_app~main.
13+
METHOD z2ui5_if_app~main.
1414
1515
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
1616
client->nav_app_call( lo_app ).
@@ -19,15 +19,15 @@ ENDMETHOD.
1919
```
2020
The framework maintains a call stack. In the newly called class, you can return to the previous application using:
2121
```abap
22-
METHOD z2ui5_if_app~main.
22+
METHOD z2ui5_if_app~main.
2323
2424
client->nav_app_leave( ).
2525
2626
ENDMETHOD.
2727
```
2828
If you need to access data from the previous application, use casting as follows:
2929
```abap
30-
METHOD z2ui5_if_app~main.
30+
METHOD z2ui5_if_app~main.
3131
3232
IF client->check_on_navigated( ).
3333
DATA(lo_called_app) = CAST z2ui5_cl_new_app( client->get_app_prev( ) ).
@@ -38,7 +38,7 @@ ENDMETHOD.
3838
```
3939
To navigate to an application without adding it to the call stack, use:
4040
```abap
41-
METHOD z2ui5_if_app~main.
41+
METHOD z2ui5_if_app~main.
4242
4343
DATA(lo_app) = NEW z2ui5_cl_new_app( ).
4444
client->nav_app_leave( lo_app ).

0 commit comments

Comments
 (0)