Skip to content

Commit e55010d

Browse files
committed
Standardize ABAP code samples across documentation
- CLASS DEFINITION: standardize to `DEFINITION PUBLIC.` everywhere, removing redundant `FINAL CREATE PUBLIC` and `CREATE PUBLIC` - View builder variables: use short names (`view`, `page`, `tab`, `popup`, `columns`, `cells`) instead of `lo_view`, `lo_popup`, `lo_col`, `lo_cell`, `lo_columns`, `lo_cells` - Remove empty PROTECTED/PRIVATE SECTION from formatter.md - Fix inconsistent indentation in formatter.md second simple_form - Keep Hungarian notation (lo_, lv_, lt_) for actual object/value variables (lo_log, lo_app, lv_url etc.) 18 files updated across development, configuration, advanced, and technical sections. https://claude.ai/code/session_0165sq6V21ktTSAhKUW4r74K
1 parent 1a3c9d3 commit e55010d

18 files changed

Lines changed: 61 additions & 78 deletions

File tree

docs/advanced/extensibility/user_exits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abap2UI5 contains predefined user exits which can be used to modify the standard
55
The following example changes the title, theme and the time drafts are saved in the backend:
66

77
```abap
8-
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC FINAL CREATE PUBLIC.
8+
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
99
1010
PUBLIC SECTION.
1111
INTERFACES z2ui5_if_exit.

docs/configuration/authorization.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ One of the easiest ways to manage access to different apps is by implementing ch
1111
##### Example: Restricting Access Based on URL Parameters
1212
In this example, we use the ICF handler class to control which apps can be accessed based on the APP_START parameter in the HTTP request. If an unauthorized app is requested, access is denied.
1313
```abap
14-
CLASS z2ui5_cl_launchpad_handler DEFINITION
15-
PUBLIC
16-
FINAL
17-
CREATE PUBLIC .
14+
CLASS z2ui5_cl_launchpad_handler DEFINITION PUBLIC.
1815
1916
PUBLIC SECTION.
2017
INTERFACES if_http_extension.
2118
22-
PROTECTED SECTION.
23-
PRIVATE SECTION.
2419
ENDCLASS.
2520
2621
CLASS z2ui5_cl_launchpad_handler IMPLEMENTATION.

docs/configuration/launchpad.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ ENDINTERFACE.
7474
```
7575
(2/3) Which can be used on app level to return KPIs:
7676
```abap
77-
CLASS z2ui5_cl_lp_kpi_hello_world DEFINITION
78-
PUBLIC
79-
FINAL
80-
CREATE PUBLIC .
77+
CLASS z2ui5_cl_lp_kpi_hello_world DEFINITION PUBLIC.
8178
8279
PUBLIC SECTION.
8380
INTERFACES z2ui5_if_lp_kpi.

docs/configuration/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ outline: [2, 4]
77
You can run abap2UI5 with various custom configurations. The default setup is used automatically. For custom configurations, just implement the interface `z2ui5_if_exit`:
88

