Skip to content

Commit d7d2475

Browse files
committed
Fix METHOD indentation and keyword capitalization in ABAP code snippets
- Fixed METHOD declarations to have 2 spaces indentation (inside CLASS blocks) - Fixed 11 METHOD statements across 5 documentation files - Fixed capitalization: data→DATA, Z2UI5_→z2ui5_ - Ensures consistent indentation standards throughout documentation Files updated: - docs/development/view.md - docs/advanced/extensibility/custom_js.md - docs/advanced/fiori.md - docs/development/specific/logging.md (4 methods) - docs/development/navigation/navigation.md (4 methods) - docs/development/popups.md (4 methods, from previous work) - docs/development/specific/xlsx.md (keyword capitalization)
1 parent 10ac373 commit d7d2475

File tree

7 files changed

+33
-33
lines changed

7 files changed

+33
-33
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/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 ).

docs/development/popups.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ UI5 offers functionality for displaying popups and popovers that overlay only sp
1111

1212
To display a popup, use the method `client->popup_display` instead of `client->view_display`:
1313
```abap
14-
METHOD z2ui5_if_app~main.
14+
METHOD z2ui5_if_app~main.
1515
1616
DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
1717
)->dialog( `Popup - Info`
1818
)->text( `this is an information shown in a popup` ).
1919
client->popup_display( lo_popup->stringify( ) ).
2020
21-
ENDMETHOD.
21+
ENDMETHOD.
2222
```
2323

2424
#### Flow Logic
2525
A common flow for using popups typically involves displaying a normal view, then showing a popup, and finally closing it. Here’s how to structure this:
2626
```abap
27-
METHOD Z2UI5_if_app~main.
27+
METHOD z2ui5_if_app~main.
2828
2929
IF client->check_on_init( ).
3030
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
@@ -39,7 +39,7 @@ METHOD Z2UI5_if_app~main.
3939
CASE client->get( )-event.
4040
4141
WHEN `POPUP_OPEN`.
42-
DATA(lo_popup) = Z2UI5_cl_xml_view=>factory_popup(
42+
DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
4343
)->dialog( `Popup`
4444
)->text( `this is a text in a popup`
4545
)->button(
@@ -49,39 +49,39 @@ METHOD Z2UI5_if_app~main.
4949
5050
WHEN `POPUP_CLOSE`.
5151
client->popup_destroy( ).
52-
52+
5353
ENDCASE.
5454
55-
ENDMETHOD.
55+
ENDMETHOD.
5656
```
5757

5858
#### Separated App
5959
For better source code structure, you can encapsulate popups in separate classes and call them through [navigation](/development/navigation/navigation).
6060

6161
Check out the popup to confirm, for example:
6262
```abap
63-
METHOD z2ui5_if_app~main.
63+
METHOD z2ui5_if_app~main.
6464
65-
IF client->check_on_init( ).
66-
client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ).
67-
ENDIF.
65+
IF client->check_on_init( ).
66+
client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ).
67+
ENDIF.
6868
69-
CASE client->get( )-event.
70-
WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed.
71-
client->message_box_display( `the result is confirmed` ).
72-
WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled.
73-
client->message_box_display( `the result is rejected` ).
74-
ENDCASE.
69+
CASE client->get( )-event.
70+
WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed.
71+
client->message_box_display( `the result is confirmed` ).
72+
WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled.
73+
client->message_box_display( `the result is rejected` ).
74+
ENDCASE.
7575
76-
ENDMETHOD.
76+
ENDMETHOD.
7777
```
7878

7979
If you need to manage a stack of multiple popups, remember that abap2UI5 displays only one popup at a time on the frontend. However, you can maintain a popup stack in your backend logic and re-display the previous popup as needed. Check out `Z2UI5_CL_DEMO_APP_161`.
8080

