0% found this document useful (0 votes)
15 views

17 Dynamic Modification UI Hierarchy

This document provides instructions for creating a dynamic Web Dynpro component with a MAIN_VIEW that contains a button and text. When the button is clicked, a success message is reported using the message manager. The component is then embedded in a window and executed to test the dynamic functionality.

Uploaded by

Salih Özdemir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

17 Dynamic Modification UI Hierarchy

This document provides instructions for creating a dynamic Web Dynpro component with a MAIN_VIEW that contains a button and text. When the button is clicked, a success message is reported using the message manager. The component is then embedded in a window and executed to test the dynamic functionality.

Uploaded by

Salih Özdemir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Create a Web Dynpro Component called Z_DYNAMIC 

Create a View called MAIN_VIEW , on the Method tab double-click the WDDOMODIFYVIEW and
write the following coding. 

method WDDOMODIFYVIEW .
data : lr_textview type ref to cl_wd_text_view.
Data:lr_container type ref to cl_wd_uielement_container,
lr_row_head type ref to cl_wd_row_head_data,
lr_button type ref to cl_wd_button,
lr_input type ref to cl_wd_input_field,
lr_flow_data type ref to cl_wd_flow_data,
lv_child_id type string.
if first_time = 'X'.
lr_button = cl_wd_button=>new_button( view = view
text = 'Create Button'
on_action = 'CLICK' ).
lr_row_head = cl_wd_row_head_data=>new_row_head_data( element =
lr_button ).
lr_button->set_layout_data( lr_row_head ).
lr_button->set_tooltip( value = 'Tooltip' ).
lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_button ).
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_container->add_child( lr_button ).
lr_textview = cl_wd_text_view=>new_text_view( view = view
text = 'Welcome to Dynamic
Layout Design' ).
lr_row_head = cl_wd_row_head_data=>new_row_head_data( element = lr_textview
).
lr_textview->set_layout_data( lr_row_head ).
lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_textview ).
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_container->add_child( lr_textview ).
endif.
endmethod. 

Now create an Action called CLICK in the MAIN_VIEW…. Action Tab. 


 

In the MAIN_VIEW, on the Method tab double-click the ONACTIONCLICK and write the following
coding.  

method ONACTIONCLICK .
* get message manager
DATA: L_CURRENT_CONTROLLER TYPE REF TO IF_WD_CONTROLLER,
L_MESSAGE_MANAGER TYPE REF TO IF_WD_MESSAGE_MANAGER.
L_CURRENT_CONTROLLER ?= WD_THIS->WD_GET_API( ).
CALL METHOD L_CURRENT_CONTROLLER->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = L_MESSAGE_MANAGER .
* report message
CALL METHOD L_MESSAGE_MANAGER->REPORT_SUCCESS
EXPORTING
MESSAGE_TEXT = 'Dynamic Event Triggered Successfully' .
endmethod.

Navigate to the window and embed view MAIN_VIEW into the window. 

Create a Web Dynpro application for your Web Dynpro component: 

Activate your Web Dynpro component and execute. 

Output 
 

You might also like