99
```abap
10-
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC FINAL CREATE PUBLIC.
10+
CLASS zcl_a2ui5_user_exit DEFINITION PUBLIC.
1111
1212
PUBLIC SECTION.
1313
INTERFACES z2ui5_if_exit.

docs/development/events.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ You can access any object attribute, but make sure you access only public and re
9494
#### Model Properties
9595
Retrieve model properties associated with the event:
9696
```abap
97-
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC CREATE PUBLIC.
97+
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
9898
9999
PUBLIC SECTION.
100100
INTERFACES z2ui5_if_app.
@@ -103,8 +103,7 @@ CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC CREATE PUBLIC.
103103
ENDCLASS.
104104
105105
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
106-
107-
METHOD z2ui5_if_app~main.
106+
METHOD z2ui5_if_app~main.
108107
109108
client->view_display( z2ui5_cl_xml_view=>factory(
110109
)->input( client->_bind_edit( name )

docs/development/model/device.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Explore all available parameters in the [UI5 Documentation.](https://sapui5.hana
1616
### Backend
1717
You can also retrieve detailed device information on the backend using a custom info frontend control. This allows you to access UI5 version, device type, OS, browser details, and screen dimensions. Below is an example implementation, which demonstrates how to collect and use this information:
1818
```abap
19-
CLASS z2ui5_cl_sample_device DEFINITION PUBLIC CREATE PUBLIC.
19+
CLASS z2ui5_cl_sample_device DEFINITION PUBLIC.
2020
2121
PUBLIC SECTION.
2222
INTERFACES z2ui5_if_app.
@@ -41,8 +41,8 @@ CLASS z2ui5_cl_sample_device IMPLEMENTATION.
4141
4242
METHOD z2ui5_if_app~main.
4343
44-
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
45-
)->page( )->_z2ui5(
44+
DATA(view) = z2ui5_cl_xml_view=>factory(
45+
)->page( )->_z2ui5(
4646
)->info_frontend(
4747
finished = client->_event( `POST` )
4848
device_browser = client->_bind_edit( device_browser )
@@ -58,7 +58,7 @@ CLASS z2ui5_cl_sample_device IMPLEMENTATION.
5858
device_height = client->_bind_edit( device_height )
5959
device_width = client->_bind_edit( device_width ) ).
6060
61-
client->view_display( lo_view->stringify( ) ).
61+
client->view_display( view->stringify( ) ).
6262
6363
IF client->get( )-event = `POST`.
6464
"process device info here...

docs/development/model/tables.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Making a table editable is a simple change. You just need to switch the binding
7474
### Tree
7575
To work with trees, you need to use nested structures. Here is an example:
7676
```abap
77-
CLASS z2ui5_cl_sample_tree DEFINITION PUBLIC CREATE PUBLIC.
77+
CLASS z2ui5_cl_sample_tree DEFINITION PUBLIC.
7878
7979
PUBLIC SECTION.
8080
INTERFACES z2ui5_if_app.
@@ -169,15 +169,15 @@ CLASS z2ui5_cl_sample_nested_structures IMPLEMENTATION.
169169
170170
DATA(tab) = z2ui5_cl_xml_view=>factory( )->table( client->_bind( mt_itab ) ).
171171
172-
DATA(lo_columns) = tab->columns( ).
173-
lo_columns->column( )->text( text = `Product` ).
174-
lo_columns->column( )->text( text = `Created at` ).
175-
lo_columns->column( )->text( text = `By` ).
172+
DATA(columns) = tab->columns( ).
173+
columns->column( )->text( text = `Product` ).
174+
columns->column( )->text( text = `Created at` ).
175+
columns->column( )->text( text = `By` ).
176176
177-
DATA(lo_cells) = tab->items( )->column_list_item( ).
178-
lo_cells->text( `{PRODUCT}` ).
179-
lo_cells->text( `{S_DETAILS/CREATE_DATE}` ).
180-
lo_cells->text( `{S_DETAILS/CREATE_BY}` ).
177+
DATA(cells) = tab->items( )->column_list_item( ).
178+
cells->text( `{PRODUCT}` ).
179+
cells->text( `{S_DETAILS/CREATE_DATE}` ).
180+
cells->text( `{S_DETAILS/CREATE_BY}` ).
181181
182182
client->view_display( tab->stringify( ) ).
183183

docs/development/navigation/app_state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Each state is saved as a draft with a unique ID, you can display this ID in the
99
### Sample Code
1010
Below is an implementation of the app state functionality:
1111
```abap
12-
CLASS z2ui5_cl_sample_app_state DEFINITION PUBLIC FINAL CREATE PUBLIC.
12+
CLASS z2ui5_cl_sample_app_state DEFINITION PUBLIC.
1313
1414
PUBLIC SECTION.
1515
INTERFACES z2ui5_if_app.

docs/development/navigation/share.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The app state feature opens up several useful scenarios, such as sharing and boo
55
### Share
66
You can easily integrate a share button, which copies the actual state into the clipboard for sharing with your colleagues. Check out the following snippet:
77
```abap
8-
CLASS z2ui5_cl_sample_share DEFINITION PUBLIC FINAL CREATE PUBLIC.
8+
CLASS z2ui5_cl_sample_share DEFINITION PUBLIC.
99
1010
PUBLIC SECTION.
1111
INTERFACES z2ui5_if_app.

docs/development/popups.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ To display a popup, use the method `client->popup_display` instead of `client->v
1313
```abap
1414
METHOD z2ui5_if_app~main.
1515
16-
DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
16+
DATA(popup) = z2ui5_cl_xml_view=>factory_popup(
1717
)->dialog( `Popup - Info`
1818
)->text( `this is an information shown in a popup` ).
19-
client->popup_display( lo_popup->stringify( ) ).
19+
client->popup_display( popup->stringify( ) ).
2020
2121
ENDMETHOD.
2222
```
@@ -27,25 +27,25 @@ A common flow for using popups typically involves displaying a normal view, then
2727
METHOD z2ui5_if_app~main.
2828
2929
IF client->check_on_init( ).
30-
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
30+
DATA(view) = z2ui5_cl_xml_view=>factory(
3131
)->page( `abap2UI5 - Popups`
3232
)->button(
3333
text = `popup rendering, no background rendering`
3434
press = client->_event( `POPUP_OPEN` ) ).
35-
client->view_display( lo_view->stringify( ) ).
35+
client->view_display( view->stringify( ) ).
3636
3737
ENDIF.
3838
3939
CASE client->get( )-event.
4040
4141
WHEN `POPUP_OPEN`.
42-
DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
42+
DATA(popup) = z2ui5_cl_xml_view=>factory_popup(
4343
)->dialog( `Popup`
4444
)->text( `this is a text in a popup`
4545
)->button(
4646
text = `close`
4747
press = client->_event( `POPUP_CLOSE` ) ).
48-
client->popup_display( lo_popup->stringify( ) ).
48+
client->popup_display( popup->stringify( ) ).
4949
5050
WHEN `POPUP_CLOSE`.
5151
client->popup_destroy( ).
@@ -65,11 +65,11 @@ Check out the popup to confirm, for example:
6565
CASE abap_true.
6666
6767
WHEN client->check_on_init( ).
68-
DATA(lo_popup) = z2ui5_cl_pop_to_confirm=>factory(
68+
DATA(popup) = z2ui5_cl_pop_to_confirm=>factory(
6969
i_question_text = `Can you confirm this?`
7070
i_event_confirm = `CONFIRM`
7171
i_event_cancel = `CANCEL` ).
72-
client->nav_app_call( lo_popup ).
72+
client->nav_app_call( popup ).
7373
7474
WHEN client->check_on_event( `CONFIRM` ).
7575
client->message_box_display( `the result is confirmed` ).

0 commit comments

Comments
 (0)