cancel
Showing results for 
Search instead for 
Did you mean: 

Open URL in the same webdynpro using The LinkToURL UI element

former_member740482
Participant

Dear experts

I am testing creating an application Webdynpro abap that allow Open URL in the same webdynpro using The LinkToURL UI element

My requirement is create a Menu with several links that call URLs and I need that open in the same window

Menu

Link1

Link2

Link3

For this I am using The LinkToURL UI element :

I found this code in Internet:

Code to call a URL in same window

  data: lo_frontend_window type ref to ig_frontend_window,
        ld_url type string.
  lo_frontend_window =   wd_this->get_frontend_window_ctr( ).
  select single url
      from zurlconfig
      into ld_url
     where sysid eq sy-sysid.
  ld_url = '../../index.htm'.
  lo_frontend_window->fire_op_approver_plg(
*              close_window =  'X'
    url = ld_url   "close_window must be = ' '
  ).

My doubts:

1. ig_frontend_window, : I need know How to create o get reference?

Regards

former_member740482
Participant
0 Kudos

Hi sandra.rossi

Thank you,

I found this:

Call URL from SAP Webdynpro for ABAP (trailsap.com)

What other option can use to create a Menu of Links and this can be open in the same page?

Regards

Sandra_Rossi
Active Contributor
0 Kudos

I'm not expert but it depends on the page you want to open in the same page. If it's an external Web site, the most simple solution is to use an IFRAME.

former_member740482
Participant
0 Kudos

Hi Sandra

I need create a HomePage or Application in webdynpro ABAP where I can have several Links that call other applications Webdynpro

HOMEPAGE

Regards

Sandra_Rossi
Active Contributor
0 Kudos

Use LinkToAction for instance.

But as your question is about displaying a Web site inside your Web Dynpro, the priority for you is to check whether the external Web site permits to be displayed inside your IFRAME. Otherwise you must display it in an external window.

former_member740482
Participant
0 Kudos

Hi Sandra

Excuse . I am new with this Element UI . I share file step by step using LinkToAction UI Element

Step by step

With this steps What am I doing wrong?

Regards

Sandra_Rossi
Active Contributor
0 Kudos

Please use sap.com to ask your question, text and images are supported.

Anyway, it works the same as all other elements with an action (e.g. a button).

former_member740482
Participant
0 Kudos

Hi Sandra

I have created the Webdynpro component with a view and windows,

2. I add the controller for the current window to the view within the properties tab(i.e. in this example the current window is FRONTEND_WINDOW).

3. In the view MAIN, ROOTUIELEMENTCONTAINER Create a LinktoAction UI element on wdp views which points to a website URL

and added to the action the following code:

method ONACTIONCALL_URL .

data: lo_frontend_window type ref to ig_frontend_window,
ld_url type string.
lo_frontend_window = wd_this->get_frontend_window_ctr( ).

ld_url = 'https://www.google.com/'.
lo_frontend_window->fire_op_approver_plg(

url = ld_url "close_window must be = ' '
).

endmethod.

Regards

Sandra_Rossi
Active Contributor
0 Kudos

You have taken code from anywhere, without understanding if it's complete or not, without understanding how Web Dynpro works. If you fire an outbound plug with an argument, you must also define the corresponding parameter in the outbound plug. But then, to which other window/inbound plug did you link it? What are you trying to do now?

NB: just to say, Google cannot be used for testing IFRAME, it doesn't permit that ("... refused to connect")... You can only create an external window to display Google.

former_member740482
Participant
0 Kudos

Hi

google is only an example, but the idea is call an application WDA with this link in the same page.

miLink1 = https://hostname/sap/bc/webdynpro/sap/hress_a_ptarq_leavreq_appl

method ONACTIONCALL_URL .

data: lo_frontend_window type ref to ig_frontend_window,
ld_url type string.
lo_frontend_window = wd_this->get_frontend_window_ctr( ).

ld_url = 'https://hostname/sap/bc/webdynpro/sap/hress_a_ptarq_leavreq_appl'.
lo_frontend_window->fire_op_approver_plg(

url = ld_url "close_window must be = ' '
).

endmethod.

Regards

Sandra_Rossi
Active Contributor
0 Kudos

Firing an outbound plug is meaningless without mentioning what "custom thing" you want to do behind it.

As I said, I don't know what you're trying to do right now. What I understand from the discussion is that you want to investigate 2 options:

  • Try to display the external website in an IFRAME inside your Web Dynpro: this can be done for instance using LinkToAction + IFRAME (you don't need an outbound plug, you can display the website by using two lines of code). NB: for your tests, as of today, you may use https://www.wikipedia.org which permits to be displayed in an IFRAME.
  • If the external website doesn't permit to be displayed in an IFRAME, then use LinkToURL.
former_member740482
Participant

HI sandra.rossi

We is publishing some applications WDA as Mashup in Successfactor, in where this work fine , however SSFF not allow the option using role of hide some of this links by employee type(class).

Payroll Information block,

In the configuration in successfactor we only have the option by country of can add the URL of the application WDA, transaction that we want publish.

This are limitations of the Successfactor.

With this , I am trying of find a workaround of create a application custom and add in this application all the links(applications WDA in this application) and check in abap code the employee type(class) and with this hide the links that those employee can see,

My_ApplicationCustomWDA

Link1

Link2

Link3

...

and that when I from my application WDA custom call for example link1 that have associated the URL 'https://hostname/sap/bc/webdynpro/sap/hress_a_ptarq_leavreq_appl' this not is open in a page external

Regards

Sandra_Rossi
Active Contributor
0 Kudos

Thanks. I realize that your URL is another Web Dynpro (HRESS_A_*). If this Web Dynpro has an interface view which permits to be included in another Web Dynpro, if HRESS_A_* is reusable then using the URL is not the right option, instead you must define a Component Usage in your Web Dynpro. There are many questions about it in the forum.

Accepted Solutions (1)

Accepted Solutions (1)

turkaj
Active Participant
0 Kudos

HiParty,

No, that’s not possible because LinkToURL always opens a new window. However, what you can do is use the LinkToAction element instead. When you click on the LinkToAction, you can then display the content/URL in a WD IFrame.

An IFrame has an attribute called “Source”. In this attribute, you can enter a URL. I would bind it to a context element and make it dynamic


Process:

  1. Click on LinkToAction.
  2. LinkToAction executes the “onAction” method.
  3. In this method, you can set your URL for the WD IFrame.

This will give you the desired behavior.


Regards
Jim

Answers (0)