cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Call a URL which is a Javascript

Former Member
0 Likes
1,359

Hi All.

I know we CANNOT call javascript in Web dynpro abap.

I also know we can call a URL via calling external window and passing the URL.

We needed a functionality which requires a small piece of javascript code to be executed on click of any button. I have placed a javascript code in the portal server.

I was wondering if there could be a way to call a URL WITHOUT the external window - this would mean that I call my javascript URL whenever I want.

Thanks in adv for your patience.

View Entire Topic
Former Member
0 Likes

Hi Aishi Sharma,

if your WD app is running in a portal, maybe raising a portal event in the handler method of the WD button is an option. The receiver might well be a hidden iView. Just an idea.

Silke

Former Member
0 Likes

Thanks for the comments everyone.

SIlke, you said I could raise a portal event - that would be very nice if I could do it, only problem being I don't know how to do it. Can you send a code snippet please or some example on how it could be achieved?

abhimanyu_lagishetti7
Active Contributor
0 Likes

Abhi

Former Member
0 Likes

Hi Aishi,

a portal event is raised in WDA like this:

DATA lr_api_component  TYPE REF TO if_wd_component.
  DATA lr_portal_manager TYPE REF TO if_wd_portal_integration.
  DATA lv_event_parameter TYPE string.

  lr_api_component = wd_this->wd_get_api( ).
  lr_portal_manager = lr_api_component->get_portal_manager( ).
  IF lr_portal_manager IS NOT BOUND.
    RETURN.
  ENDIF.

  lv_event_parameter = 'somethingThatMakesSenseForTheEventReceiver'.

  lr_portal_manager->fire(
      portal_event_namespace = 'com.yournamesapce.etc.etc'
      portal_event_name      = 'yourEventName'
      portal_event_parameter = lv_event_parameter
  ).

The Link provided by Abhimanyu will provide you with the big picture. Have fun.

Silke