Page tree
Skip to end of metadata
Go to start of metadata


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:

*<TCODE><SPACE>FIELD_1=VALUE_1;FIELD_2=VALUE_2.......FIELD_N=VALUE_N;DYNP_OKCODE=OKCODE

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:

*su01 SUID_ST_BNAME-BNAME=XYZ;DYNP_OKCODE=SHOW

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

http://WAS_HOST:WAS_PORT/sap/bc/gui/sap/its/webgui?~transaction=*su01 SUID_ST_BNAME-BNAME=XYZ;DYNP_OKCODE=SHOW

browser may convert certain characters once called via URL to the following notation

http://WAS_HOST:WAS_PORT/sap/bc/gui/sap/its/webgui?~transaction=%2Asu01%20SUID_ST_BNAME-BNAME%3DXYZ%3BDYNP_OKCODE%3DSHOW

CharHEX 
Space
%20
Semicolon ; %3B
Equals=%3D
Star*%2A

After authenticating the user, the SAP system will automatically process the transaction and skip the first screen.


See Also

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". 


Troubleshooting

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.

https://<myhost>:<myport>/sap/bc/gui/sap/its/webgui?&sap-client=100&sap-language=EN&sap-theme=sap_belize&~transaction=*SWNWIEX%20P_WI_ID=000000001234;P_APPL=UWL;P_ACTION=EXECUTE;DYNP_OKCODE=ONLI


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.

/n*SWNWIEX P_WI_ID=000000001234;P_APPL=UWL;P_ACTION=EXECUTE;DYNP_OKCODE=ONLI

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

See also

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

https://<myhost>:<myport>/sap/bc/gui/sap/its/webgui?&sap-client=100&sap-language=EN&sap-theme=sap_belize&~transaction=*SWNWIEX%20P_WI_ID=000000001234;P_APPL=UWL;P_ACTION=EXECUTE;DYNP_OKCODE=ONLI

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
transaction.
This transcation's first screen will be executed
"dark" with the data from the link. This means
this screen and the data will not be displayed
and the command given in the link will be
processed.
You get this popup because the link is either
not registered or categorized as critical in the
corresponding whitelist.
Please only continue executing the transaction
if you are sure about what it will actually do.

Do you want to continue executing this link?

YES NO


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


Trace Entrys
Y dyTxCheckXSRF
Y dyTxIsCheckXSRFActive: get value of dynp/confirmskip1screen
Y ... =ALL --> check in all clients active
Y Okcode= </N*SWNWIEX P_WI_ID=00000001234;P_APPL=UWL;P_ACTION=EXECUTE;
Y dyTxCheckXSRF: start transaction with skip first screen detected
Y dyCheckXRSFWhitelist: trying to call ABAP form
Y (message ohne Langtext)
Y ... XSRF check: transaction not in white list


Then one should check if the parameter dynp/confirmskip1screen is also set as well as dynp/checkskip1screen.

Important:  This is incorrect configuratio, must use only switch one of the two parameters to ON according toSAP Note 2999707. Never both!


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

Tip. If either parameter dynp/confirmskip1screen or dynp/checkskip1screen are set to 'ALL' in your system, i.e. they are switched ON in ALL clients.  

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


Fiori Launchpad - passing parameters

Check the Fiori App Library configuration section for a transactional app ( Application Type SAP GUI )

The App Launcher(s) and Target Mapping(s) contain parameters that can be used for this purpose when calling SAPGUI for HTML (WebGUI) apps via the FLP





