Skip to Content

What is this about?

 

This is a solution for triggering of the navigation from backend side in ABAP based application, not for the client side. The good thing about it, it works transparently for a consumer in most of the SAP shells (NWBC, SAP GUI, Portal). There is no need to check for some environment flags, implement fallbacks etc. The same code works everywhere and behaves in the standard for the hosting shell way. The caller can control the way how the target shall be open: in a new tab (for NWBC) / window or in-place. Location URLs may be of different kinds: plain, OBNs, ABAP Launchpad (LPD_CUST) links or PFCG nodes – proper resolving of targets will be ensured in the best way supported by the current environment.

The most common use cases, when the solution shall be used:

  • OBN or absolute navigation in WebDynpro running in NWBC
  • OBN or absolute navigation from SAP GUI application embedded in NWBC
  • Calling WebDynpro from SAP GUI transaction

Environment/Application matrix

SAP GUI WebDynpro BSP (pure HTML)
NWBC http://www.sap.com
ls-navigation://
ls-obn://
ls-tr:// – native SAP GUI
ABAP LPD Links
http://www.sap.com/
ls-navigation://
ls-obn://
ls-tr:// – native SAP GUI
ABAP LPD Links
http://www.sap.com
ls-navigation://
ls-obn://
ls-tr:// – Web GUI
ABAP LPD Links
Portal http://www.sap.com
ls-obn://
ls-tr:// – Web GUI
ABAP LPD Links
http://www.sap.com
ls-obn://
ls-tr:// – Web GUI
ABAP LPD Links
Standalone http://www.sap.com
ls-navigation://
ls-obn://
ls-tr:// – native SAP GUI
ABAP LPD Links (only new window
navigation or Transaction Native)
http://www.sap.com
ls-navigation://
ls-obn://
ls-tr:// – Web GUI
ABAP LPD Links (only new window
navigation or Transactions as WebGUI)

Navigation protocol extensions

Protocol Example Description
http://www.sap.com Direct absolute navigation of any kind, which does not need any additional resolving
ls-navigation:// ls-navigation://yi3~sap_dal_demo_role_1:23?usr02-bname=xyz Navigation to specific node (nodeid 23) in specific PFCG role (sap_dal_demo_role_1). Indirect, need resolving to find out target application.
ls-obn:// ls-obn://yi3.sflight.display?resolvingMode=Default&obnParameters=name%3dvalue Navigation to specific OBN target (sflight.display) defined in one (or several) user assigned roles with support of parameter mapping. Indirect, need resolving to find out target application.
ls-tr:// ls-tr://se38?rs38m-programm=nwbc_sapgui_lsapi_test&dynp_okcode=strt Navigation to specific transaction (SE38) in any system (need SM59 alias/destination for remote case). Support as adaptive SA GUI UI selection (native or WebGUI) based on client support as “force” mode, to start native SAP GUI even if client can not directly embed native SAP GUI app (with help of SAP GUI shortcut service)
ls-ibn:// ls-ibn://SalesOrder-display?id=7014 Navigation to a specific intent (SalesOrder-display) with support of intent parameters. Works in Fiori Launchpad (FLP), SAP BC and in SAP GUI/WebDynpro standalone mode.
ABAP LPD (Launch Pad) links

OBN://BOTechnicalName=purchaserequisition/

BOSystemAlias=SAP_ERP_Procurement/

Operation=crtpurreq?HistoryMode=1&windowId=WID1238756457255&NavMode=0

ROLES://portal_content/com.sap.pct/every_user/

com.sap.pct.erp.common.bp_folder/

com.sap.pct.erp.common.roles/
com.sap.pct.erp.common.erp_common/

com.sap.pct.erp.common.lpd_start_wd_abap…

or …lpd_start_url… or …lpd_start_transaction… or …lpd_start_bw_7x… etc

ABAP LaunchPad links, defined in LPD repository. Indirect, need resolving to find out target application.

ls-tr:// protocol extension for IF_LSAPI=>NAVIGATE

This protocol extension allows easy way definition of navigation target, that will lead to calling of SAP GUI transaction.

Formatls-tr://<SM59 destination>~<transaction name>?<URL parameters>&<transaction parameters>

  • If the SM59 destination is not defined (~ can be skipped in this case), the local system (system where navigation has been triggered) will be used. Both as SM59 destination alias as transaction name shall be URL encoded.
  • Transaction parameters can be added as standard URL parameters after ? sign. Parameters with sap- at the beginning of the parameter name will be automatically skipped.
  • The transaction will be executed in native SAP GUI or in WebGUI, depending on client implementation. To force starting of the transaction always in native SAP GUI mode, use sap-force_sapgui URL parameter, in addition to transaction parameters (&sap-force_sapgui=X). The transaction will be started in native mode using NWBC SAP GUI shortcut service instead of WebGUI if client not able not start SAP GUI natively.

