Skip to Content
Technical Articles

Leveraging Launchpad Intent-based Navigation to Pass Custom Values to SAP Screen Personas Flavor Scripts

Introduction

The intent-based navigation for SAP Fiori launchpad can be used with Slipstream Engine to implement process workflows that pass information from external sources, such as SAP Fiori elements applications, to classical SAP GUI transactions. This article demonstrates how to do so by providing instructions for passing user ID information from an external application to transaction SU01 using a custom URL parameter with SAP Fiori launchpad.

Scenario

In general, intent-based navigation URLs for SAP Fiori launchpad use the following syntax:

#<semantic_object>-<action>?<semantic_object_parameter_0>=<value_0>&<semantic_object_parameter_1>=<value_1>&…&<semantic_object_parameter_n>=<value_n>

In this example, an SAP Fiori application uses the intent-based navigation API from SAP Fiori launchpad to pass dynamic user ID information via custom parameter to SU01 by calling a Slipstream Engine intent defined in the following format:

#ZUser-display?userId=<USER_ID>

Due to the custom parameter used to pass the ID information, it is not feasible to fill the Dynpro technical field automatically via the ~transaction parameter. The SAP Fiori launchpad resolves the intent #ZUser-display and executes the Slipstream Engine opening transaction SU01 with a flavor based on a pre-defined configuration. The SU01 flavor contains an onload script that reads the userId parameter value using the SAP Fiori launchpad shell API . The SAP Screen Personas scripting engine uses this script to automatically fill SU01 fields based on the custom parameter value.

Prerequisites

  • SAP Screen Personas SP08 or later (SP10 recommended) installed on the ABAP back-end system
  • For an on-premise SAP Fiori launchpad: SAP_UI component version 7.51 or above installed and configured on the ABAP Front-end system
  • SAP Fiori launchpad Designer access for users to create the target mappings
  • Completed Slipstream Engine on-premise SAP Fiori launchpad or Cloud Portal integration

Steps to Follow

1. Create a new SAP Screen Personas flavor for transaction SU01

Fig. 1 Creating new SAP Screen Personas flavor

 

2. Assign the following on-load event script to the SU01 Flavor

/*globals sap*/
var oAppLifeCycle, oApp, oComponent, oStartupParams, sUserId;
if(!sap.ushell){
	//The script executed outside FLP Shell, do nothing
	return;
}
//1) Get the Slipstream Engine Component instance

oAppLifeCycle = sap.ushell.Container.getService('AppLifeCycle');
oApp = oAppLifeCycle.getCurrentApplication();
oComponent = oApp && oApp.componentInstance;
if(!oComponent){
	return;
}

//2) Get the userId parameter value from the component startup data map
oStartupParams = oComponent.getComponentData().startupParameters;
sUserId = decodeURIComponent(oStartupParams.userId);


//3) Use the scripting API to display user
if(sUserId){
session.findById("wnd[0]/usr/ctxtSUID_ST_BNAME-BNAME").text = sUserId;
session.findById("wnd[0]/tbar[1]/btn[7]").press();
}

 

Fig. 2 Creating new script

 

Fig. 3 Assigning the on-load script to the flavor

 

3. Create the #ZUser-display SAP Fiori launchpad target mapping

Please refer to the documentation here for the procedure to create a generic Slipstream Engine target mapping that leverages the SAPUI5 Fiori App type. For this example, the following additional configuration steps are required:

  • Semantic object: ZUser
  • Action: display
  • Set the default value for transaction parameter to SU01
  • Set the default value for the sap-personas-flavor parameter to your SAP Screen Personas flavor ID created in the 1st step.
  • Add new parameter userId
Fig. 4 Coping the flavor ID

 

Fig. 5 Maintaining the target-mapping parameters

 

4. Test the Integration

Call the #ZUser-display?userId=<USER_ID>  navigation intent  and pass a valid SU01 user id:

https://<host>.<domain>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/Fiorilaunchpad.html#ZUser-display?userId=<USER_ID>

 

Fig. 6 Testing the #ZUser-display navigation intent

Additional Considerations

The onload script in the flavor requires access to the SAP Fiori launchpad frame document object. Therefore, please use the recommended SAPUI5 Fiori application type integration when setting up the target mapping.  Do note that this approach requires custom JavaScript coding that is not part of the officially supported SAP Screen Personas scripting API and will not work on other SAP GUIs.

Additionally, the custom parameter value strings should be URL encoded and validated.

Conclusion

Slipstream Engine can be effectively used to integrate classical transactions with other SAP and third-party applications by leveraging the Fiori launchpad intent-based navigation mechanism.

Resources

Intent-Based Navigation https://help.sap.com/viewer/52715f71adba4aaeb480d946c742d1f6/2.0.01/en-US/5ff538515a2a455696f9c203939d9360.html

Slipstream Engine Launchpad Integration https://help.sap.com/viewer/1024f4ede569495cb350a479fff49ad0/3.0.9/en-US/867fec94ece74b739bce07dbd9abca00.html

SAP Fiori Launchpad – FAQ for Slipstream Engine

https://wiki.scn.sap.com/wiki/display/Img/SAP+Fiori+Launchpad+-+FAQ+for+Slipstream+Engine

How to prefill fields and skip first screen with webgui? https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=22375

Be the first to leave a comment
You must be Logged on to comment or reply to a post.