Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

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

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 this with the ABAP editor SE38 and enter

*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP

in the transaction code field of webgui or SAP GUI, the ABAP editor will be started with directly showing the ABAP code of RSPARAM. 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=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP

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

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.

29 Comments

  1. Really useful !!
    Thanks.
    --
    Guillaume

  2. 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. Guest

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

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

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

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

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

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

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

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

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

                   

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

     

     

     

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