cancel
Showing results for 
Search instead for 
Did you mean: 

WDA Embedding a view dynamically on an other view

Former Member
0 Kudos

Hi gurus,

I'm developing my first serious wda application, it has several views (esp_view1...10) that must be embedded at runtime on a view (com_view) on the main window, that has embedded at design time two views: com_view and an other (not relevant for my question).

I have defined a global variable in the controller esp_view type string that (depending on certain conditions) contains the name (esp_view1...10) that I want to embed on com_view.

I've readed several threads in the forum, several manuals that show how embed views dynamically on a window (not on an other view), and after seeing several samples I've tried using do_dynamic_navigation, but I'm incapable to do it (may be I don't understand still component usages??).

There is something that I'm forgetting??

Thanks in advance,

Alejandra

Accepted Solutions (0)

Answers (3)

Answers (3)

arjun_thakur
Active Contributor
0 Kudos

Hi Alejandra,

You can refer this article:[Creating Navigations and Embedding Views at Runtime - Web Dynpro ABAP|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50f3660d-ad29-2b10-2482-8120e56942dd] and can also see the reply given by Thomas Jung in this thread: .

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi,

I'm trying by the way:

DATA:

l_api_main TYPE REF TO if_wd_view_controller.

l_api_main = wd_this->wd_get_api( ).

TRY.

l_api_main->do_dynamic_navigation(

source_window_name = 'YWD_TESTV'

source_vusage_name = 'MAIN_USAGE_0'

source_plug_name = 'OUT1'

target_component_name = 'YWD_TESTV'

target_view_name = 'VIEW1'

target_plug_name = 'DEFAULT'

target_embedding_position = 'MAIN/VIEW_CONT').

.

CATCH cx_wd_runtime_repository .

RAISE EXCEPTION TYPE cx_wdr_rt_exception.

ENDTRY.

at the moment, with a simple sample it works... I think in this form it will be more parametrizable.

Thanks a lot for everybody,

Alejandra

Former Member
0 Kudos

Hi,

Please check the below article 'Creating navigations and Embedding view at Run time'

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

Former Member
0 Kudos

hi,

You can proceed this way :

1. Make 10 ViewContainter in your view_common i.e Place ViewContaier UI element in your common view.

2. Embed those views (V1-- V10) into these containers. For that Go to Windows, and inside windows you will find your View Containers. Drag and Drop your views under your component into the Windows.

3. Now make Outbound plugs in your Views(V1-- V10) and 10diff Inbound plugs in your Common View.

4.Create navigation link between outbound n inbound views.

5. For that , Go to windows and drag n drop outbound plug to inbound plug.

6.Now at run time you can fire the outbound plug of any View(V1--V10) whichever you want.

7. For firing a plug , you can use Code Wizard(control + F7).

Depending on your condition , fire plug using :

wd_this->fire_out_view1_plg( ). here out_view1 is outbound plug of View1.

I hope it helps.

Edited by: Saurav Mago on Apr 23, 2009 3:09 PM