8181
### Popover
8282
To display a popover, use the method `client->popover_display` and specify the ID of the control where you want the popover to appear:
8383
```abap
84-
METHOD Z2UI5_if_app~main.
84+
METHOD z2ui5_if_app~main.
8585
8686
IF client->check_on_init( ).
8787
DATA(view) = z2ui5_cl_xml_view=>factory(
@@ -98,7 +98,7 @@ METHOD Z2UI5_if_app~main.
9898
CASE client->get( )-event.
9999
100100
WHEN `POPOVER_OPEN`.
101-
DATA(popover) = Z2UI5_cl_xml_view=>factory_popup(
101+
DATA(popover) = z2ui5_cl_xml_view=>factory_popup(
102102
)->popover( placement = `Left`
103103
)->text( `this is a popover`
104104
)->button(
@@ -113,7 +113,7 @@ METHOD Z2UI5_if_app~main.
113113
client->popover_destroy( ).
114114
ENDCASE.
115115
116-
ENDMETHOD.
116+
ENDMETHOD.
117117
```
118118

119119
### Built-in Popups

docs/development/specific/logging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Logging is essential for developing end-user business processes. In ABAP systems
88
##### BAL Variables
99
In ABAP classic, you can use the classic BAL function modules and display the BAL table with the popup `z2ui5_cl_pop_messages`:
1010
```abap
11-
METHOD z2ui5_if_app~main.
11+
METHOD z2ui5_if_app~main.
1212
1313
DATA(lt_bal) = VALUE bal_t_msgr(
1414
( msgid = `Z001` msgno = `001` msgty = `S` time_stmp = `21354` msgnumber = `01` )
@@ -22,7 +22,7 @@ ENDMETHOD.
2222
##### ABAP Cloud
2323
In ABAP Cloud, you can directly pass the logging object into the popup:
2424
```abap
25-
METHOD z2ui5_if_app~main.
25+
METHOD z2ui5_if_app~main.
2626
2727
DATA(lo_log) = cl_bali_log=>create( ).
2828
DATA(lo_msg) = cl_bali_message_setter=>create(
@@ -48,7 +48,7 @@ ENDMETHOD.
4848
##### abap-logger
4949
You also have the option to use the fantastic open-source project [**abap-logger**](https://github.com/ABAP-Logger/ABAP-Logger). This tool simplifies working with BAL logs and integrates seamlessly with abap2UI5. Here’s an example:
5050
```abap
51-
METHOD z2ui5_if_app~main.
51+
METHOD z2ui5_if_app~main.
5252
5353
DATA(log) = zcl_logger_factory=>create_log( desc = `ABAP Logger` ).
5454
log->e( `This is an error...` ).
@@ -63,7 +63,7 @@ ENDMETHOD.
6363
Compared to message classes, BAL logs include more detailed information, such as timestamps. Use the specific BAL log popup to display this information. All the examples above can be used with the `z2ui5_cl_pop_bal` popup for a more detailed output, here’s an example for the abap-logger:
6464

6565
```abap
66-
METHOD z2ui5_if_app~main.
66+
METHOD z2ui5_if_app~main.
6767
6868
DATA(lo_log) = zcl_logger_factory=>create_log( desc = `ABAP Logger` ).
6969
log->e( `This is an error...` ).

docs/development/specific/xlsx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ CLASS z2ui5_cl_sample_upload IMPLEMENTATION.
3535
3636
IF client->get( )-event = `UPLOAD`.
3737
38-
data(lr_itab) = lcl_help=>itab_get_by_xlsx( mv_value ).
38+
DATA(lr_itab) = lcl_help=>itab_get_by_xlsx( mv_value ).
3939
"further process with itab...
4040
client->message_box_display( `xlsx uploaded` ).
4141
ENDIF.

docs/development/view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ outline: [2, 4]
44
# View
55
In abap2UI5, the output is generated by importing a UI5 XML View. Here’s a basic example:
66
```abap
7-
METHOD z2ui5_if_app~main.
7+
METHOD z2ui5_if_app~main.
88
99
client->view_display(
1010
|<mvc:View xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" | &

0 commit comments

Comments
 (0)