Skip to Content
avatar image
Former Member

Calling Webdynpro application from report program

Hi All,

I am working with report program which displays ALV grid and if i select a row and click the button in application toolbar it should navigate to webdynpro application.

This webdynpro application should get loaded with the datas that i ve selected in the ALV output.

for eg., in alv display

select carrid connid

X 10 10

20 20

Webdynpro Application

carrid 10

connid 10

Kindly help me in acheving this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 25, 2009 at 12:53 PM

    Hi Kiruthika,

    You can open a webdynpro application with the follwing code example.

    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( ).
    
    DATA: URL TYPE STRING.
    CL_WD_UTILITIES=>CONSTRUCT_WD_URL(
    EXPORTING
    APPLICATION_NAME = comp_name " Webdynpro coponent name
    IMPORTING
    OUT_ABSOLUTE_URL = URL ).
    
    
    lo_window_manager = lo_api_component->get_window_manager( ).CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
      EXPORTING
        URL            = URL
        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_window.lo_window->open( ).

    if you want to add parameters so that the webdynpro application can get the values and display. Define two paramters at application level and assign those attributes with values in the URL like

    URL?carr_id=101&connid=200 like this.

    Regards,

    Anil kumar G

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      SET/GET parameters wont work in WD Envoirment, because WDA programs are executed in browser and that doesnt has a connection to SAP GUI.

      You may use the shared memory to transfer work area from the report program, and import the work area agin in the WDA in the WDDOINIT method of the controller where you want to set the fields.

      
      data: send type string.
      send = 'enter file name here'.
      export send TO shared memory indx(XY)  id 'wda'.
      
      CALL FUNCTION 'CALL_BROWSER'
       EXPORTING
         URL                          = 'http://SSR11S07.8000/sap/bc/webdynpro/sap/ztest_wda1 '.
      
      
      

      And in the WDDOINIT method of the controller, you may import the variable.

      
      data receive type string.
      import send = receive from shared memory indx(xy) id 'wda'.
      
      

      Then you may use the method set_attribute to set the value to respective UI element on the screen.

      Regards,

      Runal

  • avatar image
    Former Member
    Jun 25, 2009 at 01:04 PM

    Hi,

    You can do in this way..

    1.Create a parameter tcode for your web dynpro application.

    2.When you select a row from your ALV grid and clicked on button in tool bar call the paramter transaction code using CALL TRANSACTION TCODE.

    3.Now coming to the parameters you can set the values using EXPORT PARAMETER ID and set the value.

    4. In web dynpro application window handler(default) method IMPORT the value and then continue with your logic.

    Add comment
    10|10000 characters needed characters exceeded