cancel
Showing results for 
Search instead for 
Did you mean: 

How to call transaction PC00_M10_CDTC from webdynpro?

siongchao_ng
Contributor
0 Kudos

Hi all,

I am newbie to webdypro. I need a step by step guidance on this. I have come across a solution by Vishal Kapoor as followed. But I need more elaboration on the steps.

1: Call below method to get host, port and protocol

cl_http_server=>if_http_server~get_location

2: concatenate protocol '://' host ':' port '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction='your tcode name' into url

3: get the window manager as we are opening t code in external window.

DATA lo_window_manager TYPE REF TO if_wd_window_manager.

DATA lo_api_component TYPE REF TO if_wd_component.

DATA lo_window TYPE REF TO if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

4: Call the url which we created above

lo_window_manager->create_external_window(

EXPORTING

url = url

RECEIVING

window = lo_window ).

The T code will be executed using the integrated ITS

Questions:

1. what ui element do i need? (link to url?)

2. Where do i put in this chunk of codes? ( create a abc method?)

3. How can I trigger this piece of code from the ui element? ( the connection/link between the ui element and method)

Thanks all in advance.

Edited by: Siong Chao on Mar 22, 2010 5:22 AM

Edited by: Siong Chao on Mar 22, 2010 5:25 AM

Accepted Solutions (1)

Accepted Solutions (1)

rameshkumar_ramasamy2
Participant
0 Kudos

Hi,

1. First decide when you have to call this transaction.. I mean which UI element must be used..ie whether on clicking a link ( either link to Action or Link to URL UI element ) or just need to call after a pressing a button(UI element ) likewise..

2. Suppose If you are using a link to action UI element, give some text in the Text property and create an event in OnAction method..

3. Double click that method and wrote the coding u want.. I mean as u mentioned before.. For example

i have used


   DATA LO_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .
  LO_COMPONENTCONTROLLER =   WD_THIS->GET_COMPONENTCONTROLLER_CTR( ).

    DATA LO_API_COMPONENTCONTROLLER TYPE REF TO IF_WD_COMPONENT.
    LO_API_COMPONENTCONTROLLER = LO_COMPONENTCONTROLLER->WD_GET_API( ).

  DATA LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.

  CALL METHOD LO_API_COMPONENTCONTROLLER->GET_WINDOW_MANAGER
    RECEIVING
      WINDOW_MANAGER = LO_WINDOW_MANAGER.

  DATA LO_WD_WINDOW TYPE REF TO IF_WD_WINDOW.

  CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
    EXPORTING
      URL           =
'http:<domain>/sap/bc/gui/sap/its/webgui?~TRANSACTION=<urtransaction name>'
     TITLE          = 'Display Material'
*    MODAL          = ABAP_FALSE
*    HAS_MENUBAR    = ABAP_TRUE
*    IS_RESIZABLE   = ABAP_TRUE
*    HAS_SCROLLBARS = ABAP_TRUE
*    HAS_STATUSBAR  = ABAP_TRUE
*    HAS_TOOLBAR    = ABAP_TRUE
*    HAS_LOCATION   = ABAP_TRUE
    RECEIVING
      WINDOW         = LO_WD_WINDOW.

  LO_WD_WINDOW->open( )
      .

Suppose if u want to create a Link to URL UI element.. Just create it and pass URL to the Reference Property of that.. Ur URl will automatically called in new window..

Answers (0)