You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/get_started/hello_world.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,25 +3,8 @@ outline: [2, 4]
3
3
---
4
4
# Hello World
5
5
6
-
abap2UI5 follows a thin-frontend model: the browser only renders UI5 views, while all logic, state, and data handling stay in ABAP on the server. Three ideas to keep in mind before writing code:
7
-
8
-
-**One method, many calls.** The framework calls your app's `main` method on every roundtrip — on the initial start *and* after every user interaction (button press, input change, navigation).
9
-
-**State lives in your class.** Public attributes of your app class hold data between roundtrips; abap2UI5 serializes and restores them for you, so you don't manage sessions manually.
10
-
-**The `client` object is your only API.** Use it to display views, check which event fired, bind attributes to UI5 controls, and trigger navigation.
6
+
Just copy the following class into your system:
11
7
12
-
Every abap2UI5 app implements the `z2ui5_if_app` interface. It has a single method, `main`, with one parameter: `client` of type `z2ui5_if_client`:
13
-
```abap
14
-
INTERFACE z2ui5_if_app PUBLIC.
15
-
METHODS main
16
-
IMPORTING
17
-
client TYPE REF TO z2ui5_if_client.
18
-
ENDINTERFACE.
19
-
```
20
-
The `client` object is your only entry point into the framework. Use it to show views, handle events, share data, and navigate between apps.
21
-
22
-
→ *For a deeper look at the lifecycle and framework internals, see [How It All Works](/technical/how_it_all_works) and [Concept](/technical/concept).*
23
-
24
-
### Basic Example
25
8
Build a class:
26
9
```abap
27
10
CLASS zcl_app_hello_world DEFINITION PUBLIC.
@@ -31,9 +14,7 @@ ENDCLASS.
31
14
32
15
CLASS zcl_app_hello_world IMPLEMENTATION.
33
16
METHOD z2ui5_if_app~main.
34
-
35
17
client->message_box_display( `Hello World` ).
36
-
37
18
ENDMETHOD.
38
19
ENDCLASS.
39
20
```
@@ -43,6 +24,25 @@ Go back to the landing page in your browser and enter `ZCL_APP_HELLO_WORLD` to l
43
24
While the HTTP handler has to distinguish between Standard ABAP and ABAP for Cloud, the apps themselves are independent. You're free to choose whether to build your apps with ABAP Cloud compatibility.
44
25
:::
45
26
27
+
### Idea
28
+
abap2UI5 follows a thin-frontend model: the browser only renders UI5 views, while all logic, state, and data handling stay in ABAP on the server. Three ideas to keep in mind before writing code:
29
+
30
+
-**One method, many calls.** The framework calls your app's `main` method on every roundtrip — on the initial start *and* after every user interaction (button press, input change, navigation).
31
+
-**State lives in your class.** Public attributes of your app class hold data between roundtrips; abap2UI5 serializes and restores them for you, so you don't manage sessions manually.
32
+
-**The `client` object is your only API.** Use it to display views, check which event fired, bind attributes to UI5 controls, and trigger navigation.
33
+
34
+
Every abap2UI5 app implements the `z2ui5_if_app` interface. It has a single method, `main`, with one parameter: `client` of type `z2ui5_if_client`:
35
+
```abap
36
+
INTERFACE z2ui5_if_app PUBLIC.
37
+
METHODS main
38
+
IMPORTING
39
+
client TYPE REF TO z2ui5_if_client.
40
+
ENDINTERFACE.
41
+
```
42
+
The `client` object is your only entry point into the framework. Use it to show views, handle events, share data, and navigate between apps.
43
+
44
+
→ *For a deeper look at the lifecycle and framework internals, see [How It All Works](/technical/how_it_all_works) and [Concept](/technical/concept).*
0 commit comments