How to embed view in a window – WebDynpro

Scenario: We want to embed a view(MAIL_VIEW) in a window(MAIL_WINDOW) on WebDynpro Application.

Double-click on window name at the left menu.

On the opening page, write click on your window name and click on ‘Embed View

 1.jpg

Click on search-help button of View to Embedded

 2

Double Click on view that you want to be embedded

 3.jpg

OTR text in WebDynpro

Go to transaction SOTR_EDIT

Click on Create button

Fill required fields like below

1

Click on Savebutton.

Open your WD application

Create a Label element

Create an Input Field

Assign attribute of ‘labelFor’ as InputField

Write the code of your OTR text into attribute of your Label.

 2

3

How to create a basic WebDynpro alv

Double-click on WD application.

 1

Enter component name on the following screen.

 2

Double-click on ‘COMPONENT CONTROLLER’ and click on ‘PROPERTIES’ tab

Click ‘Create Controller Usage’ button.

Select two components on the following screen.

 3

Create node at Component Controller Contex.

Double-Click on Interface Controller Usage.

 4

Click on ‘Controller Usage’ button on the following screen.

Drag and drop your node from Component Controller to Interface Controller.

 5

Create a ViewContainerUIElement on layout.

 6

Go to your defined Window and Create an ‘Embed View’ to your view.

 7

 8

Open your view’s WDOINIT method and write the following codes.

  datalo_node type ref to if_wd_context_node.

  datait_aoz type standard table of if_v_main=>element_aoz_table,

        is_aoz like line of it_aoz.

  select from zanil

  into corresponding fields of table it_aoz.

  lo_node wd_context->get_child_nodename ‘AOZ_TABLE’).

  lo_node->bind_tableit_aoz ).

 10

How to export table values to excel in WebDynpro

Create a button named ‘Export to excel’.

Define an action to your button.

clip_image001

Result:

clip_image003.jpg

clip_image005

Click here to see full code.

How to make an object visible or invisible dynamically.

1-) Define an attribute named ‘WDUI_Visibility’

       Set its TYPE as ‘WDUI_VISIBILITY’

 

2-) Open your objects properties which you

       You want to make visible or invisible.

 1

3-) Set  attribute ‘WDUI_Visibility’ object you have created

     at  ‘Visible’ property.

 2

Codes:

 

 DATA lo_el_context TYPE REF TO if_wd_context_element.

 DATA ls_context TYPE wd_this->Element_context.

 DATA lv_wdui_visibility TYPE wd_this->Element_contextwdui_visibility.

 lo_el_context wd_context->get_element( ).

 lv_wdui_visibility ‘1’. “1-Unvisible 2 Visible

 lo_el_context->set_attribute(

   name =  `WDUI_VISIBILITY`

   value lv_wdui_visibility ).