cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while calling WDApp from ABAP Report?

Former Member
0 Kudos

Dear All,

I am calling WD Application from ABAP Report. I am using following code. and it is working fine

But every time when executing it is asking Login details username and pwd. How to avoid this?? any helps.

*-- Local Variable declarations --*

DATA:gv_url_string TYPE string,

     gv_url_c(250) TYPE c.

*-- Constants --*

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='.

*-- Get the Url of Webdynpro Applicaion with HTTPS Protocol --*

CALL METHOD cl_wd_utilities=>construct_wd_url

  EXPORTING

    application_name = 'WDA'

    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 = aWDA'  

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.

DATA : no TYPE string.

       no =  '5000000066'.

*-- Attach the parameters and its value with the URL that

*-- have to be passed to WD application --*

  call method cl_http_server=>append_field_url

    exporting

      name  = 'ZNO'

      value = no

    changing

      url   = gv_url_string.

*-- Build the URL --*

CONCATENATE gv_url_string

            gc_login_auth

            gc_client sy-mandt

            gc_lang   sy-langu

  INTO gv_url_c.

*-- Calling WDABAP Application from 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.

Thanks,

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

UweFetzer_se38
Active Contributor
0 Kudos

Hi Venkat,

two possibilities:

  • the hard way: in your report you have to create SSO tickets before you call the browser
  • the easy way: let the system do all the work for you

CALL FUNCTION 'WDY_EXECUTE_IN_PLACE'

   EXPORTING

     internalmode        = ' '

     application         = 'YourWDApplicationName'

   EXCEPTIONS

     invalid_application = 1

     browser_not_started = 2

     action_cancelled    = 3

     OTHERS              = 4.

Best regards

Former Member
0 Kudos

Hi Fetzer,

Thanks for ur reply.

Using above FM it is working. but some times it is working without using this FM also, sometimes it is asking login

details.

Note : Using this FM also browser is opening, if i use both FM in browser two tabs are coming. using

CALL_BROWSER FM we can add url data. I have to send value to WD. Is there anyway to correct this... tabs.

Regards,

Venkat.

UweFetzer_se38
Active Contributor
0 Kudos

Hi Venkat,

the function module provides a parameter called "PARAMETERS" where you can pass the needed values to the application (internally it builds the URL parameters).

Regards

Uwe

Answers (2)

Answers (2)

varun_vadnala3
Active Participant
0 Kudos

Hello Venky,

Usually the username and password is asked,if the Basis/Security Pepole configure web service basic authentication.
Please check with the basis people.You can revert the configurations.

reward if helpful

regards,

Varun.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try to do the settings accordingly in SICF transaction.