Skip to Content

How to launch SAP transaction & pass parameters via URL

This is going to be one of my shortest weblog but it is going to provide quick help on creating a URL via Java to call a transaction and pass parameters to it.
Get the IPortalComponentURI object from IPortalComponentRequest object. Then get the url for from IPortalComponentURI.

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentURI componentURI = request.createPortalComponentURi();

Build the URL to call the transaction. In the following lines of code , i will build a URL which will call SE38 transaction and displaying the text elements of a particular program.

String url = componentURI.toString() + “?System=DEV&TCode=SE38&GuiType=WinGui&WinGui_Type=Shortcut&OkCode=SHOP&ApplicationParameter=RS38M-PROGRAMM=ZTEST001;RS38M-FUNC_TEXT=X”

Details of parameters in the above url

System -> You shuld pass the alias of the system you have defined
TCode -> Transaction you are calling
GuiType -> Can be WinGui, WebGui or JavaGui
WinGui_Type -> Shortcut ..if you want the Gui to launc outside of the portal
OkCode -> The OkCode that you want to be executed after the transcation is called by SAP Gui.
ApplicationParameter -> You use this pass values to your screen fields which needs to be be separated by ;

You must be Logged on to comment or reply to a post.
    • My weblog has nothing to do with ITS. If you read my weblog and Durairaj’s, you find anything similar in this two weblogs. My solution doesn’t talk about ITS at all. Please ready carefully before posting comments.
  • Quick and to the point, like that about your blog.  You can create an IView based on that sap.appintegrator you mentioned and accomplish the same linking result in the SAP Portal, but without writing any code…then let the admins do the maintenance.
    • Hi Alex,
          Thank you for the feedback. This code be used to build a system launch pad and that is what i am going to present in another weblog. I agree with you that it could be done via transaction iView configuration.

      thank you
      Prakash Singh

  • Hi Prakash,
    In this way the parameters I pass to the transaction iView are visible on the browser URL address bar.
    Is there a way to pass the parameters in a different way so they wont be visible ? (like POST method ?)


  • IPortalComponentURI componentURI = request.createPortalComponentURI();
              String url = componentURI.toString() + “?System=SAP_R3&TCode=RZ10&GuiType=WinGui&WinGui_Type=Shortcut” ;

    How do I include that URI to IPortalComponentResponse?

  • Hi!

    Congratulations on this blog. I’ts been very helpful!! it helped me to build a portal applications that calls some user prefered R/3 Transactions.

    I have a little inconvenient with this:

    When I open my R/3 system via Sap Logon, if I already have an open session it shows me a message indicating the action to take: Close the previous session or continue working with it.

    Question N. 1:
    When I Call any transaction via URL from the portal, is it possible to keep this behaviour??? (validate if I had another session opened)

    The URL looks like this:
    String url = componentURI.toString() + “?System=” + sysAlias + “&TCode=” + transac + “&GuiType=WinGui”;

    Question No. 2:
    I could have an internal counter, and if the user tries to open a new R/3 transaction, show an error.
    The thing is that I don’t know when the win gui window is closed. Is there a way of knowing this via Javascript??

    Thank you very much Pakrash!!

  • Hi Prakash,

    we have the same problem with the different behaviour of your solution unlike the SAP Logon Pad with open sessions (see question N.1 of Felipe Vieira).
    How is it possible to reach the behaviour of the SAP Logon Pad in this point (do not open two sessions with the same user at the same time).


  • Hi.

    Sorry for this perhaps superfluous question but I have to be sure: does it work the same with a link opening a BSP transaction iview? And is there always a specific OkCode or is there generic ones?

    Best regards
    Benny Lange

  • Dear Prakash,

    Thanks for this excellent article. Would you be able to provide any inputs on how we can achieve the same using NetWeaver EP – Java WebDynpro.

    We have the table with list of Transaction names (eg: se37) and I have the system details as well.

    The below snippet does not work for WebDynpro. What we want is exactly the same, but in WebDynpro.



  • Hello Prakash,
    This is indeed very useful and we have this working successfully in our development environment.

    My only question is when transporting from DEV to QA, our link still points back to the DEV system.

    Is there anyway are aware of of using a variable for the system. Like this when it is transported to QA the URL system variable would determine that it should point to QA not DEV?

    Any thoughts would be much appreciated.

    • Andrew, ideally you should have a floating system alias, which points to DEV on your dev portal and QA on your QA portal. For example, a lot of SAP supplied iViews assume aliases like SAP_R3_HumanResources etc.
  • Hi,

    my issue is very close to this blog.

    Does anybody know, how to dynamically call a transaction (iView) with (dynamic name and count of parameters passed) from an another web dynpro java application, which is also embedded as iview in portal?

    Thanks for your help!

    Regards Patrick.

  • Hi Prakash,

    perhaps you can tell me how I can change the LOGON LANGUAGE to the transaction using an URL-parameter.


    String url = componentURI.toString() + “?System=DEV&TCode=SE38&LANGUAGE=de”

    In this example LANGUAGE is a placeholder for the parametername, that I am searching for. Sadly i couldn’t find a documentation for the component, including a list with available parameters.

    Thanks in advance if you have any suggestions.


  • We created a transaction iview for a custom transaction and passing the portal user id to ecc program. if the program have the user id parameter enabled on the screen the value is being passed successfully. But if the userid field on screen is hidden it is not being passed…any solution for this..Thanks in advance..