How to call a GUI transaction with parameters in SAP Fiori

0
21771

Dear SAPLearners, in this blog post we will learn how to call a GUI transaction with parameters in Fiori.

We already know how to configure GUI transaction as tile in SAP Fiori Launchpad, if you have not read yet check out the blog post here.

Lets say we have a requirement to call VA03 transaction for a specific sales order number and skip the initial screen. The similar requirement would be ME23n transaction with particular purchase order number.

We can achieve this requirement by configuring parameters in SAP Fiori Launchpad Designer. Lets get started

Here are the high level steps involved

  1. Create a wrapper transaction for VA03 or ME23N with selection parameters that takes order number.
  2. Configure the transaction in Fiori Launchpad Designer with Semantic Object and Action along with parameters.
  3. Launch the GUI transaction from another fiori app via Cross-app navigation.

Step-by-Step Procedure

1. Run SE38 transaction and create an executable program with below code

REPORT zsdui_call_va03.

PARAMETERS:
      p_vbeln TYPE vbeln_va.

SET PARAMETER ID 'AUN' FIELD p_vbeln.
CALL TRANSACTION 'VA03' WITH AUTHORITY-CHECK AND SKIP FIRST SCREEN.

2. Create a new transaction code for the above program in SE93.

Call GUI Transaction in Fiori Step1
Call GUI Transaction in Fiori Step2

3. Launch SAP Fiori Launchpad Designer and create a new “Target Mapping” with below details.

Call GUI Transaction in Fiori Step3

So in the above screen shot, what needs to be noticed is the parameters table.

4. Finally, lets write some cross-app navigation code to launch the transaction from another fiori application.

var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
var hashUrl = (oCrossAppNavigator && oCrossAppNavigator.hrefForExternal({
		target: {
			  semanticObject: "ZSALES",
			  action: "display"
		        },
			params : { "OrderNo" : "166" }
		}));
oCrossAppNavigator.toExternal({target: {shellHash: hashUrl}});

Congrats!! you have successfully learned how to call a GUI transaction with parameters in Fiori.

Please feel free to comment and let us know your feedback. Subscribe for more updates

If you liked it, please share it! Thanks!