Read Startup Parameters
what the tile passed in - client->get( )-t_comp_params
Z2UI5_CL_SMPS_APP_481
Stack
Launchpad
UI5 1.71
needs a system
needs a system. This sample is listed here because a sample somebody cannot find is worse than one they cannot run: a Fiori Launchpad with a tile pointing at abap2UI5. The ABAP is below; installed on a system that has what it needs, it runs there.
The facts
- Repository
- abap2UI5/samples-stack
- Class
Z2UI5_CL_SMPS_APP_481- Source file
z2ui5_cl_smps_app_481.clas.abap↗- Category
- Launchpad
- Minimum UI5
- 1.71 — the floor abap2UI5 holds its samples to
- In the playground
- needs a system — it opens for reading instead
- Runs on
- Cloud + Standard ≥ 7.40 SP08
Keywords: launchpad, fiori, flp, startup, parameters, intent
Controls it builds
- sap.m.Button
- sap.m.Label
- sap.m.MessageStrip
- sap.m.Page
- sap.m.Shell
- sap.ui.core.mvc.View
- sap.ui.layout.form.SimpleForm
Read out of the builder chain by the abap2UI5 linter, not from the category this sample is filed under — which is what makes “which samples build one of these” a question the catalogue can answer at all.
Libraries
The ABAP
z2ui5_cl_smps_app_481.clas.abap — 83 lines, on branch 09-launchpad
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords launchpad fiori flp startup parameters intent
" @summary what the tile passed in - client->get( )-t_comp_params
CLASS z2ui5_cl_smps_app_481 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smps_app_481 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
me->client = client.
IF client->check_on_init( ).
IF client->get( )-check_launchpad_active = abap_false.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.
view_display( ).
ELSEIF client->check_on_navigated( ).
view_display( ).
ELSEIF client->check_on_event( `READ_PARAMS` ).
DATA(text) = `Start Parameter: `.
DATA(t_params) = client->get( )-t_comp_params.
LOOP AT t_params INTO DATA(s_param).
text = |{ text } / { s_param-n } = { s_param-v }|.
ENDLOOP.
client->message_box_display( text ).
ENDIF.
ENDMETHOD.
METHOD view_display.
DATA(view) = z2ui5_cl_ui5_view_builder=>factory(
)->ele( n = `View` ns = `mvc`
)->a( n = `displayBlock` v = `true`
)->a( n = `height` v = `100%`
)->a( n = `xmlns` v = `sap.m`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns:core` v = `sap.ui.core`
)->a( n = `xmlns:form` v = `sap.ui.layout.form` ).
DATA(page) = view->ele( `Shell`
)->ele( `Page`
)->a( n = `showHeader` b = abap_false ).
page->tag( `MessageStrip`
)->a( n = `text` v = `Reads the startup parameters the Fiori Launchpad passed to this app ` &&
`tile (the ComponentData) via client->get( )-t_comp_params - start the ` &&
`tile with URL parameters to see them. Only works inside a launchpad.`
)->a( n = `type` v = `Information`
)->a( n = `showIcon` b = abap_true
)->a( n = `class` v = `sapUiSmallMargin` ).
page->ele( n = `SimpleForm` ns = `form`
)->a( n = `title` v = `Launchpad - Read Startup Parameters`
)->a( n = `editable` b = abap_true
)->ele( n = `content` ns = `form`
)->tag( `Label`
)->a( n = `text` v = ``
)->tag( `Button`
)->a( n = `press` v = client->_event( `READ_PARAMS` )
)->a( n = `text` v = `Read Parameters`
)->tag( `Label`
)->a( n = `text` v = ``
)->tag( `Button`
)->a( n = `press` v = client->_event_nav_app_leave( )
)->a( n = `text` v = `Go Back` ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in Launchpad
- Set Shell Title — follow_up_action( cs_event-set_title_launchpad )
- Cross-App Navigation Sender — hands two values over to another tile
- Cross-App Navigation Receiver — reads them back out of its startup parameters
On this page