This page gives some information on passing values to the initial screen of a transaction called from the Enterprise Portal. It discusses the workflow to do this as well as some potential issues you may face during the configuration.
This article will cover the following topics:
- General information on passing values for transactions.
- Determining the field name
- The ‘process first screen’ parameter
- Filling ranges
- Handling multiple values
- Investigating cases where the parameters are not passed
Many transactions allow you to pass the values for fields on the initial screen as URL parameters, so that these values can be automatically filled. For example, you can pass the user name and alias to the SU01 transaction, so that these fields are automatically filled when you call the transaction iView. You enter the field names and the values in the Application Parameters property of the transaction iView – separate field-value pairs with a ‘;’, like below:
Screenshot – Application Parameters field in Transaction iView
The next screenshot shows the result when entering the following in the ‘Application Parameters’ property of a transaction iView linking to transaction SU01:
Screenshot – SU01 with fields prefilled on initial screen
Filling a screen field from a transaction iView in this way is the same as specifying it in the command box after the transaction name. For instance, if you enter the command '/nsu01 USR02-BNAME=xyz' in the command box, you are taken to transaction SU01 with the screen field User already set to 'xyz'.
Screenshot - Entering '/nsu01 USR02-BNAME=xyz' in command field
For more information on entering parameters in the command to start a transaction, you can view SAP Note 103019 'SAPshortcut: Program parameters' .
Determining the Field Name
The field name you need to specify in the Application Parameters is the ‘Field Description for Batch Input’. Verify the screen field name by calling the transaction. Click in the field and press F1 to display the information for the field. Click on the Technical Information icon to display the technical information. The item of interest is the ‘Field Description for Batch Input’.
Screenshot - Field Information for User Field in SU01
Screenshot - Technical Information for User Field in SU01
The Process First Screen Parameter
Setting the parameter 'Process First Screen' to true in the transaction iView configuration simply results in an asterix being placed before the transaction name in the command passed to SAPGUI via the shortcut file or the SAP structured document generated by the portal. This command syntax informs the SAPGUI that the first screen should be processed automatically. If a value has been passed for all required fields, the initial screen (dynpro) of the transaction will be skipped. You can check the same thing by entering the following in the command field in SAPGUI for Windows directly: /n*SM12. Compare the result with using just /nSM12, where the initial screen is displayed.
Screenshot - Result when entering /nSM12 in Command bar
Many fields on the initial screens of transactions allow you to define a range rather than a single value. An example is ME23, which shows a long list of range parameters.
Screenshot - ME23 – Initial Screen
There are actually two fields (to define the start and end of the range) for each of these parameters, and they have different field names. To determine the appropriate field name, you need to view the technical information for both the start field and the end field. For example, to specify a range of values for the ‘Order’ parameter in transaction ME23 (as in the screenshot above), you would use the following in the application parameters:
Handling Multiple Values
Multiple values cannot be handled: by using SAP GUI Shortcuts it is only possible to transfer values into the dynpro fields which are actually displayed on the first screen of a transaction or report. Therefore it is only possible to fill values into the LOW or HIGH field of a select-option. It is not possible to fill multiple selections because this would require the processing of the pop-up for multiple selection data. So it will not work if you pass more than one value for the same field.
Investigating cases where the parameters are not passed
If you encounter an issue with passing parameters to a transaction via an iView, you should always first check the behaviour when calling the transaction directly. Filling a screen field via batch input is the same as specifying it in the command box after the transaction name. For instance, if you enter the command '/nsu01 USR02-BNAME=xyz' in the command box, you are taken to transaction SU01 with the screen field User already set to 'xyz'. Try calling the transaction in question directly in WinGUI with the parameter name and value specified after the transaction code - does it work? If not, the transaction may not accept batch input for this parameter.
For instance, transactions that act as a ‘wrapper’ to other transactions do not generally accept batch input. As described in SAP Note 103019 Chapter 3.2:
- *** For transactions like F-01, that call a native Transaction (FBM1) with default values for one or more screen fields, CANNOT be written to the corresponding field for the transaction call with parameter via OK-CODE as /n*F-01 BKPF-BUKRS=1000; Instead you must enter the following OK-CODE: /n*FBM1 BKPF-BUKRS=1000;
Other transactions can also not accept parameters via batch input for various technical reasons. If entering the parameters directly in the command field does not work, then it also cannot work when passing the parameters via a transaction iView.
SCN Blog ‘Passing Dynamic Parameters to Applications via the Application Integrator‘