diff --git a/README.md b/README.md index 0f001b08..7ab9c68b 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Development of UI5 Apps in pure ABAP. Follow this project on [twitter](https://t ### Project Features * easy to use – implement just one interface for a standalone UI5 application -* pure ABAP – development in 100% ABAP source code (no JavaScript, EML, DDL or Customizing) -* low system footprint - based on a plain http handler (no BSP, OData, BOPF, CDS, FE or RAP) +* pure ABAP – development in 100% ABAP source code (no JavaScript, DDL, EML or Customizing) +* low system footprint - based on a plain http handler (no BSP, OData, CDS, BOPF, FE or RAP) * cloud and on-premise ready – works with both language versions (ABAP for Cloud, Standard ABAP) * high system compatibility – runs on all available ABAP stacks (NW 7.02 to ABAP 2302) * easy installation – abapGit project, no additional app deployment needed @@ -32,7 +32,7 @@ Works with all available ABAP stacks and language versions: * S/4 Public Cloud ABAP Environment (ABAP for Cloud) * S/4 Private Cloud or On-Premise (ABAP for Cloud, Standard ABAP) * R/3 NetWeaver AS ABAP 7.50 or higher (Standard ABAP) -* R/3 NetWeaver AS ABAP 7.02 to 7.40 - use the low syntax [branch](https://github.com/oblomov-dev/ABAP2UI5/tree/main_v702) +* R/3 NetWeaver AS ABAP 7.02 to 7.42 - use the low syntax [branch](https://github.com/oblomov-dev/ABAP2UI5/tree/main_v702) Install with [abapGit](https://abapgit.org), create a new HTTP service and call abap2UI5 [(more information)](https://github.com/oblomov-dev/abap2ui5/wiki). diff --git a/src/00/z2ui5_cl_app_demo_00.clas.abap b/src/00/z2ui5_cl_app_demo_00.clas.abap index 5fbf6ef4..5e6a052f 100644 --- a/src/00/z2ui5_cl_app_demo_00.clas.abap +++ b/src/00/z2ui5_cl_app_demo_00.clas.abap @@ -44,10 +44,12 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. DATA(view) = client->factory_view( ). DATA(page) = view->page( title = 'abap2UI5 - Demo Section' + class = 'sapUiContentPadding sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer' navbuttontap = view->_event( 'BACK' ) ). page->header_content( + )->toolbar_spacer( )->link( text = 'SCN' href = 'https://blogs.sap.com/tag/abap2ui5/' )->link( text = 'Twitter' href = 'https://twitter.com/OblomovDev' )->link( text = 'GitHub' href = 'https://github.com/oblomov-dev/abap2ui5' ). @@ -65,7 +67,7 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. )->button( text = 'Layout (Header, Footer, Grid)' press = view->_event( 'z2ui5_cl_app_demo_10' ) )->button( text = 'Scrolling & Focus' press = view->_event( 'z2ui5_cl_app_demo_22' ) )->button( text = 'Popups' press = view->_event( 'Z2UI5_CL_APP_DEMO_21' ) - " )->button( text = 'Popups II (F4 Help)' press = view->_event( '0101' ) + )->button( text = 'Popups & Flow Logic' press = view->_event( 'z2ui5_cl_app_demo_12' ) ). grid->simple_form( 'HowTo - Selection-Screen' )->content( 'f' @@ -77,7 +79,7 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. grid->simple_form( 'HowTo - Tables' )->content( 'f' )->button( text = 'List' press = view->_event( 'z2ui5_cl_app_demo_03' ) )->button( text = 'Toolbar, Scroll Container' press = view->_event( 'z2ui5_cl_app_demo_06' ) - " )->button( text = 'Selection Modes' press = view->_event( 'z2ui5_cl_app_demo_19' ) + )->button( text = 'Selection Modes' press = view->_event( 'z2ui5_cl_app_demo_19' ) )->button( text = 'Editable' press = view->_event( 'z2ui5_cl_app_demo_11' ) ). @@ -86,7 +88,7 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. DATA(form) = grid->simple_form( 'Applications and Examples' )->vbox( ). form->flex_box( class = 'columns' - )->button( text = 'MIME Editor' press = view->_event( 'MIME_EDITOR' ) + )->button( text = 'MIME Editor' press = view->_event( 'Z2UI5_CL_APP_DEMO_14' ) )->get( )->layout_data( )->flex_item_data( @@ -102,7 +104,7 @@ CLASS z2ui5_cl_app_demo_00 IMPLEMENTATION. ). form->flex_box( class = 'columns' - )->button( text = 'Table Maintenance' press = view->_event( 'TABLE_MAINTENANCE' ) + )->button( text = 'Table Maintenance' press = view->_event( 'Z2UI5_CL_APP_DEMO_13' ) )->get( )->layout_data( )->flex_item_data( diff --git a/src/00/z2ui5_cl_app_demo_01.clas.abap b/src/00/z2ui5_cl_app_demo_01.clas.abap index 7f93d88c..5e669882 100644 --- a/src/00/z2ui5_cl_app_demo_01.clas.abap +++ b/src/00/z2ui5_cl_app_demo_01.clas.abap @@ -45,7 +45,7 @@ CLASS z2ui5_cl_app_demo_01 IMPLEMENTATION. )->label( 'quantity' )->input( view->_bind( quantity ) )->label( 'product' - )->input( value = product editable = abap_False + )->input( value = product enabled = abap_False )->button( text = 'post' press = view->_event( 'BUTTON_POST' ) ). ENDCASE. diff --git a/src/00/z2ui5_cl_app_demo_09.clas.abap b/src/00/z2ui5_cl_app_demo_09.clas.abap index 620cf465..5438b29c 100644 --- a/src/00/z2ui5_cl_app_demo_09.clas.abap +++ b/src/00/z2ui5_cl_app_demo_09.clas.abap @@ -82,7 +82,10 @@ CLASS z2ui5_cl_app_demo_09 IMPLEMENTATION. DATA(view) = client->factory_view( 'MAIN' ). DATA(page) = view->page( title = 'abap2UI5 - Value Help Examples' navbuttontap = view->_event( 'BACK' ) ). - page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). + page->header_content( + )->link( text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1637470531136921600' + )->link( text = 'Source_Code' href = client->get( )-s_request-url_source_code + ). DATA(grid) = page->grid( 'XL12 L12 M12 S12' )->content( 'l' ). diff --git a/src/00/z2ui5_cl_app_demo_11.clas.abap b/src/00/z2ui5_cl_app_demo_11.clas.abap index bf2a59a2..cd82120f 100644 --- a/src/00/z2ui5_cl_app_demo_11.clas.abap +++ b/src/00/z2ui5_cl_app_demo_11.clas.abap @@ -68,7 +68,10 @@ CLASS z2ui5_cl_app_demo_11 IMPLEMENTATION. DATA(view) = client->factory_view( ). DATA(page) = view->page( title = 'abap2UI5 - Tables and editable' navbuttontap = view->_event( 'BACK' ) ). - page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). + page->header_content( + )->link( text = 'Demo' href = 'https://twitter.com/OblomovDev/status/1630240894581608448' + )->link( text = 'Source_Code' href = client->get( )-s_request-url_source_code + ). diff --git a/src/00/z2ui5_cl_app_demo_12.clas.abap b/src/00/z2ui5_cl_app_demo_12.clas.abap index 42bae150..e812f8dd 100644 --- a/src/00/z2ui5_cl_app_demo_12.clas.abap +++ b/src/00/z2ui5_cl_app_demo_12.clas.abap @@ -4,21 +4,6 @@ CLASS z2ui5_cl_app_demo_12 DEFINITION PUBLIC. INTERFACES z2ui5_if_app. - - TYPES: - BEGIN OF ty_row, - title TYPE string, - value TYPE string, - descr TYPE string, - icon TYPE string, - info TYPE string, - checkbox TYPE abap_bool, - END OF ty_row. - - DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY. - - DATA mv_value TYPE string VALUE 'value'. - PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. @@ -32,85 +17,47 @@ CLASS z2ui5_cl_app_demo_12 IMPLEMENTATION. CASE client->get( )-lifecycle_method. - WHEN client->cs-lifecycle_method-on_init. - t_tab = REDUCE #( INIT ret = VALUE #( ) FOR n = 1 WHILE n < 11 NEXT ret = - VALUE #( BASE ret ( title = 'Hans' value = 'red' info = 'completed' descr = 'this is a description' checkbox = abap_true ) ) ). - - - WHEN client->cs-lifecycle_method-on_event. CASE client->get( )-event. - when 'POPUP_TO_DECIDE'. - - - - WHEN 'BUTTON_POPUP_DECIDE'. - - client->nav_app_call( z2ui5_cl_app_demo_20=>factory( - i_text = 'Do really want to continue?' - i_cancel_text = 'No' - i_cancel_event = 'POPUP_CONFIRM_NO' - i_confirm_text = 'Yes' - i_confirm_event = 'POPUP_CONFIRM_YES' ) - ). - - WHEN 'BUTTON_POPUP_SELECT'. - DATA(lo_popup_select) = z2ui5_cl_app_demo_23=>factory( - event_callback = 'POPUP_SELECT_RETURN' - i_tab = VALUE #( descr = 'this is a description' - ( title = 'title_01' value = 'value_01' ) - ( title = 'title_02' value = 'value_02' ) - ( title = 'title_03' value = 'value_03' ) - ( title = 'title_04' value = 'value_04' ) ) ). - client->nav_app_call( lo_popup_select ). - - WHEN 'POPUP_SELECT_RETURN'. - lo_popup_select = CAST z2ui5_cl_app_demo_23( client->get_app_by_id( client->get( )-id_prev_app ) ). - DELETE lo_popup_select->t_tab WHERE selkz <> abap_true. - client->popup_message_box( 'Entry selected: ' && lo_popup_select->t_tab[ 1 ]-title ). - - WHEN 'POPUP_CONFIRM_YES'. - client->popup_message_box( 'decide yes' ). - - WHEN 'POPUP_CONFIRM_NO'. - client->popup_message_box( 'decide no' ). - - WHEN 'F4HELP'. - client->popup_message_box( 'F4HELP' ). - WHEN 'BUTTON_POPUP_01'. - client->view_popup( 'BAL_POPUP' ). + client->view_popup( 'POPUP_DECIDE' ). + + WHEN 'POPUP_DECIDE_CONTINUE'. + client->popup_message_toast( 'continue pressed' ). + + WHEN 'POPUP_DECIDE_CANCEL'. + client->popup_message_toast( 'cancel pressed' ). WHEN 'BUTTON_POPUP_02'. client->view_show( 'MAIN' ). - client->view_popup( 'BAL_POPUP' ). + client->view_popup( 'POPUP_DECIDE' ). WHEN 'BUTTON_POPUP_03'. client->view_show( 'MAIN' ). - client->view_popup( 'BAL_POPUP2' ). + client->view_popup( 'POPUP_DECIDE_FRONTEND_CLOSE' ). WHEN 'BUTTON_POPUP_04'. client->set( set_prev_view = abap_true ). - client->view_popup( 'BAL_POPUP2' ). + client->view_popup( 'POPUP_DECIDE' ). WHEN 'BUTTON_POPUP_05'. client->nav_app_call( z2ui5_cl_app_demo_20=>factory( - - i_text = 'Do really want to continue?' - i_cancel_text = 'No' - i_cancel_event = 'POPUP_CONFIRM_NO' - i_confirm_text = 'Yes' - i_confirm_event = 'POPUP_CONFIRM_YES' ) - ). + i_text = '(new app )this is a popup to decide, the text is send from the previous app and the answer will be send back' + i_cancel_text = 'Cancel ' + i_cancel_event = 'POPUP_DECIDE_CANCEL' + i_confirm_text = 'Continue' + i_confirm_event = 'POPUP_DECIDE_CONTINUE' + i_check_show_previous_view = abap_false ) ). WHEN 'BUTTON_POPUP_06'. - " client->set( set_prev_view = abap_true ). - client->view_popup( 'POPUP_TABLE' ). - - WHEN 'POPUP_TABLE_SEND'. - client->popup_message_box( 'entries edited' ). + client->nav_app_call( z2ui5_cl_app_demo_20=>factory( + i_text = '(new app )this is a popup to decide, the text is send from the previous app and the answer will be send back' + i_cancel_text = 'Cancel' + i_cancel_event = 'POPUP_DECIDE_CANCEL' + i_confirm_text = 'Continue' + i_confirm_event = 'POPUP_DECIDE_CONTINUE' ) ). WHEN 'BACK'. client->nav_app_leave( client->get( )-id_prev_app_stack ). @@ -120,154 +67,66 @@ CLASS z2ui5_cl_app_demo_12 IMPLEMENTATION. WHEN client->cs-lifecycle_method-on_rendering. - DATA(view) = client->factory_view( ). + DATA(view) = client->factory_view( name = 'MAIN' ). DATA(page) = view->page( title = 'abap2UI5 - Popups' navbuttontap = view->_event( 'BACK' ) ). - page->header_content( )->link( text = 'Go to Source Code' href = client->get( )-s_request-url_source_code ). + page->header_content( )->link( text = 'Go to Source_Code' href = client->get( )-s_request-url_source_code ). - DATA(grid) = page->grid( 'L6 M12 S12' )->content( 'l' ). - - grid->simple_form( 'Input' )->content( 'f' - )->label( '01' - )->button( text = 'Popup to Decide' press = view->_event( 'POPUP_TO_DECIDE' ) - )->label( '02' - )->button( text = 'Popup Get Text Input' press = view->_event( 'POPUP_TO_TEXTAREA' ) - )->label( '03' - )->button( text = 'Popup Get Input Values' press = view->_event( 'POPUP_TO_INPUT' ) - )->label( '04' - )->button( text = 'Popup Get selected Entry' press = view->_event( 'POPUP_TO_SELECT' ) - )->label( '06' - )->button( text = 'Popup show BAL' press = view->_event( 'POPUP_TO_BAL' ) - ). - - - page->input( - value = view->_bind( mv_value ) - showvaluehelp = abap_true - valuehelprequest = view->_event( 'F4HELP' ) - ). - - page->button( - text = 'Popup new app - popup renderung, no view' - press = view->_event( 'BUTTON_POPUP_DECIDE' ) - ). - - page->button( - text = 'Popup same app - popup rendering, no view rendering' + DATA(grid) = page->grid( 'L7 M12 S12' )->content( 'l' ). + grid->simple_form( 'Popup in same App' )->content( 'f' + )->label( 'Demo' + )->button( + text = 'popup rendering, no background rendering' press = view->_event( 'BUTTON_POPUP_01' ) - ). - - page->button( - text = 'Popup same app - popup rendering, view rendering' + )->label( 'Demo' + )->button( + text = 'popup rendering, background rendering' press = view->_event( 'BUTTON_POPUP_02' ) - ). - - page->button( - text = 'Popup same app - popup rendering, view rendering - frontend close' + )->label( 'Demo' + )->button( + text = 'popup rendering, background rendering - close (no roundtrip)' press = view->_event( 'BUTTON_POPUP_03' ) - ). - - page->button( - text = 'Popup same app - popup rendering, view previous' - press = view->_event( 'BUTTON_POPUP_04' ) - ). - - - page->button( - text = 'Popup next app - popup rendering, view previous' - press = view->_event( 'BUTTON_POPUP_05' ) - ). - - page->button( - text = 'Popup select' - press = view->_event( 'BUTTON_POPUP_06' ) - ). - - - " client->set( focus = mv_value ). - - page->footer( )->overflow_toolbar( - )->toolbar_spacer( - )->button( - text = 'Send to Server' - press = view->_event( 'BUTTON_SEND' ) - type = 'Success' ). - - - + )->label( 'Demo' + )->button( + text = 'popup rendering, background rendering (previous view)' + press = view->_event( 'BUTTON_POPUP_04' ) ). + grid->simple_form( 'Popup in new App' )->content( 'f' + )->label( 'Demo' + )->button( text = 'popup rendering, no background' + press = view->_event( 'BUTTON_POPUP_05' ) + )->label( 'Demo' + )->button( + text = 'popup rendering, background rendering (previous view)' + press = view->_event( 'BUTTON_POPUP_06' ) ). view = client->factory_view( 'POPUP_DECIDE' ). - DATA(popup) = view->dialog( title = 'Popup - Decide' ). - - popup->text( text = 'this is a message' ). - popup->button( text = 'YES' press = view->_event( 'POPUP_CONFIRM_YES' ) ). - popup->button( text = 'NO' press = view->_event( 'POPUP_CONFIRM_NO' ) ). - - popup->footer( )->overflow_toolbar( + DATA(popup) = view->dialog( title = 'Popup - Decide' + )->vbox( )->text( text = 'this is a popup to decide, you have to make a decision now...' + )->get_parent( + )->footer( )->overflow_toolbar( )->toolbar_spacer( )->button( - text = 'Send to Server' - press = view->_event( 'BUTTON_SEND' ) - type = 'Success' ). + text = 'Cancel' + press = view->_event( 'POPUP_DECIDE_CANCEL' ) + )->button( + text = 'Continue' + press = view->_event( 'POPUP_DECIDE_CONTINUE' ) + type = 'Emphasized' ). + view = client->factory_view( 'POPUP_DECIDE_FRONTEND_CLOSE' ). - - - view = client->factory_view( 'BAL_POPUP2' ). - - popup = view->dialog( title = 'Example - ZZ2UI5_CL_APP_DEMO_07' ). - - popup->text( text = 'this popup frontend close' ). - popup->button( text = 'YES' press = view->_event( 'POPUP_CONFIRM_YES' ) ). - popup->button( text = 'NO' press = view->_event( 'POPUP_CONFIRM_NO' ) ). - - popup->footer( )->overflow_toolbar( + popup = view->dialog( title = 'Popup - Info' + )->vbox( )->text( text = 'this is an information, press close to go back to the main view without a server roundtrip' + )->get_parent( + )->footer( )->overflow_toolbar( )->toolbar_spacer( )->button( - text = 'frontend close' + text = 'close' press = view->_event_close_popup( ) - type = 'Success' ). + type = 'Emphasized' ). - - - - - - - - view = client->factory_view( 'POPUP_TABLE' ). - - popup = view->dialog( title = 'Example - ZZ2UI5_CL_APP_DEMO_07' ). - - DATA(tab) = popup->table( view->_bind( t_tab ) ). - - "set toolbar - tab->header_toolbar( )->overflow_toolbar( - )->title( 'title of the table' ). - - "set header - tab->columns( - )->column( )->text( 'Title' )->get_parent( - )->column( )->text( 'Color' )->get_parent( - )->column( )->text( 'Info' )->get_parent( - )->column( )->text( 'Description' )->get_parent( - )->column( )->text( 'Checkbox' ). - - tab->items( )->column_list_item( )->cells( - )->input( '{TITLE}' - )->input( '{VALUE}' - )->input( '{INFO}' - )->input( '{DESCR}' - )->checkbox( selected = '{CHECKBOX}' enabled = abap_true ). - - popup->footer( )->overflow_toolbar( - )->toolbar_spacer( - )->button( - text = 'Commit' - press = view->_event( 'POPUP_TABLE_SEND' ) - type = 'Success' ). ENDCASE. ENDMETHOD. diff --git a/src/00/z2ui5_cl_app_demo_18.clas.abap b/src/00/z2ui5_cl_app_demo_18.clas.abap index 13c28a9a..cc47dd1a 100644 --- a/src/00/z2ui5_cl_app_demo_18.clas.abap +++ b/src/00/z2ui5_cl_app_demo_18.clas.abap @@ -6,6 +6,19 @@ CLASS z2ui5_cl_app_demo_18 DEFINITION PUBLIC. DATA mv_path TYPE string. DATA mv_value TYPE string. + + TYPES: + BEGIN OF ty_file, + selkz TYPE abap_bool, + name TYPE string, + format TYPE string, + size TYPE string, + descr TYPE string, + data TYPE string, + END OF ty_file. + + DATA mt_file TYPE STANDARD TABLE OF ty_file WITH EMPTY KEY. + DATA ms_file TYPE ty_file. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. @@ -26,27 +39,25 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION. WHEN client->cs-lifecycle_method-on_event. * CASE client->get( )-event. -* -* WHEN 'DB_LOAD'. -* -* mv_editor = COND #( -* WHEN mv_path CS 'abap' THEN lcl_mime_api=>read_abap( ) -* WHEN mv_path CS 'json' THEN lcl_mime_api=>read_json( ) -* WHEN mv_path CS 'yaml' THEN lcl_mime_api=>read_yaml( ) -* WHEN mv_path CS 'text' THEN lcl_mime_api=>read_text( ) ). -* client->display_message_toast( 'Download successfull'). -* -* WHEN 'DB_SAVE'. -* lcl_mime_api=>save_data( mv_editor ). -* client->display_message_box( text = 'Upload successfull. File saved!' type = 'success' ). -* -* WHEN 'EDIT'. -* mv_check_editable = xsdbool( mv_check_editable = abap_False ). -* WHEN 'CLEAR'. -* mv_editor = ``. + + WHEN 'DISPLAY'. + ms_file = mt_file[ selkz = abap_true ]. WHEN 'UPLOAD'. - DATA(lv_dummy) = ''. + INSERT VALUE #( name = mv_path data = mv_value size = strlen( mv_value ) format = mv_value+5(5) ) INTO TABLE mt_file. + + WHEN 'TEXTAREA_CONFIRM'. + mt_file[ name = ms_file-name ] = ms_file. + CLEAR ms_file. + + WHEN 'POPUP_DESCR'. + ms_file = mt_file[ selkz = abap_true ]. + client->view_popup( 'POPUP_DESCR' ). + + WHEN 'POPUP_DATA'. + ms_file = mt_file[ selkz = abap_true ]. + client->view_popup( 'POPUP_DATA' ). + WHEN 'BACK'. client->nav_app_leave( client->get( )-id_prev_app_stack ). @@ -56,28 +67,91 @@ CLASS z2ui5_cl_app_demo_18 IMPLEMENTATION. DATA(view) = client->factory_view( 'VIEW_INPUT' ). DATA(page) = view->page( title = 'abap2UI5 - Upload/Download Files' navbuttontap = view->_event( 'BACK' ) ). - " DATA(grid) = page->grid( 'L12 M12 S12' )->content( 'l' ). - - DATA(lv_html_text) = `

subheader

link: link to sap.com - links open in a new window.

paragraph: strong and emphasized.

list:

  • list item 1
  • list item 2
  • pre:

    abc    def    ghi

    code: var el = document.getElementById("myId");

    cite: a reference to a source

    ` && - `
    definition:
    definition list of terms and descriptions
    `. - - page->vbox( 'sapUiSmallMargin' )->formatted_text( htmltext = lv_html_text ). page->zz_file_uploader( value = view->_bind( mv_value ) path = view->_bind( mv_path ) placeholder = 'filepath here...' - upload = view->_event( 'UPLOAD' ) - ). + upload = view->_event( 'UPLOAD' ) ). - IF mv_value IS NOT INITIAL. - page->zz_html( '