cancel
Showing results for 
Search instead for 
Did you mean: 

Call Webdynpro Application From a ABAP Program

Former Member
0 Kudos

Hi,

I have a Webdynpro application and I need to call this application from a ABAP program, sending a value from this program.

How can I call a Webdynpro and how send a parameter?

Thanks,

Martina.

Edited by: Gerle Martina on Feb 2, 2012 3:48 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi harshith_reddy,

thanks for your quick answer. Your code was very helpful!

But I still have problems with the parameters.

You sent me this link:

http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoreadURLparametersinWebDynprofor+ABAP

I built a function that opens a webdynpro application. In this webdynpro application i want see a table with all data sets, for example with the number '123' from another table. This number is a input parameter from my function and i wrote the parameter in the url.

But where at my webdynpro application am i able to pick out this parameter?

And is the methode 'HANDLEDEFAULT' from the sap wiki a methode from an inbound plug?

former_member199125
Active Contributor
0 Kudos

For reading application parameters check this

http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoreadURLparametersinWebDynprofor+ABAP

Regards

Srinivas

Former Member
0 Kudos

Hi Gerle Martina,

Pass your url parameter with name str and In the window find the eventhandler HANDLEDEFAULT

and declare importing parameter with same name as 'STR type string' and implement following code.


 methodHANDLEDEFAULT. 
data : value type string.
CALL METHOD wdevent->get_string
  EXPORTING
    name   = 'STR'
  receiving
    value  = value.
ENDMETHOD.

you have different methods in the class cl_wd_custom_event. You can use them depending on data type.

Answers (4)

Answers (4)

Former Member
0 Kudos

My problem is solved.

Thanks to all of you!

sahai
Contributor
0 Kudos

Hi,

>

> I have a Webdynpro application and I need to call this application from a ABAP program, sending a value from this program.

>

> How can I call a Webdynpro and how send a parameter?

>

> Thanks,

> Martina.

>

> Edited by: Gerle Martina on Feb 2, 2012 3:48 PM

hi,

Create a t-code for your application in wda and then use

call transaction 'TRANSACTION '.

Hope it helps

Regards,

Sahai.S

surajarafath
Contributor
0 Kudos

I know upto calling a webdynpro application from abap.

But not sure how to send parameters to it, i will be watching this thread for answer as well.

Go to Transaction SE93 ,and create a new transaction,(Transaction With Parameters)

In Default value tab, Give Transaction as "WDYID", tick skip initial screen.

and in the table

Name of the screen Field Value

APLLICATION <your_wed_dynpro_application_name>

STARTMODE <its optional> (Give 'GUI')

Former Member
0 Kudos

Hi Gerle,

This code opens a WD application from ABAP


DATA:gv_url_string TYPE string,
      gv_url_c TYPE string.
*     gv_url_c(250) TYPE c.

CONSTANTS:gc_login_auth TYPE string VALUE '?sap-system-login-basic_auth=X',
          gc_client     TYPE string VALUE '&sap-client=',
          gc_lang       TYPE string VALUE '&sap-language=',
          g_browser type string value 'INTERNET EXPLORER'.

***Get the Url of Webdynpro Applicaion with HTTPS Protocol
CALL METHOD cl_wd_utilities=>construct_wd_url
  EXPORTING
    application_name = 'ZWDA'   "your component name
    in_protocol      = 'HTTPS'
  IMPORTING
    out_absolute_url = gv_url_string.

***If the server and port have not got added, try without HTTPS Protocol
IF gv_url_string CS '//:/'.
  CALL METHOD cl_wd_utilities=>construct_wd_url
    EXPORTING
      application_name = 'ZWDA'
    IMPORTING
      out_absolute_url = gv_url_string.

***If server and port have still not got added
  IF gv_url_string CS '//:/'.
**Raise a Error Message
  ENDIF.
ENDIF.

***Build the URL
CONCATENATE gv_url_string
            gc_login_auth
            gc_client sy-mandt
            gc_lang   sy-langu
  INTO gv_url_c.

****Call the Browser
*CALL FUNCTION 'CALL_BROWSER'
*  EXPORTING
*    url                    = gv_url_c
*     EXCEPTIONS
*    frontend_not_supported = 1
*    frontend_error         = 2
*    prog_not_found         = 3
*    no_batch               = 4
*    unspecified_error      = 5
*    OTHERS                 = 6.

To pass parameter to WDA add the parameter to the url and follow the link to retrieve it in Webdynpro application

link : http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoreadURLparametersinWebDynprofor+ABAP