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.

Reading URL parameter values in WebDynpro

*Reading parameter values from URL

data lv_val1 type string.

data lv_val2 type string.

* Example URL

*www.anilozgen.com/?val1=anil&val2=ozgen

lv_val1 =

  wdr_task=>client_window->get_parameter‘val1’ ).

lv_val2 =

  wdr_task=>client_window->get_parameter‘val2’ ).