Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/advanced/extensibility/custom_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The idea is to send the custom JavaScript function along with the view to the fr
Below is a working example that you can use as a starting point:

```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

IF client->check_on_init( ).
DATA(view) = z2ui5_cl_xml_view=>factory( ).
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/fiori.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ sap.ui.core.Component.create({
```

5. Create ABAP2U5 app class
```abap
METHOD z2ui5_if_app~main.
```abap
METHOD z2ui5_if_app~main.

IF check_initialized = abap_false.
check_initialized = abap_true.
Expand Down
26 changes: 13 additions & 13 deletions docs/development/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ You can trigger backend processing when an event occurs using the `client->_even
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`.

```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->button(
text = `post`
Expand All @@ -32,8 +32,8 @@ If the backend needs additional information about the specific event, use parame
#### Source
Send properties of the event source control to the backend:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->button( text = `post` press = client->_event(
val = `BUTTON_POST`
Expand All @@ -51,8 +51,8 @@ ENDMETHOD.
#### Parameters
Retrieve parameters of the event:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->button( text = `post` id = `button_id` press = client->_event(
val = `BUTTON_POST`
Expand All @@ -71,8 +71,8 @@ ENDMETHOD.
#### Event
Retrieve specific properties of the event:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->button( text = `post` press = client->_event(
val = `BUTTON_POST`
Expand Down Expand Up @@ -102,8 +102,8 @@ CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC CREATE PUBLIC.

ENDCLASS.

METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->input( client->_bind_edit( name )
)->button( text = `post` press = client->_event(
Expand Down Expand Up @@ -144,8 +144,8 @@ If you don't want to process the event in the backend, you can also directly tri
```
For example, to open a new tab with the corresponding event:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->view_display( z2ui5_cl_xml_view=>factory(
)->button(
text = `post`
Expand All @@ -160,7 +160,7 @@ ENDMETHOD.
### Follow Up Action
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:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->follow_up_action( client->_event_client(
val = client->cs_event-open_new_tab
Expand Down
28 changes: 14 additions & 14 deletions docs/development/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Displaying messages and errors is an everyday requirement for ABAP developers. T
For short-duration messages, such as success notifications, you can use the message toast:

```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->message_toast_display( `this is a message` ).

Expand All @@ -23,7 +23,7 @@ ENDMETHOD.
Want the user to acknowledge the message? You can display a message box that requires manual closure:

```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->message_box_display( `this is a message` ).

Expand All @@ -33,7 +33,7 @@ ENDMETHOD.
For error messages, simply change the type:

```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->message_box_display(
text = `This is an error message`
Expand All @@ -46,16 +46,16 @@ ENDMETHOD.
You can directly pass common message structures, objects, and variables to the functions:
###### SY
```abap
METHOD z2ui5_if_app~main.
MESSAGE ID `NET` TYPE `I` NUMBER `001` into data(lv_dummy).
METHOD z2ui5_if_app~main.

MESSAGE ID `NET` TYPE `I` NUMBER `001` INTO DATA(lv_dummy).
client->message_box_display( sy ).

ENDMETHOD.
```
###### BAPIRET
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

DATA lt_bapiret TYPE STANDARD TABLE OF bapiret2.
CALL FUNCTION `BAPI_USER_GET_DETAIL`
Expand All @@ -71,7 +71,7 @@ ENDMETHOD.
```
###### CX_ROOT
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

TRY.
DATA(lv_val) = 1 / 0.
Expand All @@ -83,12 +83,12 @@ ENDMETHOD.
```
Other imports are supported as well. Just import your message structure, and the message box will display it.

#### Popup Multi Message
#### Popup Multi Message
The message box provides basic output. For a more detailed output, use the popup `z2ui5_cl_pop_messages`:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

data(lt_msg) = value bapirettab(
DATA(lt_msg) = VALUE bapirettab(
( type = `E` id = `MSG1` number = `001` message = `An empty Report field causes an empty XML Message to be sent` )
( type = `I` id = `MSG2` number = `002` message = `Product already in use` ) ).

Expand All @@ -99,7 +99,7 @@ ENDMETHOD.
#### Popup Error
To show a detailed view of your exception, use the following code:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

TRY.
DATA(lv_val) = 1 / 0.
Expand All @@ -113,15 +113,15 @@ ENDMETHOD.
#### Uncaught Errors
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:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

ASSERT 1 = `This is an error message!`.

ENDMETHOD.
```
Alternatively, achieve the same behavior with an uncaught exception:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

RAISE EXCEPTION NEW cx_sy_itab_line_not_found( ).

Expand Down
16 changes: 8 additions & 8 deletions docs/development/model/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ As an example, we will use the test OData service `/sap/opu/odata/DMO/UI_FLIGHT_
```abap
client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-set_odata_model
t_arg = value #(
t_arg = VALUE #(
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
( `FLIGHT` ) ) ) ).
```
Expand All @@ -36,10 +36,10 @@ tab->items( )->column_list_item( )->cells(
By using the growing property we can make use of the feature that not all data is loaded at once, leveraging performance.

#### Full Example
Heres the complete source code:
Here's the complete source code:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

DATA(tab) = z2ui5_cl_xml_view=>factory( )->page( )->table(
items = `{FLIGHT>/Airport}`
growing = abap_true ).
Expand All @@ -60,7 +60,7 @@ METHOD z2ui5_if_app~main.

client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-set_odata_model
t_arg = value #(
t_arg = VALUE #(
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
( `FLIGHT` ) ) ) ).

Expand Down Expand Up @@ -90,7 +90,7 @@ client->view_display( tab->stringify( ) ).

client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-set_odata_model
t_arg = value #(
t_arg = VALUE #(
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
( `TRAVEL` ) ) ) ).
```
Expand All @@ -114,7 +114,7 @@ In SAP contexts, OData services are often enriched with additional annotations.
We can use these SAP annotations in our UI5 view to utilize backend translations via the property `label`. Here’s an example:
```abap

data(tab) = page->table(
DATA(tab) = page->table(
items = `{TRAVEL>/Currency}`
growing = abap_true ).

Expand All @@ -134,7 +134,7 @@ client->view_display( tab->stringify( ) ).

client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-set_odata_model
t_arg = value #(
t_arg = VALUE #(
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
( `TRAVEL` ) ) ) ).
```
Expand Down
4 changes: 2 additions & 2 deletions docs/development/model/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CLASS z2ui5_cl_sample_tab IMPLEMENTATION.
METHOD z2ui5_if_app~main.

DO 100 TIMES.
INSERT value #(
INSERT VALUE #(
count = sy-index
value = `red`
descr = `this is a description` ) INTO TABLE mt_itab.
Expand Down Expand Up @@ -50,7 +50,7 @@ Making a table editable is a simple change. You just need to switch the binding
METHOD z2ui5_if_app~main.

DO 100 TIMES.
INSERT value #(
INSERT VALUE #(
count = sy-index
value = `red`
descr = `this is a description` ) INTO TABLE mt_itab.
Expand Down
8 changes: 4 additions & 4 deletions docs/development/navigation/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In abap2UI5, each application is represented by a single ABAP class. While you c
#### Backend
To call an ABAP class, use the following code:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

DATA(lo_app) = NEW z2ui5_cl_new_app( ).
client->nav_app_call( lo_app ).
Expand All @@ -19,15 +19,15 @@ ENDMETHOD.
```
The framework maintains a call stack. In the newly called class, you can return to the previous application using:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

client->nav_app_leave( ).

ENDMETHOD.
```
If you need to access data from the previous application, use casting as follows:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

IF client->check_on_navigated( ).
DATA(lo_called_app) = CAST z2ui5_cl_new_app( client->get_app_prev( ) ).
Expand All @@ -38,7 +38,7 @@ ENDMETHOD.
```
To navigate to an application without adding it to the call stack, use:
```abap
METHOD z2ui5_if_app~main.
METHOD z2ui5_if_app~main.

DATA(lo_app) = NEW z2ui5_cl_new_app( ).
client->nav_app_leave( lo_app ).
Expand Down
Loading