Saturday, December 18, 2010

Opening SAP Transaction Code in SAP GUI Window from WebDynpro through URL (Transactional iView)

Pre–requisite:

It is assumed that the reader of this article has some knowledge in WebDynpro and has a basic knowledge of Portal.

Requirement:

The Requirement is to open a SAP Transaction code from WebDynpro, and skip the first screen. The T-code should open in a SAP GUI Window and not in a Portal View.

Procedure:

We have to create a Transaction iView using Portal and use the URL to call SAP Transaction code from WebDynpro in a SAP GUI Window.

To create Transaction iView:

  1. Go to Content Administration à Portal Content.
  2. To create new iView, on the selected folder, Right clicks and select new à iView

  1. Select the radio button iView template and press Next in the following screen, to create an iView from an existing iView template (Transaction iView)

  1. Select the SAP Transaction iView button and continue with Next

  1. Give the following properties and continue with Next button.

  1. Select SAP GUI for Windows and continue with Next

  1. Select the appropriate system alias (Portal System)

Give the SAP Transaction code à IW33

Technique to Start SAP GUI for Windows: à SAP shortcut File

Hint: Trick to Open the GUI in a Separate Window use Shortcut Radio Button else the T-Code

Would open in a new Portal Screen

  1. The transaction iView for the given Transaction is created. Click Finish.

  1. To preview the transaction iView created, right click on the iView and choose Preview.

  1. Copy the URL
http://:50000/irj/servlet/prt/portal/prtmode/preview/prtroot/pcd!3aportal_content!
2fcom.test.testfolder!2fcom.test.Bill!2fcom.test.iViews!2fcom.test.iw33?sap-config-mode=true

To create Transaction iView:

  1. Create one WebDynpro Application ‘ZWD_WINDOW_URL’

  1. In the layout of the view V_MAIN, create a element “LINK_TO_ACTION” with ID as LINK.

  1. Give the Text as “Display Work Order” and Click on the On Action Create button and give the Action Name as LINK.

Hint: The detail are marked in RED what to be clicked and entered.

  1. Go the Method Tab and write the below Code in the method “ONACTIONLINK”

METHOD onactionlink.
  DATA: lo_window_manager TYPE REF TO if_wd_window_manager,
lo_api_component TYPE REF TO if_wd_component,
lo_window TYPE REF TO if_wd_window,
lv_workorder TYPE aufnr VALUE '0060105926',
lv_url TYPE string.
lo_api_component = wd_comp_controller->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).
* We have to Concatenate the URL as we cannot pass more than 255 Character as a * string.
CONCATENATE 'http://d://::50000/irj/servlet/prt/portal/prtmode/preview/'
'prtroot/pcd!3aportal_content!2fcom.test.testfolder!2fcom.TEST.Bill!'
'2fcom.hydroone.iViews!2fcom.TEST.iw33?'
'ApplicationParameter=CAUFVD-AUFNR='
lv_workorder
'&OkCode=/00&'
'sap-config-mode=true'
INTO lv_url.
  lo_window_manager->create_external_window(
EXPORTING
url = lv_url
RECEIVING


window = lo_window ).
  lo_window->open( ).
ENDMETHOD.  

Hint: If you want to skip the first screen, then we have to add the above marked code in the link to pass the screen value and skip the first screen.

'ApplicationParameter=CAUFVD-AUFNR=' è Screen Field name on the Selection Screen.

lv_workorder è The Value to be passed to the selection Screen

'&OkCode=/00&' è Sy-Ucomm value for the screen when press enter.

  1. Create a Web Dynpro application for your Web Dynpro component:

  1. Test your Web Dynpro application.


No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites