Skip to content

Cheat Sheet ​

Two tables on one page. The first answers "which call do I need", the second lists the rules that decide whether an app works. Every row links to the page that explains it in full.

I Want To… ​

I want to…WriteMore
show the screenclient->view_display( view->stringify( ) )Building a View
show a value)->tag( `Text` )->a( n = `text` v = client->_bind( name ) )Binding
let the user edit a value)->tag( `Input` )->a( n = `value` v = client->_bind( name ) ) — the same _bind( ), what the user typed is in name on the next roundtripBinding
react to a button)->a( n = `press` v = client->_event( `SAVE` ) ), then ELSEIF client->check_on_event( `SAVE` ).Handling Events in ABAP
send a value with the eventclient->_event( val = `SHOW` arg = `${PRODUCT}` ), then client->get_event_arg( )Handling Events in ABAP
show a short messageclient->message_toast_display( `saved` )Message
show a message the user must closeclient->message_box_display( text = `not found` type = `error` )Message
open a popupclient->popup_display( popup->stringify( ) )Popup
close the popupclient->popup_destroy( )Popup
start another appclient->nav_app_call( NEW zcl_other_app( ) )Navigating Between Apps
go back to the calling appclient->nav_app_leave( )Navigating Between Apps
read what the sub-app leftCAST zcl_other_app( client->get_app_prev( ) )Navigating Between Apps
set the focusclient->follow_up_action( val = client->cs_event-set_focus t_arg = VALUE #( ( `id_input` ) ) )Focus
run main again after a delayclient->follow_up_action( val = client->cs_event-start_timer t_arg = VALUE #( ( `TICK` ) ( `2000` ) ) )Timer
copy a text to the clipboardclient->follow_up_action( val = client->cs_event-clipboard_copy t_arg = VALUE #( ( mv_text ) ) )Clipboard
open a URL in a new tabclient->follow_up_action( val = client->cs_event-open_new_tab t_arg = VALUE #( ( mv_url ) ) )URL Handling
show more than 100 table rowsclient->follow_up_action( val = client->cs_event-set_size_limit t_arg = VALUE #( ( `1000` ) ( client->cs_view-main ) ) )More than 100 Rows
send a file to the browserclient->follow_up_action( val = client->cs_event-download_b64_file t_arg = VALUE #( ( mv_data_url ) ( mv_file_name ) ) )Upload, Download

The value of an attribute goes into one of three parameters of a( ):

ParameterUse it forExample
va binding, an event, constant text)->a( n = `text` v = `Save` )
ban ABAP boolean)->a( n = `enabled` b = mv_edit_mode )
ttext that comes from data)->a( n = `title` t = ms_order-customer )

Golden Rules ​

RuleWhy it matters
Implement z2ui5_if_app and put everything in the single main methodIt is the only entry point the framework calls — on the initial load and on every user interaction → App Structure
Dispatch with one IF / ELSEIF chain over check_on_init( ), check_on_navigated( ) and check_on_event( )check_on_init( ) implies check_on_navigated( ), so init goes first; separate IF blocks let two branches run in the same roundtrip → App Structure
Always call view_display( ) in the check_on_navigated( ) branchAfter a sub-app returns via nav_app_leave( ), the browser still shows its view — without a re-display the user is left on a stale or blank screen → Navigation
Declare every attribute you bind in the PUBLIC SECTIONBinding works via dynamic ASSIGN and cannot reach PROTECTED / PRIVATE; the roundtrip fails with BINDING_ERROR → Binding
Keep state in attributes, not in local variablesBetween two events the app instance is serialized into the app draft on the SERVER and read back — attributes survive at any visibility; locals, DATA(...) declarations, open cursors and locks do not → Statefulness
Respect the UI5 aggregation rules even though the builder does not enforce themThe builder lets you nest anything inside anything; UI5 does not, and the mismatch surfaces as broken rendering rather than a syntax error → Building a View
Never use a deprecated UI5 controlIt renders today and vanishes on the next UI5 upgrade — and the XML is passed through unchanged, so nothing in the framework stops you → linter, which reports it against the release your system runs
Take a ready-made dialog from the popups add-on before building your ownConfirm, select, file up/download, ranges, PDF and about a dozen more, versioned on their own → popups add-on
Use backtick string literals (`)Project-wide convention in the framework, the samples and this documentation; keeps ABAP string handling consistent

An ABAP flag passed as v does not reach the view as a boolean

a( ) takes either v — any string expression — or b, an ABAP boolean. Only b converts, and it is the form to use whenever the value comes out of ABAP:

abap
    )->tag( `Button`
        )->a( n = `text`    v = `Save`
        )->a( n = `enabled` b = abap_false )   " → enabled="false"

Through v a bare flag does not compile, because v is a string and a c field is not type-compatible with it. A flag-valued expression such as xsdbool( … ) does compile and is written as it is: abap_true arrives in the view as enabled="X" and abap_false as an empty value. But X is not the true UI5 expects. There is no syntax error: the view renders, and on 1.71 the control is disabled.

A literal is a string and belongs in v, unquoted by any flag variable:

abap
    )->a( n = `enabled` v = `false` )

Any expression that yields a flag works in b, so there is no reason to convert by hand: )->a( n = `visible` b = xsdbool( lines( mt_item ) > 0 ) ).

Next Steps ​