Skip to content

Commit df9b6ca

Browse files
authored
update
1 parent b0670a4 commit df9b6ca

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed

docs/.vitepress/config.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ export default defineConfig({
157157
},
158158
]
159159
},
160-
161160
{
162161
text: 'Resources',
163162
link: '/resources/resources',
@@ -166,10 +165,13 @@ export default defineConfig({
166165
{ text: 'Changelog', link: '/resources/changelog' },
167166
{ text: 'Blogs', link: '/resources/blogs' },
168167
{ text: 'References', link: '/resources/references' },
169-
{ text: 'Contribution', link: '/resources/contribution' },
170-
{ text: 'Support', link: '/resources/support' },
171-
{ text: 'Sponsor', link: '/resources/sponsor' },
172168
{ text: 'License', link: '/resources/license' },
169+
{ text: 'Community', items: [
170+
{ text: 'Support', link: '/resources/support' },
171+
{ text: 'Contribution', link: '/resources/contribution' },
172+
{ text: 'Sponsor', link: '/resources/sponsor' },
173+
]
174+
},
173175
]
174176
}
175177
],

docs/addons/logging.md

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,39 @@ outline: [2, 6]
55

66
<i class="fa-brands fa-github"></i> [Logging Addon on GitHub](https://github.com/abap2UI5-addons/logging)
77

8-
Developing end-user business processes is not possible without adequate logging. The standard method for this in ABAP systems is the integrated Business Application Log (BAL), which works in on-premise systems and, with the new APIs, in ABAP Cloud. You might also consider open-source projects like the excellent [abap-logger](https://github.com/ABAP-Logger/ABAP-Logger). Ultimately, we need a way to display these messages for end users in abap2UI5 apps.<br>
8+
Logging is essential for developing end-user business processes. In ABAP systems, the standard tool for this is the Business Application Log (BAL), which is supported in both on-premise systems and ABAP Cloud (via new APIs). Additionally, open-source projects like the excellent [abap-logger](https://github.com/ABAP-Logger/ABAP-Logger) offer valuable alternatives.
99

10-
This add-on centralizes BAL logging UIs for abap2UI5 apps. Instead of creating multiple BAL popups individually, the goal is to consolidate BAL functionality here for collaborative expansion. Currently, only basic functionality is available. Have you already implemented BAL functionality with abap2UI5? Consider sharing it — PRs are welcome!
10+
To display these messages for end-users in abap2UI5 apps, this add-on centralizes BAL logging UIs for easy integration and collaborative expansion.
1111

12-
### 1. BAL Messages (classic)
12+
### Use cases
1313

14+
#### BAL Cloud
15+
In ABAP Cloud environments, the BAL includes a new API. Use this API to import logging objects directly into the class `z2ui5add_cl_bal_cl` to display messages:
1416
```abap
1517
METHOD z2ui5_if_app~main.
1618
1719
DATA(lo_log) = cl_bali_log=>create( ).
18-
1920
DATA(lo_msg) = cl_bali_message_setter=>create(
2021
severity = if_bali_constants=>c_severity_status
2122
id = 'DEMO_LOG'
2223
number = '002'
23-
variable_1 = CONV #( cl_abap_context_info=>get_user_business_partner_id( ) ) ).
24+
variable_1 = `username` ).
2425
lo_log->add_item( lo_msg ).
2526
26-
" BAPIRET2
27-
DATA(lo_bapi) = cl_bali_message_setter=>create_from_bapiret2( VALUE #( type = 'E'
28-
id = 'DEMO_LOG'
29-
number = '002'
30-
message_v1 = 'Dummy' ) ).
31-
lo_log->add_item( lo_bapi ).
32-
client->nav_app_call( z2ui5add_cl_bal_cl=>factory_popup( lo_log ) ).
33-
34-
ENDMETHOD.
35-
```
36-
37-
### 2. BAL Messages (cloud)
38-
39-
```abap
40-
METHOD z2ui5_if_app~main.
41-
42-
DATA(lo_log) = cl_bali_log=>create( ).
27+
DATA(lo_bapi) = cl_bali_message_setter=>create_from_bapiret2(
28+
VALUE #( type = 'E'
29+
id = 'DEMO_LOG'
30+
number = '002'
31+
message_v1 = 'Dummy' ) ).
4332
44-
DATA(lo_msg) = cl_bali_message_setter=>create(
45-
severity = if_bali_constants=>c_severity_status
46-
id = 'DEMO_LOG'
47-
number = '002'
48-
variable_1 = CONV #( cl_abap_context_info=>get_user_business_partner_id( ) ) ).
49-
lo_log->add_item( lo_msg ).
50-
51-
" BAPIRET2
52-
DATA(lo_bapi) = cl_bali_message_setter=>create_from_bapiret2( VALUE #( type = 'E'
53-
id = 'DEMO_LOG'
54-
number = '002'
55-
message_v1 = 'Dummy' ) ).
5633
lo_log->add_item( lo_bapi ).
5734
client->nav_app_call( z2ui5add_cl_bal_cl=>factory_popup( lo_log ) ).
5835
5936
ENDMETHOD.
6037
```
6138

62-
### 3. BAL Cockpit
63-
In ABAP for Cloud
64-
39+
#### BAL Classic
40+
In on-premise ABAP systems, you can use the classic BAL APIs. As no specific logging object exists, simply import the BAL table into `z2ui5add_cl_bal_cl`:
6541
```abap
6642
METHOD z2ui5_if_app~main.
6743
@@ -85,11 +61,8 @@ METHOD z2ui5_if_app~main.
8561
ENDMETHOD.
8662
```
8763

88-
89-
### 4. ABAP-Logger
90-
91-
UI for the Open Source Project [**abap-logger**](https://github.com/ABAP-Logger/ABAP-Logger)
92-
64+
#### ABAP-Logger
65+
In on-premise systems, you also have the option to install the open-source project [**abap-logger**](https://github.com/ABAP-Logger/ABAP-Logger), which simplifies logging with BAL. Here’s an example of how to use it with abap2UI5:
9366
```abap
9467
CLASS z2ui5add_cl_abap_logger_sample DEFINITION PUBLIC FINAL
9568
CREATE PUBLIC .
@@ -116,3 +89,34 @@ CLASS z2ui5add_cl_abap_logger_sample IMPLEMENTATION.
11689
ENDCLASS.
11790
```
11891

92+
### BAL Cockpit
93+
The concept of this app is to create a popup that shows all logs for a specific SLG1 logging object, designed to be non-SPA GUI and cloud-ready:
94+
```abap
95+
METHOD z2ui5_if_app~main.
96+
97+
DATA(lo_log) = cl_bali_log=>create( ).
98+
99+
DATA(lo_msg) = cl_bali_message_setter=>create(
100+
severity = if_bali_constants=>c_severity_status
101+
id = 'DEMO_LOG'
102+
number = '002'
103+
variable_1 = CONV #( cl_abap_context_info=>get_user_business_partner_id( ) ) ).
104+
lo_log->add_item( lo_msg ).
105+
106+
" BAPIRET2
107+
DATA(lo_bapi) = cl_bali_message_setter=>create_from_bapiret2( VALUE #( type = 'E'
108+
id = 'DEMO_LOG'
109+
number = '002'
110+
message_v1 = 'Dummy' ) ).
111+
lo_log->add_item( lo_bapi ).
112+
client->nav_app_call( z2ui5add_cl_bal_cl=>factory_popup( lo_log ) ).
113+
114+
ENDMETHOD.
115+
```
116+
117+
118+
::: tip
119+
This add-on is in its early stages, with basic functionality currently available.
120+
If you’ve implemented BAL functionality with abap2UI5, consider sharing your work! Contributions and pull requests are welcome.
121+
:::
122+

0 commit comments

Comments
 (0)