Skip to content

Commit c715685

Browse files
authored
update
1 parent 4b8a3c7 commit c715685

File tree

1 file changed

+59
-6
lines changed

1 file changed

+59
-6
lines changed

docs/development/messages.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,76 @@
11
---
22
outline: [2, 4]
33
---
4-
# Messages
54

6-
For translation, check this section.
5+
# Messages
76

87
#### Message Toast
98

9+
Messages only displayed for a short period of time eg. sucesses can be displayed via the client method:
10+
11+
```abap
12+
CLASS zcl_my_app IMPLEMENTATION.
13+
METHOD z2ui5_if_app~main.
14+
15+
client->message_toast_display( `this is my message` ).
16+
17+
ENDMETHOD.
18+
ENDCLASS.
19+
```
1020

1121
#### Message Box
1222

23+
Messages wihch need to be closed manually can be displayed via the message box:
24+
25+
```abap
26+
CLASS zcl_my_app IMPLEMENTATION.
27+
METHOD z2ui5_if_app~main.
28+
29+
client->message_box_display( `this is my message` ).
30+
31+
ENDMETHOD.
32+
ENDCLASS.
33+
```
34+
35+
Or use an error
36+
37+
```abap
38+
CLASS zcl_my_app IMPLEMENTATION.
39+
METHOD z2ui5_if_app~main.
40+
client->message_box_display( text = 'Select a team in the "Development" area.' && cl_abap_char_utilities=>cr_lf &&
41+
'"Marketing" isn’t assigned to this area.' type = 'error' ).
42+
43+
ENDMETHOD.
44+
ENDCLASS.
45+
```
1346

1447
#### Popup T100/BAPIRET
15-
Most often you will get Message Popups in T100 or bairet format, you can use the following popup to display these messages:
48+
49+
```abap
50+
CLASS z2ui5_cl_demo_app_154 IMPLEMENTATION.
51+
METHOD z2ui5_if_app~main.
52+
53+
DATA(lo_app) = z2ui5_cl_pop_messages=>factory( VALUE #(
54+
( message = 'An empty Report field causes an empty XML Message to be sent' type = 'E' id = 'MSG1' number = '001' )
55+
( message = 'Check was executed for wrong Scenario' type = 'E' id = 'MSG1' number = '002' )
56+
( message = 'Request was handled without errors' type = 'S' id = 'MSG1' number = '003' )
57+
( message = 'product activated' type = 'S' id = 'MSG4' number = '375' )
58+
( message = 'check the input values' type = 'W' id = 'MSG2' number = '375' )
59+
( message = 'product already in use' type = 'I' id = 'MSG2' number = '375' )
60+
) ).
61+
62+
client->nav_app_call( lo_app ).
63+
64+
ENDMETHOD.
65+
ENDCLASS.
66+
```
67+
68+
if you need interaction, you can use built-in popups. The commen messages in format T100 or bairet, you can use the following popup to display these messages:
69+
1670
PRs welcome
1771

1872
#### Popup To Inform
19-
Popup
2073

74+
Popup
2175

22-
#### Popup To Decide
23-
76+
#### Popup To Decide

0 commit comments

Comments
 (0)