cancel
Showing results for 
Search instead for 
Did you mean: 

Call webdynpro from dynpro

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

We received a requirement in which we need to call an existing webdynpro ABAP application from a list in an existing dynpro. Once the user is finished working with the webdynpro, the list should be shown again and it should be in the same state as before the webdynpro was launched. We imagined that this could be accomplished by either running the webdynpro full-screen or in a pop-up. In case of a pop-up, users should not be able to change the selected line in the list, preferably by using a modal pop-up window.

We have had a look at:

Running a Webdynpro from SAPGui

This was our first though and provides all the things we need, the biggest problem here is that it is not supported according to SAP Note 989286. Unfortunately, the note isn't very specific about what exactly is not supported. And although and we don't intend to share LUW between the Dynpro and Webdynpro and the activities in the webdynpro won't affect the data displayed in the dynpro, we are not sure if that would lead to a supported solution.

Rolling out NWBC for all user tasks

This is not preferred as we really donu2019t want our relatively small project to be the reason for a complete transition to NWBC. However, if it can solve this issue, it might still be an option for a selected number of users. In our efforts to find a solution, we only managed to call the webdynpro in a completley new NWBC session, but this might be our inexperience with NWBC. The calls were made by cl_nwbc->launch_url(). The bigger problem is that the new window showing the webdynpro isn't modal.

Calling NWBC for Webdynpro from SAPGUI, so NWBC will only be used for our Webdynpro solution

This works fine functionality wise. Preferably we would have called an app window, but this opens a main window anyway. Unfortunately, we can't get NWBC to run modal again.

We're quite desperate for a solution. Any feedback is more than welcome!

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

When you say Running a Webdynpro from SAPGui, what exactly do you mean. Do you just mean launching the Web Dynpro in a new browser window independent of the SAPGUI using one of the two techniques already suggested in this thread? If so that shouldn't be a problem. The note reference is really referring to running the WDA embedded in the HTML control of the SAPGUI. This is where you run into problems with the session management. Of course calling WDA in a new browser window you aren't going to be modal either, which seems to be a concern in your other two options.

There really isn't a support approach that allows the WDA to open modal to the SAPGUI screen even with the NWBC. That just isn't the design pattern. Anything you launch from a dynpro in this matter will be a new window with its own lifetime. In NWBC 4.0 (coming later this year) you could launch the WDA as a separate tab in the same NWBC window. It still won't really be modal, but my feel more that way to the user since its just a separate tab.

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks so much for the replies. As for u201Crunning a webdynpro from SAPGuiu201D I meant running the webdynpro inplace in a HTML GUI Control. In our scenario the GUI will only be the container for the webdynpro, no task other then go back/exit will be performed in the GUI session. All transaction tasks will be performed in the Webdynpro. Will the session management problems you refer to also occur in such a simplistic scenario? What problems exactly?

To elaborate a bit more on the requirements in the scenario. The sapgui transaction we start from is a patientlist used for multiple tasks and can not easily be converted to a ABAP webdynpro. For patient X our Webdynpro is started from the list, it is extremely important that the user can not u201Cnavigateu201D to patient Y in the list and still have patient X active in the ABAP Webdynpro window. Doing so could lead to serious consequences for the patients wellbeing. This is why we need a u201Cmodalu201D window or move back and forth in the same window.

Regards,

Jan

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Will the session management problems you refer to also occur in such a simplistic scenario? What problems exactly?

Yes the session management I mentioned will be a problem. Basically when running in the HTML control of the SAPGUI, the Web Dynpro session management doesn't work as intended. This means that the server session stays alive when you navigate way. This will lead to excess resources being consumed and locks being retained. This is the primary reason that SAPGUI integration is not supported.

In generally I'm struggleing to come up with an alternative that allows WDA be a modal window over SAPGUI. The only supported approachs I can think of to WDA being modal is if the parent window is also WDA.

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Thomas,

We have looked a little further at the inplace scenario and found that for all thinkable situations sessions and locks are closed nicely. Would you know a situation in which a session or lock is not freed up?

Regards,

Jan Penninkhof

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Hi Thomas,

>

> We have looked a little further at the inplace scenario and found that for all thinkable situations sessions and locks are closed nicely. Would you know a situation in which a session or lock is not freed up?

>

> Regards,

> Jan Penninkhof

I do not know of a particluar situation, only the statement from development that if you do find such a situation they will not support it - ie provide a fix.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Jan,

I was able to open WebDynpro Application from Dynpro Using CL_GUI_HTML_VIEWER.

Please try the following:


 data : custom type ref to cl_gui_custom_container.
 data : lr_html type ref to cl_gui_html_viewer.


  Call screen 0001 STARTING AT 10 10.

  CREATE OBJECT CUSTOM
    EXPORTING
      container_name     = 'CUSTOM'.

create object lr_html
  exporting
*    shellstyle         =
    parent             = CUSTOM
*    lifetime           = lifetime_default
*    saphtmlp           =
*    uiflag             =
*    name               =
*    saphttp            =
*    query_table_disabled = ''
*  exceptions
*    cntl_error         = 1
*    cntl_install_error = 2
*    dp_install_error   = 3
*    dp_error           = 4
*    others             = 5
    .
call method lr_html->show_url
  exporting
    url                    =  URL   "Pass your WDA URL here
*    frame                  =
*    in_place               = ' X'
*  exceptions
*    cntl_error             = 1
*    cnht_error_not_allowed = 2
*    cnht_error_parameter   = 3
*    dp_error_general       = 4
*    others                 = 5
        .

Give this into your PBO module and check.

You can open it as a modal dialogue window.

After performing required actions you can navigate back using a button in the same screen.

Hope this helps you.

Edited by: harshith_reddy on Jan 20, 2012 1:08 PM

Edited by: harshith_reddy on Jan 20, 2012 1:14 PM

Former Member
0 Kudos

Hi ,

Hope this may help you out.



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


***Get the Url of Webdynpro Applicaion with HTTPS Protocol
CALL METHOD cl_wd_utilities=>construct_wd_url
  EXPORTING
    application_name = 'ZWDA'
    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 METHOD cl_gui_frontend_services=>execute
  EXPORTING
*    document               =
    application            = 'IEXPLORE'
    parameter              = gv_url_c
*    default_directory      =
*    maximized              =
*    minimized              =
*    synchronous            =
    operation              = 'OPEN'
*  EXCEPTIONS
*    cntl_error             = 1
*    error_no_gui           = 2
*    bad_parameter          = 3
*    file_not_found         = 4
*    path_not_found         = 5
*    file_extension_unknown = 6
*    error_execute_failed   = 7
*    synchronous_failed     = 8
*    not_supported_by_gui   = 9
*    others                 = 10
        .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope you can try out with some options in the execute method.

former_member184578
Active Contributor
0 Kudos

Hi Jan,

If I understood your requirement clearly, You want to call an existing Web Dynpro ABAP Application from Dynpro program.!

Try this,

Ley say onclick of buttton or hotspot in list,

* Get the URL of the to be called application
      call method cl_wd_utilities=>construct_wd_url
        exporting
        application_name              = 'ZWD_CALLING_APP'  " Name of your web dynpro application
      importing
        out_absolute_url              = lv_url.     " this will give the complete url

Now call this Web dynpro Application using this FM

CALL FUNCTION 'CALL_BROWSER'
EXPORTING
URL = lv_url.

This will open your web dynpro application in browser from your dynpro. Once you process your Web dynpro Application, You can close the application window and your list in Dynro still remains Same..!!

Hope this helps u.,

Thanks & Regards,

Kiran.

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks for trying to help, really appreciate it. My preferred way would also be to call ABAP webdynpro from a button or hotspot in the list. However, I feel quite uncomfortable applying it with note 989286 in the back of my mind.

Kiran, would you know if the solution you proposed would lead to a "supported" solution?

Thanks!

Jan

former_member184578
Active Contributor
0 Kudos

Hi Jan,

If I would have to do this, I will prefer this as there is no need to get data back from Web Dynpro Application to our Dynpro.

One more approach is create a Transaction code for your web dynpro Application and on click of button in Dynpro Call the Web dynpro transaction using call transaction statement, which will open our Web dynpro Application in browser(can call in SAP GUI also).

Check this link in this thread [for creating a transaction code to Web Dynpro ABAP Application.|;

Hope this helps u.,

Thanks & Regards,

Kiran.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

If at all, I would try your option "Running a Webdynpro from SAPGui". It is explicitly said that communication between SAP-GUI related stuff and the WDA Framework doesn't run in the same roll, but since you don't need to exchange data via LUW and you don't want to interact with the Dynpro from the WebDynpro (which wouldn't work), it might be possible just using a parameter transaction in fullscreen or the like as you suggested...

You should summon Thomas from the 'WDA-Expert-Realms' to confirm this though )

EDIT: Just curious, what kind of Dynpro are we talking about? Is it very complex? Would it be possible to migrate it to Webdynpro?

Cheers, Lukas

Edited by: Lukas Weigelt on Jan 19, 2012 12:15 PM