Skip to content

Commit 68cbe88

Browse files
authored
update
1 parent b6b9fcb commit 68cbe88

File tree

11 files changed

+289
-29
lines changed

11 files changed

+289
-29
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/.vitepress/config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default defineConfig({
7777
link: '/get_started/introduction',
7878
collapsed: true,
7979
items: [
80-
{ text: 'Introduction', link: '/get_started/introduction' },
80+
{ text: 'About', link: '/get_started/about' },
8181
{ text: 'Quickstart', link: '/get_started/quickstart' },
8282
{ text: 'Hello World', link: '/get_started/hello_world' },
8383
{ text: 'Sample Apps', link: '/get_started/samples' },
@@ -96,7 +96,7 @@ export default defineConfig({
9696
// { text: 'Events, Navigation', link: '/development/events' },
9797
{ text: 'Messages, Errors', link: '/development/messages' },
9898
{ text: 'Translation, i18n', link: '/development/translation' },
99-
// { text: 'Popups, Popover', link: '/development/popups' },
99+
{ text: 'Popups, Popover', link: '/development/popups' },
100100
{ text: 'Troubleshooting', link: '/development/troubleshooting' },
101101
]
102102
},

docs/configuration/btp.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,26 @@
33
Integrate your abap2UI5 apps into BTP Services like Build Workzone. Find all information here:<br>
44
[**Installation & Configuration of BTP**](https://www.linkedin.com/pulse/abap2ui5-integration-sap-business-technology-platform-13-installation-lf1re/?trackingId=YQ0y%2Fq0y6Kw5PK8chNCbrw%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BFGBWUSIZRzeRjUNKBFD0uA%3D%3D)<br>
55
[**Setup SAP Build Work Zone**](https://www.linkedin.com/pulse/abap2ui5-integration-sap-business-technology-platform-23-setup-ujdqe/?trackingId=vFwHvpI9oBk2igiz5P5CWA%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BFGBWUSIZRzeRjUNKBFD0uA%3D%3D)<br>
6-
[**Setup SAP Mobile Start**](https://www.linkedin.com/pulse/abap2ui5-integration-sap-business-technology-platform-33-setup-uzure/?trackingId=He2W8FnZZ5UxpbGKHOeLEg%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BFGBWUSIZRzeRjUNKBFD0uA%3D%3D)<br>
6+
[**Setup SAP Mobile Start**](https://www.linkedin.com/pulse/abap2ui5-integration-sap-business-technology-platform-33-setup-uzure/?trackingId=He2W8FnZZ5UxpbGKHOeLEg%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BFGBWUSIZRzeRjUNKBFD0uA%3D%3D)<br>
7+
8+
### Destination Configuration
9+
<br>
10+
11+
##### Additional Properties
12+
13+
* Name: BACKEND_ABAP2UI5
14+
* Type: HTTP
15+
* Description: abap2UI5 Destination
16+
* URL: the url above
17+
* Proxy Type: Internet
18+
* Authentication: BasicAuthentication
19+
* User: (user)
20+
* Password: (password)
21+
22+
##### Additional Properties
23+
24+
* HTML5.DynamicDestination true
25+
* product.name ABAP System
26+
* sap-client (client)
27+
* WebIDEEnabled true
28+
* WebIDEUsage odata_abap,dev_abap

docs/configuration/launchpad.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ Integrate your abap2UI5 apps into SAP Fiori Launchpads. Find all information her
44
[**(1) Installation & Configuration**](https://www.linkedin.com/pulse/copy-abap2ui5-host-your-apps-sap-fiori-launchpad-abap2ui5-ocn2e/) <br>
55
[**(2) Features: Title, Parameters, Navigation**](https://www.linkedin.com/pulse/abap2ui5-host-your-apps-sap-fiori-launchpad-23-features-abap2ui5-upche/) <br>
66
[**(3) Integration of KPIs**](https://www.linkedin.com/pulse/abap2ui5-host-your-apps-sap-fiori-launchpad-33-kpis-abap2ui5-uuxxe/) <br>
7+
8+
9+
10+
### Target Mapping
11+
12+
* Semantic Object: Z2UI5_CL_MY_APP
13+
* Action: display
14+
* URL: /sap/bc/ui5_ui5/sap/z2ui5
15+
* ID: z2ui5
16+
* Parameter: app_start / Z2UI5_CL_MY_APP

docs/development/general.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ CLASS z2ui5_cl_app IMPLEMENTATION.
1414
METHOD z2ui5_if_app~main.
1515
TRY.
1616
17-
"first app start,
17+
"first app start
1818
IF client->check_on_init( ).
1919
"init values here
2020
"display view
2121
RETURN.
2222
ENDIF.
2323
2424
25-
"callback after previous app.
25+
"callback after previous app
2626
IF client->check_on_navigated( ).
2727
DATA(lo_app_prev) = client->get_app_prev( ).
28-
"read attributes of previous app here
28+
"read attributes of previous app
2929
RETURN.
3030
ENDIF.
3131
3232
33-
"handle events..
33+
"handle events
3434
CASE client->get( )-event.
3535
WHEN 'OK'.
3636
data(lt_arg) = client->get_event_arg( ).

docs/development/model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ ENDCLASS.
9191
For an example of local binding in action, see the value help use case in `Z2UI5_CL_DEMO_APP_002`.
9292

9393
::: tip **Data in Public Attributes**
94-
Be aware that you need to store your data in pubic attributes of your class when using One-Way or Two-Way binding, because the framework needs to access it from outside. This is similar to the PBO/PAI screen days, where data needed to be stored in global variables.
94+
When using One-Way or Two-Way binding, remember to store your data in public attributes of your class, as the framework needs to access it from outside. This is similar to the PBO/PAI screen days, where data needed to be stored in global variables.
9595
:::

docs/development/popups.md

Lines changed: 109 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,131 @@
1-
# Popups
1+
---
2+
outline: [2, 4]
3+
---
4+
# Popups, Popovers
25

36

47
### Popup
58

69

10+
#### Simple Example
711

8-
Popups it’s recommend to use for every popup an own app so use navigation
12+
To display a popup, use the method `client->popup_display` instead of `client->view_display`:
13+
```abap
14+
METHOD z2ui5_if_app~main.
915
10-
### Popup in separated App
11-
### Popover
16+
data(lo_popup) = z2ui5_cl_xml_view=>factory_popup(
17+
)->dialog( 'Popup - Info'
18+
)->text( 'this is an information shown in a popup' ).
1219
20+
client->popup_display( lo_popup->stringify( ) ).
1321
22+
ENDMETHOD.
23+
```
1424

15-
### Built-in Popups
16-
a few you already saw at message and errors section.
25+
#### Flow Logic
26+
Typically, a common flow for using popups involves displaying a normal view, then showing a popup, and finally closing it. Here’s how this can be structured:
1727

28+
```abap
29+
METHOD Z2UI5_if_app~main.
30+
31+
me->client = client.
32+
33+
IF client->check_on_init( ).
34+
35+
DATA(lo_view) = z2ui5_cl_xml_view=>factory(
36+
)->page( 'abap2UI5 - Popups'
37+
)->button(
38+
text = 'popup rendering, no background rendering'
39+
press = client->_event( 'POPUP_OPEN' ) ).
40+
client->view_display( lo_view->stringify( ) ).
41+
42+
RETURN.
43+
ENDIF.
44+
45+
CASE client->get( )-event.
46+
47+
WHEN 'POPUP_OPEN'.
48+
49+
DATA(lo_popup) = Z2UI5_cl_xml_view=>factory_popup(
50+
)->dialog( 'Popup'
51+
)->text( 'this is a text in a popup'
52+
)->button(
53+
text = 'close'
54+
press = client->_event( 'POPUP_CLOSE' ) ).
55+
56+
client->popup_display( lo_popup->stringify( ) ).
57+
58+
WHEN 'POPUP_CLOSE'.
59+
client->popup_destroy( ).
60+
ENDCASE.
61+
62+
ENDMETHOD.
1863
```
19-
.
20-
│─ abap2ui5
21-
├─ 01
22-
├─ 02
23-
├─ 01 (popups)
24-
```
25-
Feel free to send a PR if you extend a need a new popup.
2664

65+
#### Separated App
66+
67+
For each popup, it’s recommended to use a separated app by using navigation.
68+
69+
### Popover
70+
71+
Use the method client->popover_display and specify the ID of the control where you want to display the popover:
2772

73+
```abap
74+
METHOD Z2UI5_if_app~main.
2875
76+
IF client->check_on_init( ).
2977
78+
DATA(view) = z2ui5_cl_xml_view=>factory(
79+
)->shell(
80+
)->page( 'Popover Example'
81+
)->button(
82+
text = 'display popover'
83+
press = client->_event( 'POPOVER_OPEN' )
84+
id = 'TEST' ).
3085
31-
#### Popup to Select
86+
client->view_display( view->stringify( ) ).
3287
88+
ENDIF.
3389
34-
#### Popup to Confirm
90+
CASE client->get( )-event.
3591
92+
WHEN 'POPOVER_OPEN'.
3693
37-
#### Popup to
94+
DATA(popover) = Z2UI5_cl_xml_view=>factory_popup(
95+
)->popover( placement = 'Left'
96+
)->text( `this is a popover`
97+
)->button(
98+
text = `close`
99+
press = client->_event( `POPOVER_CLOSE` ) ).
100+
101+
client->popover_display(
102+
xml = view->stringify( )
103+
by_id = `test` ).
104+
105+
WHEN 'POPOVER_CLOSE'.
106+
client->popover_destroy( ).
107+
ENDCASE.
108+
109+
ENDMETHOD.
110+
```
111+
112+
### Built-in Popups
38113

114+
Several pre-built popup classes are available for specific scenarios:
115+
116+
* z2ui5_cl_pop_error
117+
* z2ui5_cl_pop_file_dl
118+
* z2ui5_cl_pop_file_ul
119+
* z2ui5_cl_pop_get_range
120+
* z2ui5_cl_pop_get_range_m
121+
* z2ui5_cl_pop_html
122+
* z2ui5_cl_pop_input_val
123+
* z2ui5_cl_pop_itab_json_dl
124+
* z2ui5_cl_pop_js_loader
125+
* z2ui5_cl_pop_messages
126+
* z2ui5_cl_pop_pdf
127+
* z2ui5_cl_pop_table
128+
* z2ui5_cl_pop_textedit
129+
* z2ui5_cl_pop_to_confirm
130+
* z2ui5_cl_pop_to_inform
131+
* z2ui5_cl_pop_to_select

docs/development/translation.md

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,140 @@ METHOD z2ui5_if_app~main.
2525
client->message_box_display( lv_msg_translated ).
2626
2727
ENDMETHOD.
28-
```
28+
```
29+
30+
### Data Element Texts
31+
You can also retrieve and display the short, medium, or long descriptions of data elements (DD04T). Here’s how to access these text types programmatically:
32+
33+
::: code-group
34+
35+
```abap
36+
METHOD z2ui5_if_app~main.
37+
38+
DATA(ls_product_label) = lcl_help=>get_data_element_texts( 'PRODUCT' ).
39+
client->message_box_display( |{ ls_product_label-short }: 100 | ).
40+
41+
ENDMETHOD.
42+
```
43+
44+
```abap [LCL_HELP]
45+
CLASS lcl_help DEFINITION
46+
CREATE PUBLIC.
47+
48+
PUBLIC SECTION.
49+
50+
TYPES:
51+
BEGIN OF ty_s_data_element_text,
52+
header TYPE string,
53+
short TYPE string,
54+
medium TYPE string,
55+
long TYPE string,
56+
END OF ty_s_data_element_text.
57+
58+
CLASS-METHODS get_data_element_texts
59+
IMPORTING
60+
i_data_element_name TYPE string
61+
RETURNING
62+
VALUE(result) TYPE ty_s_data_element_text.
63+
64+
ENDCLASS.
65+
66+
CLASS lcl_help IMPLEMENTATION.
67+
68+
METHOD get_data_element_texts.
69+
70+
DATA ddic_ref TYPE REF TO data.
71+
DATA data_element TYPE REF TO object.
72+
DATA content TYPE REF TO object.
73+
DATA: BEGIN OF ddic,
74+
reptext TYPE string,
75+
scrtext_s TYPE string,
76+
scrtext_m TYPE string,
77+
scrtext_l TYPE string,
78+
END OF ddic.
79+
DATA exists TYPE abap_bool.
80+
81+
DATA(data_element_name) = i_data_element_name.
82+
83+
TRY.
84+
cl_abap_typedescr=>describe_by_name( 'T100' ).
85+
86+
DATA(struct_desrc) = CAST cl_abap_structdescr( cl_abap_structdescr=>describe_by_name( 'DFIES' ) ).
87+
88+
CREATE DATA ddic_ref TYPE HANDLE struct_desrc.
89+
ASSIGN ddic_ref->* TO FIELD-SYMBOL(<ddic>).
90+
ASSERT sy-subrc = 0.
91+
92+
cl_abap_elemdescr=>describe_by_name( EXPORTING p_name = data_element_name
93+
RECEIVING p_descr_ref = DATA(lo_typedescr)
94+
EXCEPTIONS OTHERS = 1 ).
95+
IF sy-subrc <> 0.
96+
RETURN.
97+
ENDIF.
98+
99+
DATA(data_descr) = CAST cl_abap_datadescr( lo_typedescr ).
100+
101+
CALL METHOD data_descr->('GET_DDIC_FIELD')
102+
RECEIVING
103+
p_flddescr = <ddic>
104+
EXCEPTIONS
105+
not_found = 1
106+
no_ddic_type = 2
107+
OTHERS = 3.
108+
IF sy-subrc <> 0.
109+
RETURN.
110+
ENDIF.
111+
112+
ddic = CORRESPONDING #( <ddic> ).
113+
result-header = ddic-reptext.
114+
result-short = ddic-scrtext_s.
115+
result-medium = ddic-scrtext_m.
116+
result-long = ddic-scrtext_l.
117+
118+
CATCH cx_root.
119+
TRY.
120+
DATA(xco_cp_abap_dictionary) = 'XCO_CP_ABAP_DICTIONARY'.
121+
CALL METHOD (xco_cp_abap_dictionary)=>('DATA_ELEMENT')
122+
EXPORTING
123+
iv_name = data_element_name
124+
RECEIVING
125+
ro_data_element = data_element.
126+
127+
CALL METHOD data_element->('IF_XCO_AD_DATA_ELEMENT~EXISTS')
128+
RECEIVING
129+
rv_exists = exists.
130+
131+
IF exists = abap_false.
132+
RETURN.
133+
ENDIF.
134+
135+
CALL METHOD data_element->('IF_XCO_AD_DATA_ELEMENT~CONTENT')
136+
RECEIVING
137+
ro_content = content.
138+
139+
CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_HEADING_FIELD_LABEL')
140+
RECEIVING
141+
rs_heading_field_label = result-header.
142+
143+
CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_SHORT_FIELD_LABEL')
144+
RECEIVING
145+
rs_short_field_label = result-short.
146+
147+
CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_MEDIUM_FIELD_LABEL')
148+
RECEIVING
149+
rs_medium_field_label = result-medium.
150+
151+
CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_LONG_FIELD_LABEL')
152+
RECEIVING
153+
rs_long_field_label = result-long.
154+
155+
CATCH cx_root.
156+
ENDTRY.
157+
ENDTRY.
158+
159+
ENDMETHOD.
160+
161+
ENDCLASS.
162+
```
163+
164+
:::

0 commit comments

Comments
 (0)