cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro inside iFrame open URL same window

kroly_horvth
Participant
0 Kudos

Hi,

In WebDynpro ABAP, not portal nor java, I have a public webdynpro app with an iFrame, inside that iFrame I have another private Webdynpro app which requires login. After login I would like to go to the private WebDynpro app, not inside the iFrame, but I want the private WebDynpro app to take over the entire window.

In a pure html link or javascript that would be '_top' target and I could include another iFrame with BSP and javascript to automatically redirect to the new URL.

How is this possible with WebDynpro, if even possible? Maybe an URL parameter in the Exit plug's url?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

kroly_horvth
Participant
0 Kudos

Hi,

I am using iFrame, because my requirements are like a portal:

- there is a public page, let's call it PublicWD.

- inside that public page there should be an area with login name/password, let's call it LoginWD.

- I use standard system login inside LoginWD, the users are communication users, so not a Z-table authentication.

It is the last point which forces me to use a separate webdynpro application with its separate URL inside the iFrame for LoginWD, to force the ifc_system_login window to appear. If I use a component only, there would be no separate authentication, the LoginWD would run under the same public user as the PublicWD.

Or if you think I can use my own webynpro fields instead of system login and do a real SAP user authentication in its action, after which the WD session will use that user, please share. I am sure there are function modules to switch from public user to the SAP user entered on the login WD, but I need guarantees that it is 100% WD supported and will not break any WD session handling.

Tudor Riscutia's sulution may help, but in that case the question is the same, how do I launch the application from the PublicWD using a user logged in inside the iFrame LoginWD.

Regards,

Charlie

former_member184578
Active Contributor
0 Kudos

Hi,

You can create a View with User ID/ PWD fields and use Function module SUSR_CHECK_LOGON_DATA to validate on Log on. You need to pass auth_method (P for password check), UserID and password.

Hope this helps u,

Regards,

Kiran

kroly_horvth
Participant
0 Kudos

Hi,

Thanks for your fast reply. Do you happen to know a function module which actually changes the session user, actually from the public user to the newly entered and validated user? I need the WD to be run as if it was originally logged in with the user in question as I use other authentication and righs data attached to that user.

Your help is appreciated,

Charlie

former_member184578
Active Contributor
0 Kudos

Hi,

Check FM SUSR_INTERNET_USERSWITCH which is restrictive(for service type users). I am not sure whether it works for your case! Or try FM TH_DELETE_USER to log off user session.

Hope this helps u,

Regards,

Kiran

kroly_horvth
Participant
0 Kudos

I checked it, unfortunately in our system all internet users are created as communication user in SAP, and this FM is for switching to dialog user only. For communication user I got logon data error, for dialog user I don't get an error.

I believe the solution will be to embed an iFrame in the LoginWD, inside that iFrame a BSP with javascript, which will call the LoginWD url in the _TOP window, meaning it that the LoginWD will occupy the whole area. It's ugly, but I have no other option.

Thanks for your help.

kroly_horvth
Participant
0 Kudos

Final solution became a hack. In the lightspeed.js the exit plug is going to document.location.href = url. I changed it to top.location.href, so the exit plug will not stay inside the frame, but goes to the whole window.

Thanks for your help.

Charlie

former_member184578
Active Contributor
0 Kudos

Hi,

That's a nice hack! Glad you could solve the issue.

Cheers,

Kiran

TudorRiscutia
Active Participant
0 Kudos

Interesting solution! Though, is this working in NWBC as well? Or just in IE?

Tudor

kroly_horvth
Participant
0 Kudos

It is working in all browsers as it is a simple pure javascript. Since NWBC is browser based it should work there too.

It is very dangerous however, as inside SAP this should be a standard modification, but because it is in the MIME library I was able to change it easily in a transport request. A single update patch can kill it and because this is a constantly updated part of the WebDynpro it will sure be killed.

former_member184578
Active Contributor
0 Kudos

Hi,

Embedding of Web Dynpro ABAP Application inside IFrame UI is not Supported.

You could achieve your requirement using Event Handling, but instead of IFrame UI( as it is not supported), use View Container UI and embed the View(Log On View) of Second Component in that. Then in onAction of Log on, Raise the event and handle it in your First Application.

For ex, you have WDA_COMP1( Main) and WDA_COMP2( which has Logon View, and want to embed in WDA_COMP1); Follow the below steps:

1. In WDA_COMP2: Go to Component Controller, Events Tab and create an Event, (say OUTER_EXIT) and select 'Interface' check box.

2. Go to Log on View, and in onAction of Log on, Fire the OUTER_EXIT event using below code:


DATA lr_componentcontroller TYPE REF TO ig_componentcontroller .

lr_componentcontroller = wd_this->get_componentcontroller_ctr( ).

lr_componentcontroller->fire_outer_exit_evt(

).

3. Now in WDA_COMP1, create component usage for WDA_COMP2.

4. Create View Container UI in Main View( and Embed the Log on View of COMP2 in window)

5. Create Controller usage( Interface controller) in Properties tab of Main View.

6. Create an Event Handler method for the event OUTER_EXIT of WDA_COMP2.

7. In the Event handler method write the code to Fire Exit Plug and pass the Private Application URL.

Hope this helps u,

Regards,

Kiran

TudorRiscutia
Active Participant
0 Kudos

Hi Karoly,

This might be quite difficult, as two WD applications cannot really share data. You can send some parameters to the second application if you launch it from the first (via URL), but afterwards, you cannot retrieve data, as the second WDA runs in a separate memory tread.

One solution to share this data is by using Shared Memory Area and Shared Memory Objects. You can find plenty tutorials about this on Google. The idea is, you need to somehow trigger the navigation in the bigger WDA from the embedded one. That's because WDDOMODIFY view is not called when you use the second WDA.

JavaScript is not a good solution in combination with Web Dynpro. Especially since some of the functionality might not work in NWBC because of browser compatibilities...

Tudor