|Tiny Link: (useful for email)||https://wiki.scn.sap.com/wiki/x/Z1c|
Often it is desired to prefill fields of a screen and skip this screen by triggering an okcode. This article describes how to do this with webgui.
How to prefill fields and skip first screen with webgui?
Often it is desired to prefill fields of a screen and skip this screen by triggering an okcode. The SAP kernel provides a special okcode functionality which can be used with webgui and SAP GUI. You have to create a okcode with the following syntax:
If you i.e. use su01 to fill your user name, let us call it XYZ and then goto the Display screen of the transaction the notation would be as folllows:
in the transaction code field of Webgui or SAP GUI, the SU01 transaction will be started directly and will fill the 'User' field with value XYZ, where XYZ is ones user ID. You can also make use of this in the URL with the well known ~transaction parameter
After authenticating the user, the SAP system will automatically process the transaction and skip the first screen.
SAP Note 651600 - Starting applications with desktop shortcuts
Background information on the Skip Screen process
When starting a transaction with SKIP FIRST SCREEN the entry screen of that transaction is not displayed but processed in the background. It depends on what parameters are given to the transaction what happens next. This mechanism was judged to be somewhat risky in case of the transaction is started from "outside", i.e. via an URL or via a GUI shortcut.
There are two methods to control the usage of this SKIP mechanism.
The first method is simple: there is a table TSTCS which should contain all transaction codes which are allowed to be called with SKIP FIRST SCREEN from "outside". In case of a transaction code is not contained in that table, the processing is aborted with message 00 131 " "Skip Initial Screen" is not permitted for transaction xxxx ".
Table TSTCS can be maintained with transaction SM30 via view V_TSTCS.
This can be switched on or off with profile parameter dynp/checkskip1screen.
The second method is more sophisticated.
It uses also a white list, but this can be configured as "self learning" in the way that it registers the transactions which are allowed to be called. Moreover, in case of a transaction is not found in the white list, the mechanism can be configured so that the processing is not aborted in that case but a popup is displayed to the user informing him about the risk, and the user can decide whether he wants to process the transaction or not. If the user does not want to process the transaction, processing is aborted, otherwise the transaction is executed.
This method can be switched on or off with profile parameter dynp/confirmskip1screen.
The white list is named BC_CHECK_EXT_SKIP_FIRST_SCREEN and can be maintained and configured with transaction SLDW. See SAP Note 1956086.
It is not useful to activate both methods for the same purpose, i.e. set both profile parameters to OFF. Instead, it should be decided which method should be used to control the usage of SKIP FIRST SCREEN from outside, the simple or the more sophisticated one. Depending on that decision, the corresponding profile parameter should be set accordingly. The other should be set to OFF. Depending on what method s is chosen, either table TSTCS or the white list BC_CHECK_EXT_SKIP_FIRST_SCREEN must be maintained accordingly.
In case of either TSTCS or the white list BC_CHECK_EXT_SKIP_FIRST_SCREEN is maintained properly, no popups will be displayed anymore. So it depends on your decision and the settings in the system whether the popup is shown or not.
It is technically possible to switch off both methods, but this way there is no restriction to control for the usage of SKIP FIRST SCREEN from "outside".
If you call a WebGUI URL as per the following example to skip the first screen and you get a blank screen as a result, there are a few tips below in identifying what the issue is.
First recommendation. Test via A SAPGUI Shortcut.
It is important to do this as calling the following string example in the OkFieldCode (transaction field)in SAPGUI will result in success.
Why? This difference is outlined in SAP Note 1399324
The check as to whether or not users are allowed to start a transaction using the option "Skip Initial Screen" can be activated in a client-specific manner using this parameter.
This check is executed only if the transaction was started using a shortcut (SAP GUI for Windows), using a start transaction (SAP GUI for Java), or using a URL (SAP GUI for HTML).
This SAPGUI Shortcut passes the same parameters as the above STRING called in the OKFieldCode
If the SAPGUI Shortcut as per below screenshot does not result in success.
and one gets the following Status Bar Message.
"Skip Initial Screen" is not permitted for transaction SWNWIEX
The reason for this, is that the parameter dynp/checkskip1screen needs to be activated.
Also important to restart the system as the parameter dynp/checkskip1screen is NOT a dynamic parameter.
Once this is activated and the SAPGUI Shortcut works correctly by skipping the first screen in SAPGUI, then one should retest the WebGUI URL.
The Status Bar message will only be viewed via SAPGUI screen (but not via Webgui in the Browser when calling the parameters via a URL ) when attempting to launch the Shortcut
SAP Note 1399324 - Profile parameter dynp/checkskip1screen
SAP Note 2562022 - Error during execution of work item - "Skip Initial Screen" is not permitted for transaction
SAP Note 2999707 - Blank Screen when calling a transaction via URL in WebGUI
Further troubleshooting if dynp/checkskip1screen is activated
If the dynp/checkskip1screen is activated but now when you call the following URL
you get the following Warning POPUP (Text of the popup is listed in the right hand side pane of the table)
You are about to execute a link to an SAP
Do you want to continue executing this link?
Please check the following SAP Documentation: General Settings for Calling Transactions
The transaction(s) need to be added as exceptions in the table V_TSTCS.
The table V_TSTCS is client-specific, which means that the transaction must be entered in each affected client.
If the above entry in table V_TSTCS does not resolve.
Do a trace level 3 using the SM50 transaction on the WP TY. = DIA and select the following as per Screenshot below.
Then review the Work Process trace files in ST11 (important to reset the SM50 trace to level 1 after testing the Warning POPUP scenario)
If you see an entry similar to the following
Then one should check if the parameter dynp/confirmskip1screen should be set instead of dynp/checkskip1screen
If using the parameter dynp/confirmskip1screen please note that the white list is named BC_CHECK_EXT_SKIP_FIRST_SCREEN and this can be maintained and configured with transaction SLDW. See SAP Note 1956086.
See also the SAP Note 1956086 - Profile parameter for XSRF protection
which outlines in more detail how the additional profile parameter "dynp/confirmskip1screen" can be configured.
See also SAP Note 1922712 SLDW: FAQ: Supplementary notes for whitelist maintenance
Parameter ~okcode is obsolete for skipping screens
Many of you may know, that the parameter ~okcode provides a similar functionality with ITS 6.20. However it is not recommended anymore to use it for skipping screens. One reason is, that the solution discussed above provides much more performance because it avoids superfluous roundtrips between the SAP kernel an ITS 6.20. The other is that with SAP Netweaver 2004 and above the ~okcode syntax no longer works in any case. Therefore just forget screen skipping with ~okcode and make use of the method described above.
In a WebGUI context, one can also restrict execution of transactions and dynp_codes.
See SAP NOTE 1501768 - ITS: Config. permitted or prohibited OK codes during start
And the WIKI: Service Parameters for the Integrated ITS