diff --git a/docs/advanced/extensibility/custom_js.md b/docs/advanced/extensibility/custom_js.md index c9593fe..459a888 100644 --- a/docs/advanced/extensibility/custom_js.md +++ b/docs/advanced/extensibility/custom_js.md @@ -10,7 +10,7 @@ The idea is to send the custom JavaScript function along with the view to the fr Below is a working example that you can use as a starting point: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. IF client->check_on_init( ). DATA(view) = z2ui5_cl_xml_view=>factory( ). diff --git a/docs/advanced/fiori.md b/docs/advanced/fiori.md index 135ea0e..93d40c4 100644 --- a/docs/advanced/fiori.md +++ b/docs/advanced/fiori.md @@ -65,8 +65,8 @@ sap.ui.core.Component.create({ ``` 5. Create ABAP2U5 app class -```abap -METHOD z2ui5_if_app~main. +```abap + METHOD z2ui5_if_app~main. IF check_initialized = abap_false. check_initialized = abap_true. diff --git a/docs/development/events.md b/docs/development/events.md index 3180cb2..f828c0f 100644 --- a/docs/development/events.md +++ b/docs/development/events.md @@ -12,8 +12,8 @@ You can trigger backend processing when an event occurs using the `client->_even As an example, we will use the `press` property of a button. To trigger events in the backend, assign the result of `client->_event(`MY_EVENT_NAME`)` to the relevant UI5 control property. Once triggered, the backend can retrieve the event details with `client->get( )-event`. ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->button( text = `post` @@ -32,8 +32,8 @@ If the backend needs additional information about the specific event, use parame #### Source Send properties of the event source control to the backend: ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->button( text = `post` press = client->_event( val = `BUTTON_POST` @@ -51,8 +51,8 @@ ENDMETHOD. #### Parameters Retrieve parameters of the event: ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->button( text = `post` id = `button_id` press = client->_event( val = `BUTTON_POST` @@ -71,8 +71,8 @@ ENDMETHOD. #### Event Retrieve specific properties of the event: ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->button( text = `post` press = client->_event( val = `BUTTON_POST` @@ -102,8 +102,8 @@ CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC CREATE PUBLIC. ENDCLASS. -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->input( client->_bind_edit( name ) )->button( text = `post` press = client->_event( @@ -144,8 +144,8 @@ If you don't want to process the event in the backend, you can also directly tri ``` For example, to open a new tab with the corresponding event: ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + client->view_display( z2ui5_cl_xml_view=>factory( )->button( text = `post` @@ -160,7 +160,7 @@ ENDMETHOD. ### Follow Up Action Sometimes, you might want to first call a backend function and then immediately perform an action in the frontend. This is possible with the follow-up action event: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->follow_up_action( client->_event_client( val = client->cs_event-open_new_tab diff --git a/docs/development/messages.md b/docs/development/messages.md index cd68a7c..ed011ba 100644 --- a/docs/development/messages.md +++ b/docs/development/messages.md @@ -11,7 +11,7 @@ Displaying messages and errors is an everyday requirement for ABAP developers. T For short-duration messages, such as success notifications, you can use the message toast: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->message_toast_display( `this is a message` ). @@ -23,7 +23,7 @@ ENDMETHOD. Want the user to acknowledge the message? You can display a message box that requires manual closure: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->message_box_display( `this is a message` ). @@ -33,7 +33,7 @@ ENDMETHOD. For error messages, simply change the type: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->message_box_display( text = `This is an error message` @@ -46,16 +46,16 @@ ENDMETHOD. You can directly pass common message structures, objects, and variables to the functions: ###### SY ```abap -METHOD z2ui5_if_app~main. - - MESSAGE ID `NET` TYPE `I` NUMBER `001` into data(lv_dummy). + METHOD z2ui5_if_app~main. + + MESSAGE ID `NET` TYPE `I` NUMBER `001` INTO DATA(lv_dummy). client->message_box_display( sy ). ENDMETHOD. ``` ###### BAPIRET ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA lt_bapiret TYPE STANDARD TABLE OF bapiret2. CALL FUNCTION `BAPI_USER_GET_DETAIL` @@ -71,7 +71,7 @@ ENDMETHOD. ``` ###### CX_ROOT ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. TRY. DATA(lv_val) = 1 / 0. @@ -83,12 +83,12 @@ ENDMETHOD. ``` Other imports are supported as well. Just import your message structure, and the message box will display it. -#### Popup Multi Message +#### Popup Multi Message The message box provides basic output. For a more detailed output, use the popup `z2ui5_cl_pop_messages`: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - data(lt_msg) = value bapirettab( + DATA(lt_msg) = VALUE bapirettab( ( type = `E` id = `MSG1` number = `001` message = `An empty Report field causes an empty XML Message to be sent` ) ( type = `I` id = `MSG2` number = `002` message = `Product already in use` ) ). @@ -99,7 +99,7 @@ ENDMETHOD. #### Popup Error To show a detailed view of your exception, use the following code: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. TRY. DATA(lv_val) = 1 / 0. @@ -113,7 +113,7 @@ ENDMETHOD. #### Uncaught Errors What happens if errors are uncaught? In this case, the default HTTP handler exception output is used. The processing is interrupted, and the user will need to refresh the browser. Use this only for unexpected behavior: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. ASSERT 1 = `This is an error message!`. @@ -121,7 +121,7 @@ ENDMETHOD. ``` Alternatively, achieve the same behavior with an uncaught exception: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. RAISE EXCEPTION NEW cx_sy_itab_line_not_found( ). diff --git a/docs/development/model/odata.md b/docs/development/model/odata.md index 5aee569..18c8b03 100644 --- a/docs/development/model/odata.md +++ b/docs/development/model/odata.md @@ -10,7 +10,7 @@ As an example, we will use the test OData service `/sap/opu/odata/DMO/UI_FLIGHT_ ```abap client->follow_up_action( client->_event_client( val = z2ui5_if_client=>cs_event-set_odata_model - t_arg = value #( + t_arg = VALUE #( ( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` ) ( `FLIGHT` ) ) ) ). ``` @@ -36,10 +36,10 @@ tab->items( )->column_list_item( )->cells( By using the growing property we can make use of the feature that not all data is loaded at once, leveraging performance. #### Full Example -Here’s the complete source code: +Here's the complete source code: ```abap -METHOD z2ui5_if_app~main. - + METHOD z2ui5_if_app~main. + DATA(tab) = z2ui5_cl_xml_view=>factory( )->page( )->table( items = `{FLIGHT>/Airport}` growing = abap_true ). @@ -60,7 +60,7 @@ METHOD z2ui5_if_app~main. client->follow_up_action( client->_event_client( val = z2ui5_if_client=>cs_event-set_odata_model - t_arg = value #( + t_arg = VALUE #( ( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` ) ( `FLIGHT` ) ) ) ). @@ -90,7 +90,7 @@ client->view_display( tab->stringify( ) ). client->follow_up_action( client->_event_client( val = z2ui5_if_client=>cs_event-set_odata_model - t_arg = value #( + t_arg = VALUE #( ( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` ) ( `TRAVEL` ) ) ) ). ``` @@ -114,7 +114,7 @@ In SAP contexts, OData services are often enriched with additional annotations. We can use these SAP annotations in our UI5 view to utilize backend translations via the property `label`. Here’s an example: ```abap -data(tab) = page->table( +DATA(tab) = page->table( items = `{TRAVEL>/Currency}` growing = abap_true ). @@ -134,7 +134,7 @@ client->view_display( tab->stringify( ) ). client->follow_up_action( client->_event_client( val = z2ui5_if_client=>cs_event-set_odata_model - t_arg = value #( + t_arg = VALUE #( ( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` ) ( `TRAVEL` ) ) ) ). ``` diff --git a/docs/development/model/tables.md b/docs/development/model/tables.md index dde0e24..a3016a4 100644 --- a/docs/development/model/tables.md +++ b/docs/development/model/tables.md @@ -22,7 +22,7 @@ CLASS z2ui5_cl_sample_tab IMPLEMENTATION. METHOD z2ui5_if_app~main. DO 100 TIMES. - INSERT value #( + INSERT VALUE #( count = sy-index value = `red` descr = `this is a description` ) INTO TABLE mt_itab. @@ -50,7 +50,7 @@ Making a table editable is a simple change. You just need to switch the binding METHOD z2ui5_if_app~main. DO 100 TIMES. - INSERT value #( + INSERT VALUE #( count = sy-index value = `red` descr = `this is a description` ) INTO TABLE mt_itab. diff --git a/docs/development/navigation/navigation.md b/docs/development/navigation/navigation.md index af7a7ab..514f0b4 100644 --- a/docs/development/navigation/navigation.md +++ b/docs/development/navigation/navigation.md @@ -10,7 +10,7 @@ In abap2UI5, each application is represented by a single ABAP class. While you c #### Backend To call an ABAP class, use the following code: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lo_app) = NEW z2ui5_cl_new_app( ). client->nav_app_call( lo_app ). @@ -19,7 +19,7 @@ ENDMETHOD. ``` The framework maintains a call stack. In the newly called class, you can return to the previous application using: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->nav_app_leave( ). @@ -27,7 +27,7 @@ ENDMETHOD. ``` If you need to access data from the previous application, use casting as follows: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. IF client->check_on_navigated( ). DATA(lo_called_app) = CAST z2ui5_cl_new_app( client->get_app_prev( ) ). @@ -38,7 +38,7 @@ ENDMETHOD. ``` To navigate to an application without adding it to the call stack, use: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lo_app) = NEW z2ui5_cl_new_app( ). client->nav_app_leave( lo_app ). diff --git a/docs/development/popups.md b/docs/development/popups.md index 4339733..f496b55 100644 --- a/docs/development/popups.md +++ b/docs/development/popups.md @@ -11,20 +11,20 @@ UI5 offers functionality for displaying popups and popovers that overlay only sp To display a popup, use the method `client->popup_display` instead of `client->view_display`: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( `Popup - Info` )->text( `this is an information shown in a popup` ). client->popup_display( lo_popup->stringify( ) ). -ENDMETHOD. + ENDMETHOD. ``` #### Flow Logic A common flow for using popups typically involves displaying a normal view, then showing a popup, and finally closing it. Here’s how to structure this: ```abap -METHOD Z2UI5_if_app~main. + METHOD z2ui5_if_app~main. IF client->check_on_init( ). DATA(lo_view) = z2ui5_cl_xml_view=>factory( @@ -39,7 +39,7 @@ METHOD Z2UI5_if_app~main. CASE client->get( )-event. WHEN `POPUP_OPEN`. - DATA(lo_popup) = Z2UI5_cl_xml_view=>factory_popup( + DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( `Popup` )->text( `this is a text in a popup` )->button( @@ -49,10 +49,10 @@ METHOD Z2UI5_if_app~main. WHEN `POPUP_CLOSE`. client->popup_destroy( ). - + ENDCASE. -ENDMETHOD. + ENDMETHOD. ``` #### Separated App @@ -60,20 +60,20 @@ For better source code structure, you can encapsulate popups in separate classes Check out the popup to confirm, for example: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - IF client->check_on_init( ). - client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ). - ENDIF. + IF client->check_on_init( ). + client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Can you confirm this?` ) ). + ENDIF. - CASE client->get( )-event. - WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed. - client->message_box_display( `the result is confirmed` ). - WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled. - client->message_box_display( `the result is rejected` ). - ENDCASE. + CASE client->get( )-event. + WHEN z2ui5_cl_pop_to_confirm=>cs_event-confirmed. + client->message_box_display( `the result is confirmed` ). + WHEN z2ui5_cl_pop_to_confirm=>cs_event-canceled. + client->message_box_display( `the result is rejected` ). + ENDCASE. -ENDMETHOD. + ENDMETHOD. ``` If you need to manage a stack of multiple popups, remember that abap2UI5 displays only one popup at a time on the frontend. However, you can maintain a popup stack in your backend logic and re-display the previous popup as needed. Check out `Z2UI5_CL_DEMO_APP_161`. @@ -81,7 +81,7 @@ If you need to manage a stack of multiple popups, remember that abap2UI5 display ### Popover To display a popover, use the method `client->popover_display` and specify the ID of the control where you want the popover to appear: ```abap -METHOD Z2UI5_if_app~main. + METHOD z2ui5_if_app~main. IF client->check_on_init( ). DATA(view) = z2ui5_cl_xml_view=>factory( @@ -98,7 +98,7 @@ METHOD Z2UI5_if_app~main. CASE client->get( )-event. WHEN `POPOVER_OPEN`. - DATA(popover) = Z2UI5_cl_xml_view=>factory_popup( + DATA(popover) = z2ui5_cl_xml_view=>factory_popup( )->popover( placement = `Left` )->text( `this is a popover` )->button( @@ -113,7 +113,7 @@ METHOD Z2UI5_if_app~main. client->popover_destroy( ). ENDCASE. -ENDMETHOD. + ENDMETHOD. ``` ### Built-in Popups diff --git a/docs/development/specific/barcodes.md b/docs/development/specific/barcodes.md index 6598886..613ee7a 100644 --- a/docs/development/specific/barcodes.md +++ b/docs/development/specific/barcodes.md @@ -16,9 +16,9 @@ This section provides all the information you need to get started easily. Since UI5 version 1.102, the `sap.ndc.BarcodeScannerButton` control is part of the UI5 library, making barcode scanning simple and straightforward. You can use the barcode scanner control like any other UI5 control with abap2UI5. Below is an example demonstrating basic functionality. You can customize the handling after the scanning event is triggered: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - data(lo_view) = z2ui5_cl_xml_view=>factory( + DATA(lo_view) = z2ui5_cl_xml_view=>factory( )->page( )->barcode_scanner_button( dialogtitle = `Barcode Scanner` diff --git a/docs/development/specific/cds.md b/docs/development/specific/cds.md index c2abf0b..c76d83d 100644 --- a/docs/development/specific/cds.md +++ b/docs/development/specific/cds.md @@ -87,7 +87,7 @@ ENDCLASS. The following example demonstrates how to create a sales order using `MODIFY` in an abap2UI5 application: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. MODIFY ENTITIES OF i_salesordertp ENTITY salesorder diff --git a/docs/development/specific/files.md b/docs/development/specific/files.md index 11f30ae..c75399d 100644 --- a/docs/development/specific/files.md +++ b/docs/development/specific/files.md @@ -18,7 +18,7 @@ CLASS z2ui5_cl_sample_upload DEFINITION PUBLIC. ENDCLASS. CLASS z2ui5_cl_sample_upload IMPLEMENTATION. - METHOD Z2UI5_if_app~main. + METHOD z2ui5_if_app~main. client->view_display( z2ui5_cl_xml_view=>factory( )->page( @@ -42,7 +42,7 @@ ENDCLASS. #### Download See also `Z2UI5_CL_DEMO_APP_186` ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->view_display( z2ui5_cl_xml_view=>factory( )->page( diff --git a/docs/development/specific/formatter.md b/docs/development/specific/formatter.md index 17479ed..ede7c62 100644 --- a/docs/development/specific/formatter.md +++ b/docs/development/specific/formatter.md @@ -53,51 +53,51 @@ CLASS z2ui5_cl_demo_app_067 IMPLEMENTATION. href = `https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency` )->label( `One field` )->input( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' \}| )->label( `Two field` )->input( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{showMeasure: false\} \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' , formatOptions: \{showMeasure: false\} \}| )->input( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{showNumber: false\} \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' , formatOptions: \{showNumber: false\} \}| )->label( `Default` )->text( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' \}| )->label( `preserveDecimals:false` - )->text( |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '| && client->_bind_edit( + )->text( |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `| && client->_bind_edit( val = currency path = abap_true ) && - |'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ preserveDecimals : false \} \}| + |`], type: 'sap.ui.model.type.Currency' , formatOptions: \{ preserveDecimals : false \} \}| )->label( `currencyCode:false` - )->text( |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '| && client->_bind_edit( + )->text( |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `| && client->_bind_edit( val = currency path = abap_true ) && - |'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ currencyCode : false \} \}| + |`], type: 'sap.ui.model.type.Currency' , formatOptions: \{ currencyCode : false \} \}| )->label( `style:'short'` )->text( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'short' \} \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'short' \} \}| )->label( `style:'long'` )->text( - |\{ parts: [ '{ client->_bind_edit( val = amount - path = abap_true ) }', '{ client->_bind_edit( + |\{ parts: [ `{ client->_bind_edit( val = amount + path = abap_true ) }`, `{ client->_bind_edit( val = currency - path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'long' \} \}| + path = abap_true ) }`], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'long' \} \}| )->label( `event` )->button( text = `send` press = client->_event( `BUTTON` ) ). @@ -115,9 +115,9 @@ CLASS z2ui5_cl_demo_app_067 IMPLEMENTATION. )->label( `Without leading Zeros` )->text( - text = |\{path : '{ client->_bind_edit( + text = |\{path : `{ client->_bind_edit( val = numeric - path = abap_true ) }', type : 'sap.ui.model.odata.type.String', constraints : \{ isDigitSequence : true \} \}| ). + path = abap_true ) }`, type : 'sap.ui.model.odata.type.String', constraints : \{ isDigitSequence : true \} \}| ). client->view_display( page->stringify( ) ). diff --git a/docs/development/specific/logging.md b/docs/development/specific/logging.md index b83ea51..2fca1b5 100644 --- a/docs/development/specific/logging.md +++ b/docs/development/specific/logging.md @@ -8,7 +8,7 @@ Logging is essential for developing end-user business processes. In ABAP systems ##### BAL Variables In ABAP classic, you can use the classic BAL function modules and display the BAL table with the popup `z2ui5_cl_pop_messages`: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lt_bal) = VALUE bal_t_msgr( ( msgid = `Z001` msgno = `001` msgty = `S` time_stmp = `21354` msgnumber = `01` ) @@ -22,7 +22,7 @@ ENDMETHOD. ##### ABAP Cloud In ABAP Cloud, you can directly pass the logging object into the popup: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lo_log) = cl_bali_log=>create( ). DATA(lo_msg) = cl_bali_message_setter=>create( @@ -48,7 +48,7 @@ ENDMETHOD. ##### abap-logger You also have the option to use the fantastic open-source project [**abap-logger**](https://github.com/ABAP-Logger/ABAP-Logger). This tool simplifies working with BAL logs and integrates seamlessly with abap2UI5. Here’s an example: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(log) = zcl_logger_factory=>create_log( desc = `ABAP Logger` ). log->e( `This is an error...` ). @@ -63,7 +63,7 @@ ENDMETHOD. Compared to message classes, BAL logs include more detailed information, such as timestamps. Use the specific BAL log popup to display this information. All the examples above can be used with the `z2ui5_cl_pop_bal` popup for a more detailed output, here’s an example for the abap-logger: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(lo_log) = zcl_logger_factory=>create_log( desc = `ABAP Logger` ). log->e( `This is an error...` ). diff --git a/docs/development/specific/url.md b/docs/development/specific/url.md index a32d3b1..ee54dd0 100644 --- a/docs/development/specific/url.md +++ b/docs/development/specific/url.md @@ -10,7 +10,7 @@ DATA(lv_search) = client->get( )-s_config-search. ### Open a new Tab The following action opens a new tab `target blank`: ```abap -data(lv_url) = `https://www.abap2UI5.org`. +DATA(lv_url) = `https://www.abap2UI5.org`. client->follow_up_action( client->_event_client( val = client->cs_event-open_new_tab t_arg = VALUE #( ( lv_url ) ) ) ). diff --git a/docs/development/specific/xlsx.md b/docs/development/specific/xlsx.md index 2dcdf4e..b88b5cc 100644 --- a/docs/development/specific/xlsx.md +++ b/docs/development/specific/xlsx.md @@ -22,25 +22,25 @@ CLASS z2ui5_cl_sample_upload DEFINITION PUBLIC. ENDCLASS. CLASS z2ui5_cl_sample_upload IMPLEMENTATION. - METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - client->view_display( z2ui5_cl_xml_view=>factory( - )->page( - )->_z2ui5( )->file_uploader( - value = client->_bind_edit( mv_value ) - path = client->_bind_edit( mv_path ) - placeholder = `filepath here...` - upload = client->_event( `UPLOAD` ) - )->stringify( ) ). + client->view_display( z2ui5_cl_xml_view=>factory( + )->page( + )->_z2ui5( )->file_uploader( + value = client->_bind_edit( mv_value ) + path = client->_bind_edit( mv_path ) + placeholder = `filepath here...` + upload = client->_event( `UPLOAD` ) + )->stringify( ) ). - IF client->get( )-event = `UPLOAD`. + IF client->get( )-event = `UPLOAD`. - data(lr_itab) = lcl_help=>itab_get_by_xlsx( mv_value ). - "further process with itab... - client->message_box_display( `xlsx uploaded` ). - ENDIF. + DATA(lr_itab) = lcl_help=>itab_get_by_xlsx( mv_value ). + "further process with itab... + client->message_box_display( `xlsx uploaded` ). + ENDIF. - ENDMETHOD. + ENDMETHOD. ENDCLASS. ``` @@ -121,16 +121,16 @@ ENDMETHOD. ``` ```abap [lcl_help] -class lcl_help DEFINITION. +CLASS lcl_help DEFINITION. -PUBLIC SECTION. + PUBLIC SECTION. CLASS-METHODS xlsx_get_by_itab IMPORTING VALUE(val) TYPE STANDARD TABLE RETURNING VALUE(result) TYPE string. -endclass. +ENDCLASS. CLASS lcl_help IMPLEMENTATION. @@ -183,7 +183,7 @@ Instead of using the above XLSX API (which may change between releases), conside ::: code-group ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->view_display( z2ui5_cl_xml_view=>factory( )->page( @@ -208,9 +208,9 @@ METHOD z2ui5_if_app~main. ( count = `3` value = `red` descr = `this is a description` ) ). DATA(lv_file) = lcl_help=>get_xlsx_by_itab( lt_tab ). - client->follow_up_action( val = client->_event_client( - val = client->cs_event-download_b64_file - t_arg = VALUE #( ( lv_file ) ( `test.xlsx` ) ) ) ). + client->follow_up_action( val = client->_event_client( + val = client->cs_event-download_b64_file + t_arg = VALUE #( ( lv_file ) ( `test.xlsx` ) ) ) ). ENDIF. ENDMETHOD. @@ -232,37 +232,36 @@ CLASS lcl_help IMPLEMENTATION. METHOD get_xlsx_by_itab. TRY. - DATA: lo_excel TYPE REF TO zcl_excel, - lo_writer TYPE REF TO zif_excel_writer, - lo_worksheet TYPE REF TO zcl_excel_worksheet. - - DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog, - ls_table_settings TYPE zexcel_s_table_settings. + DATA: lo_excel TYPE REF TO zcl_excel, + lo_writer TYPE REF TO zif_excel_writer, + lo_worksheet TYPE REF TO zcl_excel_worksheet. - " Creates active sheet - CREATE OBJECT lo_excel. + DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog, + ls_table_settings TYPE zexcel_s_table_settings. - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( `Internal table` ). + " Creates active sheet + CREATE OBJECT lo_excel. - lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = val ). - ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium5. - lo_worksheet->bind_table( ip_table = val - is_table_settings = ls_table_settings - it_field_catalog = lt_field_catalog ). + " Get active sheet + lo_worksheet = lo_excel->get_active_worksheet( ). + lo_worksheet->set_title( `Internal table` ). - lo_worksheet->freeze_panes( ip_num_rows = 1 ). + lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = val ). + ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium5. + lo_worksheet->bind_table( ip_table = val + is_table_settings = ls_table_settings + it_field_catalog = lt_field_catalog ). - CREATE OBJECT lo_writer TYPE zcl_excel_writer_2007. - DATA(lv_file) = lo_writer->write_file( lo_excel ). + lo_worksheet->freeze_panes( ip_num_rows = 1 ). - result = z2ui5_cl_util=>conv_encode_x_base64( lv_file ). - result = `data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,` && result. + CREATE OBJECT lo_writer TYPE zcl_excel_writer_2007. + DATA(lv_file) = lo_writer->write_file( lo_excel ). + result = z2ui5_cl_util=>conv_encode_x_base64( lv_file ). + result = `data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,` && result. - CATCH cx_root INTO DATA(x). - z2ui5_cL_util=>x_raise( x->get_text( ) ). + CATCH cx_root INTO DATA(x). + z2ui5_cL_util=>x_raise( x->get_text( ) ). ENDTRY. ENDMETHOD. ENDCLASS. diff --git a/docs/development/translation.md b/docs/development/translation.md index 093bda1..333829c 100644 --- a/docs/development/translation.md +++ b/docs/development/translation.md @@ -8,9 +8,9 @@ In UI5 apps, translations are typically managed through i18n files, with transla ### Text Element Messages can be translated using the ABAP text elements, making them available in different languages without changing the code: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - data(lv_msg_translated) = `this is a translatable message in english`(001). + DATA(lv_msg_translated) = `this is a translatable message in english`(001). client->message_box_display( lv_msg_translated ). ENDMETHOD. @@ -19,9 +19,9 @@ ENDMETHOD. ### Messages Messages are translated using message classes, ensuring that translations are managed centrally and can be maintained easily in different languages: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. - MESSAGE ID `NET` TYPE `I` NUMBER `001` into data(lv_msg_translated). + MESSAGE ID `NET` TYPE `I` NUMBER `001` INTO DATA(lv_msg_translated). client->message_box_display( lv_msg_translated ). ENDMETHOD. @@ -33,7 +33,7 @@ You can also retrieve and display the short, medium, or long descriptions of dat ::: code-group ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. DATA(ls_product_label) = lcl_help=>get_data_element_text( `PRODUCT` ). client->message_box_display( |{ ls_product_label-short }: 100 | ). @@ -41,7 +41,7 @@ METHOD z2ui5_if_app~main. ENDMETHOD. ``` -```abap [LCL_HELP] +```abap [lcl_help] CLASS lcl_help DEFINITION CREATE PUBLIC. diff --git a/docs/development/view.md b/docs/development/view.md index c21811e..8d347a3 100644 --- a/docs/development/view.md +++ b/docs/development/view.md @@ -4,7 +4,7 @@ outline: [2, 4] # View In abap2UI5, the output is generated by importing a UI5 XML View. Here’s a basic example: ```abap -METHOD z2ui5_if_app~main. + METHOD z2ui5_if_app~main. client->view_display( |