29 Comments

  1. Really useful !!
    Thanks.
    --
    Guillaume

  2. Former Member

    Great. I was searching for this because the old way of ITS doing this wasn't working anymore with integrated ITS.

     Is this documented anywhere "officially"?

    Regards,
    Christian.

  3. Sure. The official SAP note which describes the feature is 651600. Because it is build into the SAP kernel it is valid for any GUI.

    Regards,

    Klaus 

  4. Unknown User (104zz09ry)

    Klaus,

    I found your wiki very useful. It works perfectly as long as we don't use single sign on. We use the service file SAPNTAUTH.SRVC as described in SAP note 361064. Instead of a redirect to service sapwp we redirect to the service webgui.

    SAPNTAUTH.SRVC provides the logon ticket for the user and then redirects the user to the desired service (in this case webgui.srvc). We pass the parameter ~redirectQS to sapntauth.srvc via the url: http://itsfrq/scripts/wgate/sapntauth/!?~redirectQS=~transaction=*vl71 RG_VBELN-LOW=80000380 

    This works fine yet, but we get an error message as soon we include a semicolon ";" in the url, e.g. http://itsfrq/scripts/wgate/sapntauth/!?~redirectQS=~transaction=*vl71 RG_VBELN-LOW=80000380;RG_KSCHL-LOW=ZLD0;DYNP_OKCODE=SHOP

    The error message is: client does not exist in system.

    Could you include any hint on SSO and passing query strings in your very useful wiki?

    Kind Regards,
    Gerald

    SAPNTAUTH.SRVC
    ###############################################
    # @Copyright SAP AG 2002
    # Example Service File for the Pluggable Authentication Service (PAS)
    #
    # Remark:The PAS Modul sapextauth must be included in ~xgateways in global.srvc
    # There are following types for PAS on ITS:
    #
    #         X509       --> ITS 4.6D (remark also note: 350776)
    #         NTLM       --> ITS 4.6D (remark also note: 361064)
    #         NTPassword --> ITS 4.6D (remark also note: 497532)
    #         LDAP       --> ITS 6.10 (remark also note: 509237)
    #         HTTP       --> ITS 4.6D (see note: 493107 and 494984)
    #         DLL        --> ITS 4.6D (remark also note: 535538)
    #
    # For detailed information see documentation (http://service.sap.com/security)
    ###############################################
    ~theme  99
    ###############################################
    # Module
    ~xgateway            sapextauth
    # possible settings   ->X509 , NTLM , NTPassword , LDAP , HTTP, DLL
    ~extauthtype         NTLM
    # For NTLM and NTPassword: NT , for X509: DN, for LDAP: LD,
    ~extid_type          NT
    #
    ###############################################
    # settings for PAS service self
    ~client                  002
    ~language                de
    #get a SSO2 Ticket
    ~mysapcomgetsso2cookie   1
    #converts the login input to upper case. Might useful for LDAP and NTPassword
    #if in doubt, set to 1 and maintain USREXTID mapping in caps.
    ~login_to_upcase         1
    #
    ###############################################
    # after external authentication
    # Hostname which should redirected
    ~redirectHost             itsfrq
    # path to another service
    ~redirectPath            /scripts/wgate/webgui/!
    #~redirectQS (Query String): ITS specific service parameters can be set there
    ~redirectHttps           0
    ~login_template          login
    # if 1, user get only a ticket, if there is no
    ~dont_recreate_ticket    1
    #
    ###############################################
    ~webgui_message_in_popup  0

  5. Hi Gerald,

    because ~redirectQS is being used in a redirect it is required to URL encode ";".  Please replace it by %3B. For other characters this might be required as well. You can find a complete list of URL encoded characters here http://www.degraeve.com/reference/urlencoding.php.

    Best regards,

    Klaus

  6. Unknown User (jxv416t)

    Hi

    I am trying to pass parameters to RECN which is an object based transaction. This solution appears not to work. Is there another method that I can use to pass paramaters to this transaction?

    Cheers

    Ian

  7. Unknown User (guzk5zs)

    HI!

    Is there method to prefill fields of a screen with variables stored in program variant?

    Is it possible to pass value from »variable name« (eg. stored in table TVARVC) instead of fixed values in URL?

    Best regards,

    Rok

  8. Unknown User (sa0hdpr)

    Hi,

    This is very useful.

    Is it possible to pass multiple single values to a field.

    http://<Server>:<Port>/sap/bc/gui/sap/its/webgui?&~transaction=<Tcode> <fieldA>-LOW=<value1>,<value2>;<fieldB>-LOW=<value3>;DYNP_OKCODE=OKCODE

    The underlined part of the above URL is the part that I am having problem with. Can you please provide an example if it is possible?

    Your help is greatly appreciated.

    Joyce

  9. Former Member

    Very useful.

  10. Hi Klaus,

    Actually we have upgraded the ECC to ehp7 from ehp5. the way to prefill and skip selection screen for a transaction was working fine in ehp5 but same code is not working fine in ehp7.

    It is bringing the selection screen of the transaction with the parameters values which we are passing in URL.

    What could have changed after upgrade or is there any setting to skip the initial screen?

     

     

    Thanks,

    Seema

    1. Hi Seema,

       

      Can you post this query in the ITS SCN Forum?

      http://scn.sap.com/community/its

      Can you include the URL that you are calling(remove the host name and port)

       

      Regards,

       

      Oisin

  11. Former Member

    Can you please tell me how to pass the data to second screen after skipping the first?

    Thanks in advance

    1. Hello Vishall,

       

      This is not possible. Can only skip the first screen.

       

      Regards,

       

      Oisín

  12. Former Member

    Note that if you're getting browser popups confirming the OK_CODE, you probably forgot to add the asterisk ("*") in front of the transaction.

  13. Former Member

    Hi Experts,

    I have a requirement where i have a link as shown below:

    Link1: etransaction=zhradmin&sap-client=211&sap-language=EN

    This will open up a report for the transaction code zhradmin. There is a selection screen parameter p_trip which needs to be pre filled once we click on the link. Can you please give the syntax to open the above link with pre populated selection screen field.

    I tried the syntax:

    Link 2: https://de20101.holding.loc:44301/sap/bc/gui/sap/its/webgui?%7etransaction=zhradmin&sap-client=211&sap-language=EN;p_trip=17

     

    this is not working, also this is a report transaction type. When we click on the Link 1 it is asking for user id & password, what do we need to do to skip the user log in screen.

    Any help is appreciated.

    1. Hi Sandip,

      first of all, don't forget the asterisk ("*") in front of the transaction when putting together the link. In addition the parameters should follow the transaction, and include also the okcode.
      Somehow like this:

      http(s)://<host.domain>:<port>/sap/bc/gui/sap/its/webgui?sap-client=211&sap-language=EN&%7etransaction=*zhradmin%20p_trip=17;DYNP_OKCODE=OKCODE

      If you would like to skip the logon screen, you can set up one of the SSO solutions like Kerberos: http://scn.sap.com/docs/DOC-40178 . (But this is just one example.)

      Regards, Zsombor

  14. Former Member

    Hi Zsombor,

    thanks for your reply.

    https://de20101.holding.loc:44301/sap/bc/gui/sap/its/webgui?etransaction=zhradmin&sap-client=211&sap-language=EN;&etransaction=*zhradmin%20p_trip=171;DYNP_OKCODE=OKCODE

    This link is also not working. It is just opening the Transaction but not defaulting the parameter p_trip.

    Can you please check and let me know if I  am doing anything wrong.

     

    1. Hi Sandip,

      please make sure it is also working in SAP GUI for WINDOWS by entering the okcode

      /*zhradmin p_trip=171;DYNP_OKCODE=OKCODE 

      or another example would be:

      /*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP 

      (Please also note: "DYNP_OKCODE=OKCODE" was just an example. I guess the program behind transaction zhradmin awaits some other ok_code (SY-UCOMM).)

      Regards, Zsombor

  15. Hello Klaus Layer,

    Can this technique be used to set the values on the second screen after skipping the initial screen? The url we have used is

    http://lasapdev11.absd.com:8000/sap/bc/personas/?~transaction=VA01 VBAK-AUART=ZFRE;KUAGV-KUNNR=1;VBKD-BSTKD=12&sap-personas-flavor=0050569A9C1C1ED6AAF8204E7C635037&sap-client=305&sap-language=EN&~okcode=/00

     

    it is skipping the initial screen of va01, setting the value of order type but we could not set the value of sold to party and po number on the second overview screen. Can this be possible to achieve via url parameters?

    Thanks

    Pooja

     

     

    1. Hi Pooja,

      no this is not possible. Only the first screen can be skipped.

      Regards,

      Klaus

      1. Hi,

        Thanks for the quick response,we are good to skip the intiial screen(which is happing using the above technique ), we don't want to skip any other screens but just wanted to set the values of sold-to-party and the po number on the overview screen(the screen came after skipping the intiial screen) via the url parameter.

        Is this is possible that we can set the value of the screen fileds present on any of screens using the url parameters?The above technique sets the value of the fields on the initial screen but could not set the values of the fields present on the second screen.

         

        Thanks

        Pooja

        1. You can fill fields and execute an okcode on the first screen. No more.

          1. Thanks Klaus Layer for the updation, I have a confusion now when i use the below url I am able to set the value of sold to party and PO number after skipping the first screen

            http://saprx11.absd.com:8000/sap/bc/personas/?&~transaction=VA01 VBAK-AUART=ZFRE&sap-personas-flavor=7E32313B492D1EE6ABB57788BA410007&sap-client=310&sap-language=EN&KUAGV-KUNNR=1&VBKD-BSTKD=12&VBAP-POSNR=10&RV45A-MABNR=408&~okcode=/00

             

            whereas when i use the url as stated in the original query this process does not happend.

            http://lasapdev11.absd.com:8000/sap/bc/personas/?~transaction=VA01 VBAK-AUART=ZFRE;KUAGV-KUNNR=1;VBKD-BSTKD=12&sap-personas-flavor=0050569A9C1C1ED6AAF8204E7C635037&sap-client=305&sap-language=EN&~okcode=/00

            The diference is because we moved from HP-UX to Linux and after that this stopped working.

            Do you have any idea if we need to do anything specific for parameter passing, after moving the OS ?


            We have already open a SAP incident but no useful reply from their side as well, a little help can solve our problem.


            Thanks

            Pooja


            1. Former Member

              Hi Pooja,

              Did you resolve your above query? even we are facing same .. For us it is working in linux with HANA db were as it is not working in HP-UX with ORACLE database. 

              We are able to populate values in all screens (first ,second and thrid..) in Linux OS with HANA database.

               

              Thanks,

              Reddy

              1. Hello Prudvi,

                 

                No we had to work with the workaround, the same url didn't worked for us in both the system despite the same configuration (sad). In your case the systems are different. In fact the same spl fields used in one url didnt work in other system, we need to look for the work arounds to concatenate and send the data.

                 

                Pooja

                1. Former Member

                  Hi Pooja,

                  Thanks for your quick response.

                  It's very strange in some systems it is working fine in some systems it's not working for second screen . Do I need to check anything related configuration in SICF ?

                  Thanks,

                  Reddy

                   

  16. Former Member

    Hi All,

    We are using SAP WEB GUI for MIR7 . I'm able to pass all values after skipping first screen  in MIR7 in ehp7 system. but I'm facing issue in S4 HANA in which it is not taking values in second screen . 

    I tried with ECC 6.0 incl. EHP6 values are not getting prefill in second screen. Do you have any idea whether it related SAP versions to populate data into screens.

     One system it is working fine and other system it is not working.

     

    Thanks,

    Prudvi M

     

     

     

  17. Hello Prudvi M,

     

    Can you open a question in https://answers.sap.com/

    Tag: UI WebGUI and Internet Transaction Server (ITS)

    Can you paste the FULL URL that you calling in the question so we can review the format of it + the S4 HANA versions

     

    Regards,

    Oisin

    1. Former Member

      Hi Oisin,

      Here you go with FULL URL in both system.

      http:HOSTNAME/sap/bc/gui/sap/its/webgui?sap-config-mode=true&~transaction=*MIR7%20BKPF-BUKRs=0000&DYNP_OKCODE=SHOP&INVFO-ZFBDT=18.05.2017&INVFO-ZUONR=assignment&INVFO-BKTXT=headertext&INVFO-BLDAT=17.04.2017&INVFO-XBLNR=Refernce&INVFO-SGTXT=TEXT&RM08M-EBELN=9000000000&sap-client=000&sap-language=EN

      Above URL is working fine in EHP7 with HANA Database.

      When I use above URL in S4 HANA it is not working for all screens in MIR7. I checked all Config . 

      NOTE: In S4 HANA & (ECC 6.0 incl. EHP6) prefill data is only working for first screen . 

      Regards,

      Reddy