cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Webdynpro application from report program

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member230839
Participant

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

Former Member
0 Kudos

Hi Anil,

Thanks for your reply.

When I used the code in se38, it throwed an error stating that "wd_comp_controller does not exists".

Mean while I tried using set parameter ID in se 38 and Get parameter Id in webdynpro. But I didnt get the value in webdynpro. Do have any idea that SET/GET parameter ID can be used in calling webdynpro.

Thanks in advance.

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.