Call fiori app from SAPGUI transaction
source link: https://blogs.sap.com/2020/06/25/call-fiori-app-from-sapgui-transaction/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Call fiori app from SAPGUI transaction
EDIT : There is a standard method to do this, it’s easy to use at least if you found it in the documentation
Thanks to Dennis Schulmeister-Zimolong
cl_lsapi_manager=>navigate_to_intent(
object = ls_ui5_navigation-semantic_object
action = ls_ui5_navigation-semantic_action
parameters = lt_lsapi_parameters
navigation_mode = if_lsapi=>gc_s_navigation_mode-inplace
).
Handling Cross-App Navigation for SAP GUI and Web Dynpro Apps
There are many blog posts that explain how to call sapgui transaction from Fiori launchpad.
But what if you want to do the opposite : call Fiori App from sapgui transaction. Why ?
Let’s take this scenario :
Your customer has SAP ECC with many SAPGUI transactions that work great. He moved to S/4 HANA with a conversion project so that he could keep his old transaction.
Now he wants a new custom development that will be called from one of his old transaction. You have 2 options :
- Create a new SAPGUI transaction and use “CALL TRANSACTION” in ABAP
- Create a new Fiori APP (of course !!)
The second choice should be the best option but we need a way to call the fiori app.
I created a little method to do this. It works from SAPGUI, from a web browser or from business client.
Note that either when you use the web browser or the business client, the fiori app will open in a new tab which is coherent with the functionnality of the fiori launchpad (when you call a sapgui transaction from a fiori app, it opens in a new tab).
Now let see the code !
"! Call Fiori app from sapgui
"! @parameter i_semantic_object | Semantic object
"! @parameter i_action | action
METHODS call_fiori_app_from_sapgui
IMPORTING
i_semantic_object TYPE /ui2/semantic_object
i_action TYPE /ui2/action
i_path TYPE string OPTIONAL.
METHOD call_fiori_app_from_sapgui.
DATA(business_client) = NEW cl_nwbc( ).
DATA(business_client_context) = business_client->context_get( ).
IF business_client_context IS INITIAL.
"Create sicf node (In this case, alias is created from sys id and client)
DATA(node_path) = `/` && sy-sysid && `_` && sy-mandt.
TRANSLATE node_path TO LOWER CASE.
DATA(lo_start_url) = NEW /ui2/cl_start_url( iv_icf_node_path = node_path ).
"add sap params "sy-mandt", "sap-language", "sap-language"
lo_start_url->add_sap_params( ).
"add fragment
IF i_semantic_object IS NOT INITIAL.
IF i_path IS NOT INITIAL.
lo_start_url->change_fragment(
iv_fragment = |{ i_semantic_object }-{ i_action }&{ i_path }| ).
ELSE.
lo_start_url->change_fragment( iv_fragment = |{ i_semantic_object }-{ i_action }| ).
ENDIF.
ENDIF.
"start in browser if business client is not active
lo_start_url->start_browser( ).
ELSE.
DATA business_client_url TYPE string.
IF i_path IS NOT INITIAL.
business_client_url =
business_client_context-login_url && |#{ i_semantic_object }-{ i_action }&{ i_path }|.
ELSE.
business_client_url =
business_client_context-login_url && |#{ i_semantic_object }-{ i_action }|.
ENDIF.
business_client->url_launch(
url = business_client_url ).
ENDIF.
ENDMETHOD.
There is just one thing that you have to change in the code : you need a way to find your SICF node from the fiori launchpad url. (just after the comment “”Create sicf node (In this case, alias is created from sys id and client)”).
You can add a path at the end of the url to go directly to an entity by navigation.
Hope it will help !
Recommend
-
3
Call a Spring Bean method with different transaction attributes? advertisements What happens if a transactional method with certain transactio...
-
95
Alexey Arsenyev December 22, 2021 7 minute read
-
2
Akshay Yerawar June 1, 2022 5 minute read
-
5
Secure Fiori App in SAP BTP with XSUAA Requirement is to have Managed App Router based Fiori app in SAP BTP- CF which is calling OData/web service(We have taken example of Northwind for this project) and a...
-
4
Kiran Chavan June 29, 2022 2 minute read
-
17
Introduction Motivation: Recently I’ve had an experience in implementing standard SAP Fiori Applications for Plant Maintenance module. I have spent some time to collect all the missing information, prerequisites, configur...
-
3
Intro These notes might help people with the eponymous task; they are not as wide-ranging and thorough as the official instructions and guides from SAP, instead these are just some remarks based on author’s recent experience, which might...
-
10
Jayanta Choudhuri January 11, 2023 3 minute...
-
3
Omkar Surve February 2, 2023 1 minute read ...
-
5
Intro SSO for SAPGUI logins from a Linux client machine can be set up using X.509 certificates – the idea is that the client machine presents a (public key) certificate identifying a SAP user by their SNC name to the target SAP system, an...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK