Skip to Content
0
Sep 02, 2015 at 11:15 AM

NWBC 5.0 and cl_lsapi_manager=>navigate_to_transaction with force SAPGUI on

555 Views

Hello,

I've seen some discussion about how to open SAP GUI from Webdynpro application but none of them did not work as I intend in NWBC 5. There is no problem when using HTML GUI.

Ok, so maybe what I have done so far:

1) cl_lsapi_manager=>navigate_to_transaction with parameter force_sapgui on, result is that when I navigate to received url I receive sap shortcut to open/save . I can then open this shortcut and new window (not tab) of NWBC is open with SAP GUI an transaction called. Additionally once buton with action to open was used, it's not working for the next click

Code:

data(lo_lsapi) = cl_lsapi_manager=>get_instance( ).

cl_lsapi_manager=>navigate_to_transaction(

exporting

* sm59_alias = sm59_alias " SM59 Alias of remote system

transaction = 'MM03' " Transaction Name

navigation_mode = 0 " 0 - inplace / 1 - new window

* parameters = parameters " Parameter List, e.g. customerID=4711 for Target Application

* dynp_okcode = dynp_okcode " DYNP OK Code

force_sapgui = abap_true " Force using of SAPGUI native, even in HTML client

importing

url = data(url)

exceptions

error = 1

not_supported = 2

others = 3

).

if sy-subrc <> 0.

* message id sy-msgid type sy-msgty number sy-msgno

* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

lo_lsapi->navigate(

location = url

mode = '0'

).

2) when I use cl_nwbc=>url_construct with paramater html_client off and cl_nwbc=>url_launch then transaction is opened in new tab but with HTML GUI instead of SAP GUI

Code :

cl_nwbc=>url_construct(

exporting

canvas_wda__client_type = 'nwbc'

canvas_transaction = 'MM03'

html_client = abap_false

canvas__window = cl_nwbc=>canvas__window__app

receiving

url = data(lv_url) ).

call method cl_nwbc=>url_launch

exporting

url = lv_url.

3) cl_nwbc_sapgui_shortcut=>url and call method cl_nwbc=>url_launch then it does what it expect to do means creates sap shortcut and then acts like point 1)

Code:

cl_nwbc_sapgui_shortcut=>url(

exporting

iv_transaction_code = 'MM03'

iv_gui_size = cl_nwbc_sapgui_shortcut=>sc_gui_size_maximized

iv_reuse_existing_connection = abap_true

iv_server_relative_url = abap_false

receiving

rv_url = data(rv_url)

).

call method cl_nwbc=>url_launch

exporting

url = rv_url.

Now the question if it works the same at your installation or this is something wrong with mine? Maybe other version of NWBC are working differently here?

EDIT: I've also read about this possibility How to call a SAP GUI transaction from Webdynpro ABAP using NWBC but would like to avoid it as not always we have underlying business object there, and I think that creation of dummy one for navigation purpose isn't the best approach.

Maybe also Web Dynpro ABAPcan take a look at it?

Regards

Łukasz