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.
For ITS 6.20 standalone with i.e. R/3 Enterprise 4.7 the URL would be
http://ITS_HOST:ITS_PORT/scripts/wgate/webgui/!?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP
If you use SAP Netweaver 2004 or higher with integrated ITS the URL would be
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.
Comments (8)
Apr 17, 2007
Guillaume Garcia says:
Really useful !! Thanks. -- GuillaumeReally useful !!
Thanks.
--
Guillaume
Aug 31, 2007
Christian Schäfer says:
Great. I was searching for this because the old way of ITS doing this wasn't wor...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.
Aug 31, 2007
Klaus Layer says:
Sure. The official SAP note which describes the feature is 651600. Because it is...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
Feb 07, 2008
Gerald Kloimstein says:
Klaus, I found your wiki very useful. It works perfectly as long as we don't us...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
Feb 14, 2008
Klaus Layer says:
Hi Gerald, because ~redirectQS is being used in a redirect it is required ...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
Jun 25, 2008
Ian Stubbings says:
Hi I am trying to pass parameters to RECN which is an object based transaction....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
May 04, 2009
Rok Scuka says:
HI! Is there method to prefill fields of a screen with variables stored in ...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
Aug 23, 2011
Joyce Chan says:
Hi, This is very useful. Is it possible to pass multiple single values to a fi...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