cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Navigation links

former_member210266
Active Participant
0 Kudos

Hi Experts

An outbound plug can be linked to multiple inbound plugs.But only one navigation link is active at a time.Depending upon certain conditions, I want to activate a specific navigation link.What is the approach to do so?

For example, I have three views,View1,View2 and View3.I have created an outbound plug (OP1) in View1 and inbound plugs in View2 (IP2) and View3 (IP3).I have created navigation links between OP1 and IP2 as well as OP1 and IP3.I want on some conditions to navigate to View2 and on some to View3 using the already created navigation links.

Thanks and regards

Swati

Accepted Solutions (1)

Accepted Solutions (1)

chandani_kaur
Active Participant
0 Kudos

Hello Swati,

You first create a out-bound plug say in Main view and then one inbound plug in each view say view1 view2 etc.

Now enbedd the view in window.Do not create navigation link

Next say have two buttons on Main view, if you click on button 1 then view 1 will be called else view 2 will be called.

So if we click on button 1 in action  method you can write following piece of code to navigate to view 1:

data:
l_view_api  type ref to if_wd_view_controller,
l_navigation_services_new type ref to if_wd_navigation_services_new.
l_view_api = wd_this->wd_get_api( ).
L_navigation_services_new ?= l_view_api.
l_navigation_services_new->DO_DYNAMIC_NAVIGATION(
exporting

    SOURCE_WINDOW_NAME        =   'ZNAVIGATE'  " Name of Window in Which Is to Be Navigated

    SOURCE_VUSAGE_NAME        =   'MAIN_USAGE_0'  " Name of View Embedding

    SOURCE_PLUG_NAME          =    'GOTO_VIEW' " Name of Outbound Plug

*    PLUG_PARAMETERS           =     " Parameter List for Custom Events

*    TARGET_COMPONENT_NAME     =     " Name of Component of Target

*    TARGET_COMPONENT_USAGE    =

    TARGET_VIEW_NAME          =   'VIEW_1'  " Name of Target View

    TARGET_PLUG_NAME          =   'VIEW_1'  " Name of Inbound Plug

*    TARGET_EMBEDDING_POSITION =     " Embedding Position of Target View (See Documentation)

*  receiving

**    REPOSITORY_HANDLE         =

).

*  catch CX_WD_RUNTIME_REPOSITORY.    "


This will navigate to view 1.

Hope it answer's your query.

Thanks & Regards,

Chandani

former_member210266
Active Participant
0 Kudos

Thanks Chandani. I have removed the static navigation links and my code started working.Finally it worked with a single outbound plug. But why the static navigation links were not working.... is still a puzzle for me.

Regards

Swati

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Swati,

Please refer to below link.

https://scn.sap.com/thread/1684351

Kind Regards

Sunil.

Former Member
0 Kudos

If you see even in code wizard we fire the out bound plug. I think creating 3 outbound and 3 inbound and firing them at runtime with condition would be ok.

former_member210266
Active Participant
0 Kudos

Hi Sunil

Thanks for the link. This is exactly what I am talking about. But I didnt find my answer here also coz it also gives the alternative to create multiple outbound plugs.

But what I really wanted is to follow the single outbound plug approach and not any alternatives.

Hope to get the correct answer very soon.

Thanks and regards

Swati

Former Member
0 Kudos
former_member210266
Active Participant
0 Kudos

Hi Manish

Thanks for the reply. But I really want is a little different. These methods are related to creation of a navigation link dynamically.But I already have the navigation links. I just want to use a specific link at runtime.

Here you can see that I have already created two navigation links statically. I just need to use one of them depending upon certain conditions at runtime.As only one of the links is active at runtime. And by default, the link with IP3 is active.

Thanks and regards

Swati

Former Member
0 Kudos

create a method and do if..else code in that method

and call it where needed.

only this approach is possible ,i haven't came across this yet.

but done it same like you did

pls. reply if you done

former_member210266
Active Participant
0 Kudos

Hi Manu

There is always an alterative appraoch to everything, but if SAP has provided the provision to create multiple links for a single outbound plug, which you can see in the picture in my above reply, then there must be a way to use it. I just want to find that approach. If its possible( and it is), then I want to use it.

Thanks and regards

Swati

Former Member
0 Kudos

Hi,

Create 1 inbound plug and two outbound plugs for view1..

Give condition within if..else and fire corresponding outbound plugs..

create navigation link between outbound plugs of view1 with inbound plug of view2 and view3 in the window..

Former Member
0 Kudos

yes there must be.

but second one is an alternative approach may be

check if it works for u.

ur thought is good effort, i haven't yet came accross such scenario