Skip to content

Commit 841a5d7

Browse files
authored
Update README.md
1 parent fcb6d7b commit 841a5d7

File tree

1 file changed

+79
-1
lines changed

1 file changed

+79
-1
lines changed

README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,80 @@
11
# abap2UI5-btp_proxy_kpi
2-
Integrate KPIs for abap2UI5 Apps to SAP Business Technology Platform
2+
🚧 work in progress 🚧
3+
<br><br>
4+
Find a way to send KPIs from ABAP to BTP. <br>
5+
Maintain KPIs for abap2UI5 apps integrated in SAP Build Launchpad Service.
6+
<br>
7+
<br>
8+
#### Approach / First Idea:
9+
(1/3) Use a single Interface:
10+
```abap
11+
INTERFACE z2ui5_if_proxy_kpi
12+
PUBLIC.
13+
14+
METHODS count
15+
IMPORTING
16+
filter TYPE string
17+
RETURNING
18+
VALUE(result) TYPE i.
19+
20+
ENDINTERFACE.
21+
```
22+
(2/3) Which can be used on app level to return KPIs:
23+
```abap
24+
CLASS z2ui5_cl_proxy_kpi_hello_world DEFINITION
25+
PUBLIC
26+
FINAL
27+
CREATE PUBLIC .
28+
29+
PUBLIC SECTION.
30+
INTERFACES z2ui5_if_proxy_kpi.
31+
INTERFACES z2ui5_if_app.
32+
33+
ENDCLASS.
34+
CLASS z2ui5_cl_proxy_kpi_hello_world IMPLEMENTATION.
35+
36+
METHOD z2ui5_if_proxy_kpi~count.
37+
38+
"app level calculation....
39+
result = 11.
40+
41+
ENDMETHOD.
42+
43+
METHOD z2ui5_if_app~main.
44+
"abap2UI5 app logic here...
45+
ENDMETHOD.
46+
47+
ENDCLASS.
48+
```
49+
(3/3) The rest handles an OData service (Dummy retunring n table entries):
50+
```abap
51+
METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset.
52+
53+
DATA lt_result TYPE zcl_z2ui5_proxy_kpi_mpc=>tt_entity.
54+
DATA(lt_filter_cond) = io_tech_request_context->get_filter( )->get_filter_select_options( ).
55+
56+
TRY.
57+
DATA(lv_classname) = to_upper( lt_filter_cond[ property = `CLASS` ]-select_options[ 1 ]-low ).
58+
CATCH cx_root.
59+
INSERT VALUE #( id = `ERROR_NO_PARAMETER_FOUND_WITH_NAME_CLASS` ) INTO TABLE lt_result.
60+
copy_data_to_ref( EXPORTING is_data = lt_result CHANGING cr_data = er_entityset ).
61+
RETURN.
62+
ENDTRY.
63+
64+
TRY.
65+
DATA(lv_filter) = to_upper( lt_filter_cond[ property = `FILTER` ]-select_options[ 1 ]-low ).
66+
CATCH cx_root.
67+
ENDTRY.
68+
69+
DATA li_proxy_kpi TYPE REF TO z2ui5_if_proxy_kpi.
70+
CREATE OBJECT li_proxy_kpi TYPE (lv_classname).
71+
DATA(lv_count) = li_proxy_kpi->count( lv_filter ).
72+
73+
DO lv_count TIMES.
74+
INSERT VALUE #( id = sy-index ) INTO TABLE lt_result.
75+
ENDDO.
76+
77+
copy_data_to_ref( EXPORTING is_data = lt_result CHANGING cr_data = er_entityset ).
78+
79+
ENDMETHOD.
80+
```

0 commit comments

Comments
 (0)