Developing UI5 Apps Purely in ABAP
Go to file
oblomov-dev 1fba55457c
session-stickyness (#1435)
* Added Component and Session Stateful (#1433)

- Added Component support (TODO refactoring sap.z2ui5 and view handling -> instead of .placeAt use mainView of component manifest)
- Added Session Stateful support

*add the following lines to your REST handler in order to support stateful session handling*
'''abap
    if attributes-stateful-switched = abap_true.
      server->set_session_stateful( stateful = attributes-stateful-active ).
    endif.
'''

And here is an ABAP example class for testing session handling
'''abap
"! <p class="shorttext synchronized" lang="en">Session Demo</p>
class z2ui5_cl_demo_app_session definition
  public
  create public.

  public section.
    interfaces z2ui5_if_app.
    data instance_counter type i read-only.
    data check_initialized type abap_bool read-only.
    data session_is_stateful type abap_bool read-only.
    data session_text type string read-only.
  protected section.
  private section.
    methods initialize_view
      importing
        client type ref to z2ui5_if_client.
    methods on_event
      importing
        client type ref to z2ui5_if_client.

    methods set_session_stateful
      importing
        client   type ref to z2ui5_if_client
        stateful type abap_bool.
endclass.

class z2ui5_cl_demo_app_session implementation.
  method z2ui5_if_app~main.
    if check_initialized = abap_false.
      check_initialized = abap_true.
      initialize_view( client ).
    endif.

    on_event( client ).
  endmethod.

  method initialize_view.
    set_session_stateful( client = client stateful = abap_true ).

    data(view) = z2ui5_cl_xml_view=>factory( ).

    data(page) = view->shell( )->page(
      title          = `abap2UI5 - Sample: Sticky Session`
      navbuttonpress = client->_event( 'BACK' )
      shownavbutton  = xsdbool( client->get( )-s_draft-id_prev_app_stack is not initial ) ).

    data(vbox) = page->vbox( ).
    vbox->info_label( text = client->_bind( session_text ) ).

    data(hbox) = vbox->hbox( alignitems = 'Center' ).
    hbox->label( text = 'press button to increment counter in backend session' class = 'sapUiTinyMarginEnd' ).
    hbox->button(
      text  = client->_bind( instance_counter )
      press = client->_event( 'INCREMENT' )
      type = 'Emphasized' ).

    hbox = vbox->hbox( ).
    hbox->button(
      text  = 'End session'
      press = client->_event( 'END_SESSION' ) ).

    hbox->button(
      text  = 'Start session again'
      press = client->_event( 'START_SESSION' ) ).

    client->view_display( view->stringify( ) ).
  endmethod.

  method on_event.
    case client->get( )-event.
      when 'BACK'.
        client->nav_app_leave( ).
      when 'INCREMENT'.
        instance_counter = lcl_static_container=>increment( ).
        client->view_model_update( ).
      when 'END_SESSION'.
        set_session_stateful( client = client stateful = abap_false ).
      when 'START_SESSION'.
        set_session_stateful( client = client stateful = abap_true ).
    endcase.
  endmethod.

  method set_session_stateful.
    client->set_session_stateful( stateful ).
    session_is_stateful = stateful.
    if stateful = abap_true.
      session_text = 'Session ON (stateful)'.
    else.
      session_text = 'Session OFF (stateless)'.
    endif.
    client->view_model_update( ).
  endmethod.
endclass.
'''

* Update z2ui5_cl_core_http_get.clas.abap (#1434)

updated to reflect latest changes (sorry some local changes were los)

* lint fix

* lint fix

* xml fix

---------

Co-authored-by: Michael Zinnöcker <29286643+mzinnoecker@users.noreply.github.com>
2024-09-16 16:45:41 +02:00
.github/workflows Update rename_test.yml (#1424) 2024-09-13 00:38:24 +02:00
ci session-stickyness (#1435) 2024-09-16 16:45:41 +02:00
src session-stickyness (#1435) 2024-09-16 16:45:41 +02:00
.abapgit.xml Update .abapgit.xml (#1043) 2024-03-26 04:50:20 -04:00
abaplint-app.json update_ci_configs (#1422) 2024-09-12 23:52:38 +02:00
changelog.txt Refactoring (#1326) 2024-08-24 17:07:25 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2023-06-27 09:42:09 +02:00
CONTRIBUTING.md update contribution (#472) 2023-08-08 22:22:10 +02:00
LICENSE Ui5 version (#761) 2024-01-05 13:50:20 +01:00
README.md Update README.md (#1432) 2024-09-16 08:11:58 +02:00



...offers a pure ABAP approach for developing UI5 apps - entirely without JavaScript, OData or RAP. Just like in the past, when a few lines of ABAP were enough to display input forms and tables using Selection Screens & ALVs. Designed with a minimal system footprint, it works in both on-premise and cloud environments.

Key Features

  • 100% ABAP: Developing purely in ABAP (no JavaScript, DDL, EML or Customizing)
  • User-Friendly: Implement a single interface to create a standalone UI5 application
  • Minimal System Footprint: Uses a simple HTTP handler (no BSP, OData, CDS or RAP)
  • Cloud & On-Premise Ready: Supports both ABAP Cloud and Standard ABAP
  • Broad System Compatibility: Runs on all ABAP releases (from NW 7.02 to ABAP Cloud)
  • Easy Installation: Install via abapGit, no additional app deployment required

Compatibility

  • BTP ABAP Environment (ABAP for Cloud)
  • S/4 Public Cloud (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.42: Use the downported repositories

References

Credits

This project greatly benefits from its contributors and supporting tools:

What's Next?

  • Quickstart Install and get started with your first abap2UI5 app
  • Samples Learn through hands-on examples and start building your own apps
  • Blogs - Dive into abap2UI5 blogs for in-depth insights
  • Addons Expand abap2UI5s capabilities to fit your needs
  • Connectors Seamlessly access your apps from anywhere
  • Apps Discover and try out abap2UI5 apps
  • Links Explore other projects using abap2UI5

Get Involved

We welcome all contributions! Share your knowledge, hunt for or fix bugs, submit a PR, write a comment, give us a like, or simply tell your friends how much you love abap2UI5. This project thrives on your support! 🚀