Example: ls-tr://Y3S100~SE38?sap-force_sapgui=X&rs38m-programm=nwbc_sapgui_lsapi_test& dynp_okcode=strt

Parameters:

  • Y3S100 – SM59 alias for system Y3S with client 100 (shall be defined in source system SM59)
  • SE38 – transaction to start
  • sap-force_sapgui=X – URL parameter, telling the engine to always use native SAP GUI for starting of the transaction. The parameter is not passed to the transaction.
  • rs38m-programm=nwbc_sapgui_lsapi_test&dynp_okcode=strt – transaction parameters telling to prefill some fields and execute OKCODE (dynp_okcode parameter).

To check, if the client supports native SAP GUI, engine checks for feature IF_LSAPI=>MC_FEATURE_NWBC_NATIVE_SAPGUI (3) with IF_LSAPI->IS_SUPPORTED method.

 

Intent-Based Navigation support (ls-ibn)

There is already a way to express the navigation intent for the application in form of the FLP URL:

https://fes.wdf.sap.corp:44355/sap/bc/ui2/flp?sap-client=120&sap-language=EN#SO-action?
A=me%20you&B=%2520&C=20%2580%25&D=or%20a%20blank%3f&E=H%26M!%3DC%26A

But the format of the URL and the way of construction of it in ABAP is not very trivial and requires in knowledge about format specifics and location of current Front End server (server address, FLP path, client, language etc) which is not always available (especially on backend server or when navigation intent plan to be serialized, but not currently executed). The format below provides learner IBN address definition, that it is decoupled from FLP URL definition and URL format at all.

The proposed format includes only serialized navigation intention (intent == semantic object + action AND intent parameters) and no FLP specifics.

Formatls-ibn://<SemanticObject>-<action>?<parName1>=<parValue1>&<parName2>=<parValue2

Parameters:

  • ls-ibn:// – definition of IBN protocol. “ls-” in front is shortening of “LShape”. It has nothing to do with FLP, Fiori or IBN, but just a heritage of NWBC, which uses such prefix for all supported protocols.
  • <SemanticObject>-<action> – the intent, consisting of Semantic Object name and Action separated by “-“.
  • ? – intent / parameters separator
  • <parName1>=<parValue1>&… – parameter part with parameters name/value pairs, separated by &, where both name and value are URL encoded

Example: ls-ibn://SalesOrder-display?id=7014

The format is very similar to URL formatting rules, except protocol and server address part. In contrast to the double encoding of the intent parameters in FLP URL, in the format above, parameters are encoded only once.

The length of the “URL” is not limited, while it is not planned to be executed directly by a Web browser and always requires preprocessing by the client, so it does not have browser limitations for GET requests (e.g. 2048 characters).

To check, if the client supports native SAP GUI, engine checks for feature IF_LSAPI=>MC_FEATURE_NAVIGATE_IBN with IF_LSAPI->IS_SUPPORTED method.

 

NWBC SAP GUI Shortcut service

With note 1835643, NWBC ABAP runtime was extended with new service, allowing you to start standalone native SAP GUI by using the URL.

Format: https://<server name and port>/nwbc/~sapguilink?transaction=<transaction code>&parameters=<encoded transaction parameters>

Following URL parameters are supported:

  • transaction – transaction code (can be provided either transaction code or report)
  • destination – destination (SM59 alias or directly RFC destination)
  • user – user for which shortcut shall be generated, BASE64 encoded
  • parameters – parameters name-value pairs, in the form of a query string, URL encoded. For example par1=%20A&par2=123
  • title – SAP GUI window title
  • system_id – system id
  • report – report name to start (can be provided either transaction code or report)
  • report_var – report variant, if a report is provided
  • sap-client – client (MANDT)
  • app_server – application server name (sys_number shall be also provided then)
  • sys_number – system number for application server
  • language – language, as SAP GUI language but not web form (E instead of EN)
  • skip_sel_screen – skip selection screen parameter if calling transaction

