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 com.sap.portal.appintegrator.sap.bwc.Transaction 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 ;