Example: https://www.sap.corp:57801/nwbc/~sapguilink?transaction=se38&parameters=RS38M-PROGRAMM%3DNWBC_SAPGUI_LSAPI_TEST

  • abcd2.dcd.sap.corp:57801 – server and port
  • SE38 – transaction code
  • RS38M-PROGRAMM%3DNWBC_SAPGUI_LSAPI_TEST – encoded RS38M-PROGRAMM=NWBC_SAPGUI_LSAPI_TEST, that means put in field RS38M-PROGRAMM value NWBC_SAPGUI_LSAPI_TEST.

This service is used internally in ls-tr:// protocol extension for calling native SAP GUI transaction if the client does not support this feature natively.

 

Example navigation targets

  • http://www.google.com
  • /sap/bc/webdynpro/sap/s_epm_ux_po_gaf?WDCONFIGURATIONID=S_EPM_UX_PO_GAF&sap-client=111&sap-language=EN
  • ls-tr://se38?RS38M-PROGRAMM=NWBC_SAPGUI_LSAPI_TEST
  • ls-obn://.NWBC.NAVIGATION_TEST
  • ls-tr://se38?rs38m-programm=nwbc_sapgui_lsapi_test&dynp_okcode=strt
  • ls-tr://se38?sap-force_sapgui=X&rs38m-programm=nwbc_sapgui_lsapi_test&dynp_okcode=strt

 General call snippet

lv_location = 'ls-tr://se38?rs38m-programm=nwbc_sapgui_lsapi_test&dynp_okcode=strt'.
cl_lsapi_manager=>get_instance( )->navigate(location  = lv_location
                                            mode      = 1 " in new window
                                            parameters = it_parameters ).

 Call WebDynpro Application

DATA: lv_wda_url TYPE string,
      lt_param  TYPE tihttpnvp,
      ls_param  LIKE LINE OF lt_param,
      lo_url    TYPE REF TO cl_url.

CREATE OBJECT lo_url.

ls_param-name  = cl_url=>mc_par_wda_config2.
ls_param-value = `S_EPM_UX_PO_GAF`.
APPEND ls_param TO lt_param.

lv_wda_url = lo_url->wda( application = `S_EPM_UX_PO_GAF` query_parms = lt_param ).

" open WDA => /sap/bc/webdynpro/sap/s_epm_ux_po_gaf?WDCONFIGURATIONID=S_EPM_UX_PO_GAF&sap-client=111&sap-language=EN
" in new tab or window
cl_lsapi_manager=>get_instance( )->navigate( location = lv_wda_url mode = 1 ).

 

Helper functions for generating URLs + triggering navigation:

  • CL_LSAPI_MANAGER=>NAVIGATE_TO_OBJECT – generates ls-obn:// call
  • CL_LSAPI_MANAGER=>NAVIGATE_TO_TRANSACTION – generates ls-tr:// call

 

More info about IF_LSAPI=>NAVIGATE method

More info about NAVIGATE method can be found in the documentation of interface IF_LSAPI, available in development systems with SAP_BASIS >= 7.31. In lower SAP_BASIS releases only interface itself is available. Documentation was not downported.

How to call transaction with parameters in native SAP GUI by link (using SAP Shortcut service from NWBC):

#NWBC SAP GUI Shortcut service

 

Availability:

Recommended: use the UI2 addon and corresponding UI2 classes (/UI2/CL_LSAPI_MANAGER), if possible. SAP_BASIS version is not in development anymore.

SAP_BASIS Limited Support Full Support
700 SP22 SP28
701 SP07 SP12
702 SP05 SP12
711 SP07 SP11
720 SP04 SP08
730 SP01 SO09
731 SP03 SP03
740 SP00 SP02
741 SP00 SP00
> 741 SP00 SP00

Some of the functionality (ls-obn://, ls-navigation://) requires NWBC Runtime 35, which is available only with later SP.
So Limited Support – is navigation using NWBC Runtime 30, and Full Support navigation using NWBC Runtime 35 with all features available.

Functionality is available after implementing of the following notes:

  • 1820764 – SAP NWBC ABAP Runtime Patch 28 (contains base functionality, released)
  • 1835643 – SAP NWBC ABAP Runtime Patch 29 (SAP GUI shortcut service + extension for ls-tr:// protocol, not yet released
  • 2653653 – SAP NWBC ABAP Runtime Patch 29 (SAP GUI shortcut service + extension for ls-tr:// protocol, not yet released

Recommended: do not install patch 29 note, but use latest NWBC Runtime patch note. It will install all prerequisites (as of patch 28 and 29) and will ensure you have up to date NWBC state. Latest patch note can be that can be found in consulting note 1353538.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply